xunge/DecIR huggingface dataset:
/* Variables and functions */
int abs(int);
int CalculateIncludeAngle(int angle1, int angle2) {
  if (angle1 == -1 || angle2 == -1)
    return 0;
  int iTemp = abs(angle2 - angle1);
  return iTemp <= 180 ? iTemp : 360 - iTemp;
}


x86 assembly (clang, -O0):
<CalculateIncludeAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1132 <CalculateIncludeAngle+0x22>
cmpl   $0xffffffff,-0xc(%rbp)
jne    113e <CalculateIncludeAngle+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <CalculateIncludeAngle+0x65>
mov    -0xc(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xb4,-0x10(%rbp)
jg     1164 <CalculateIncludeAngle+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    116f <CalculateIncludeAngle+0x5f>
mov    $0x168,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateIncludeAngle>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
je     1125 <CalculateIncludeAngle+0x25>
cmp    $0xffffffff,%esi
je     1125 <CalculateIncludeAngle+0x25>
sub    %edi,%esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    $0x168,%eax
sub    %ecx,%eax
cmp    $0xb5,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @CalculateIncludeAngle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store i32 0, i32* %3
br label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = call i32 @abs(i32 %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp sle i32 %18, 180
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = load i32, i32* %6
br label %25
22: ; preds = %13
%23 = load i32, i32* %6
%24 = sub nsw i32 360, %23
br label %25
25: ; preds = %22, %20
%26 = phi i32 [ %21, %20 ], [ %24, %22 ]
store i32 %26, i32* %3
br label %27
27: ; preds = %25, %12
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @CalculateIncludeAngle(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
%4 = icmp eq i32 %1, -1
%5 = or i1 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = sub nsw i32 %1, %0
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = icmp ult i32 %8, 181
%10 = sub nsw i32 360, %8
%11 = select i1 %9, i32 %8, i32 %10
br label %12
12: ; preds = %2, %6
%13 = phi i32 [ %11, %6 ], [ 0, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
bool LCDRasterEnabled(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44050000);
  return (((*((volatile uint32_t *)(ui32Base + 0x00000028))) & 0x00000001)
              ? true
              : false);
}


x86 assembly (clang, -O0):
<LCDRasterEnabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterEnabled>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x28(%rax),%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LCDRasterEnabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141178368
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 40
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @LCDRasterEnabled(i32 %0) {
%2 = icmp eq i32 %0, 1141178368
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 40
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_VENDOR_REMOTE_BUTTON_UP;
void cec_msg_vendor_remote_button_up(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_VENDOR_REMOTE_BUTTON_UP;
}


x86 assembly (clang, -O0):
<cec_msg_vendor_remote_button_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_vendor_remote_button_up>:
movl   $0x2,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_VENDOR_REMOTE_BUTTON_UP = global i32 0
define void @cec_msg_vendor_remote_button_up(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_VENDOR_REMOTE_BUTTON_UP
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_VENDOR_REMOTE_BUTTON_UP = global i32 0
define void @cec_msg_vendor_remote_button_up(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_VENDOR_REMOTE_BUTTON_UP
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PVD_ISR();
int /*<<< orphan*/ VDDIO2_ISR();
void PVD_VDDIO2_ISR(void) {
  PVD_ISR();
  VDDIO2_ISR();
}


x86 assembly (clang, -O0):
<PVD_VDDIO2_ISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PVD_ISR@plt>
mov    $0x0,%al
call   1040 <VDDIO2_ISR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PVD_VDDIO2_ISR>:
push   %rax
xor    %eax,%eax
call   1030 <PVD_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <VDDIO2_ISR@plt>

LLVM IR (-O0):
define void @PVD_VDDIO2_ISR() {
%1 = call i32 (...) @PVD_ISR()
%2 = call i32 (...) @VDDIO2_ISR()
ret void
}

LLVM IR (-O2):
define void @PVD_VDDIO2_ISR() {
%1 = tail call i32 (...) @PVD_ISR()
%2 = tail call i32 (...) @VDDIO2_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterDataPut(unsigned long ulBase, unsigned char ucData) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ucData;
}


x86 assembly (clang, -O0):
<I2CMasterDataPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDataPut>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    %ebp,%eax
mov    %rax,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @I2CMasterDataPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CMasterBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i64
%10 = load i64, i64* %3
%11 = add i64 %10, 8
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
define void @I2CMasterDataPut(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @I2CMasterBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = zext i8 %1 to i64
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADD_EREALLOC(long long, long long);
int /*<<< orphan*/ assert(void *);
void *erealloc(void *, long long);
void *zzerealloc(void *p, long long x, long long y) {
  void *r = erealloc(p, y);
  assert(r);
  ADD_EREALLOC(x, y);
  return r;
}


x86 assembly (clang, -O0):
<zzerealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <erealloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <ADD_EREALLOC@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zzerealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <erealloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <ADD_EREALLOC@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @zzerealloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i8* @erealloc(i8* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i32 @assert(i8* %11)
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i32 @ADD_EREALLOC(i64 %13, i64 %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @zzerealloc(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @erealloc(i8* %0, i64 %2)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @ADD_EREALLOC(i64 %1, i64 %2)
ret i8* %4
}
__typeof__(strcmp(1, (void *)1)) test_strcmp_183(void) {
  return strcmp(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strcmp_183>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strcmp_183>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_strcmp_183() {
%1 = call i32 @strcmp(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_strcmp_183() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void cpuid_get(void *id) { memcpy(id, (void *)((0x1ff800d0)), (12)); }


x86 assembly (clang, -O0):
<cpuid_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff800d0,%esi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_get>:
mov    $0x1ff800d0,%esi
mov    $0xc,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @cpuid_get(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memcpy(i8* %3, i8* inttoptr (i64 536346832 to i8*), i32 12)
ret void
}

LLVM IR (-O2):
define void @cpuid_get(i8* %0) {
%2 = tail call i32 @memcpy(i8* %0, i8* inttoptr (i64 536346832 to i8*), i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simulator_cpu_thread(int);
void *simulator_cpu_thread_func(void *data) {
  simulator_cpu_thread((int)(long)data);
  return NULL;
}


x86 assembly (clang, -O0):
<simulator_cpu_thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <simulator_cpu_thread@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simulator_cpu_thread_func>:
push   %rax
call   1030 <simulator_cpu_thread@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @simulator_cpu_thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @simulator_cpu_thread(i32 %5)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @simulator_cpu_thread_func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @simulator_cpu_thread(i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2(void) { printf("Hello from func2!\n"); }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Hello from func2!\0A\00"
define void @func2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Hello from func2!\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  printf("Worker started\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Worker started\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"Worker started\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
scalar_t__ __builtin_dreml(long double, long double);
int /*<<< orphan*/ link_failure_builtin_dreml();
void test_builtin_dreml(long double ld1, long double ld2) {
  if (__builtin_dreml(ld1, ld2) != __builtin_dreml(ld1, ld2))
    link_failure_builtin_dreml();
}


x86 assembly (clang, -O0):
<test_builtin_dreml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__builtin_dreml@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__builtin_dreml@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_builtin_dreml+0x55>
mov    $0x0,%al
call   1040 <link_failure_builtin_dreml@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_dreml>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_dreml@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <__builtin_dreml@plt>
cmp    %rax,%rbx
jne    1167 <test_builtin_dreml+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_dreml@plt>

LLVM IR (-O0):
define void @test_builtin_dreml(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @__builtin_dreml(x86_fp80 %5, x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @__builtin_dreml(x86_fp80 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_builtin_dreml()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_dreml(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @__builtin_dreml(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @__builtin_dreml(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_builtin_dreml()
br label %8
8: ; preds = %6, %2
ret void
}
__attribute__((always_)) float *getEl(float *array, int *node, int i, int *n) {
  return array + 19 * (node[2] * n[0] * n[1] + node[1] * n[0] + node[0]) + i;
}


x86 assembly (clang, -O0):
<getEl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x20(%rbp),%rdx
imul   (%rdx),%ecx
mov    -0x20(%rbp),%rdx
imul   0x4(%rdx),%ecx
mov    -0x10(%rbp),%rdx
mov    0x4(%rdx),%edx
mov    -0x20(%rbp),%rsi
imul   (%rsi),%edx
add    %edx,%ecx
mov    -0x10(%rbp),%rdx
add    (%rdx),%ecx
imul   $0x13,%ecx,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEl>:
mov    0x4(%rcx),%eax
imul   0x8(%rsi),%eax
add    0x4(%rsi),%eax
imul   (%rcx),%eax
add    (%rsi),%eax
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,2),%eax
cltq
lea    (%rdi,%rax,4),%rax
movslq %edx,%rcx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define float* @getEl(float* %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca float*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store float* %0, float** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load float*, float** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = load i32*, i32** %8
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = mul nsw i32 %12, %15
%17 = load i32*, i32** %8
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = mul nsw i32 %16, %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %8
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %23, %26
%28 = add nsw i32 %20, %27
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 0
%31 = load i32, i32* %30
%32 = add nsw i32 %28, %31
%33 = mul nsw i32 19, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds float, float* %9, i64 %34
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds float, float* %35, i64 %37
ret float* %38
}

LLVM IR (-O2):
define float* @getEl(float* readnone %0, i32* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = getelementptr inbounds i32, i32* %3, i64 1
%9 = load i32, i32* %8
%10 = mul i32 %9, %6
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = load i32, i32* %1
%14 = add i32 %12, %10
%15 = mul i32 %14, %7
%16 = add i32 %15, %13
%17 = mul nsw i32 %16, 19
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %0, i64 %18
%20 = sext i32 %2 to i64
%21 = getelementptr inbounds float, float* %19, i64 %20
ret float* %21
}
int _fix_errno(void) { return -1; }


x86 assembly (clang, -O0):
<_fix_errno>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fix_errno>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @_fix_errno() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @_fix_errno() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: spoofer tcpspoof <interface> <dst IP> <port> <timeout us>\n");
  printf("Usage: spoofer udpspoof <interface> <dst IP> <port> <timeout us>\n");
  printf(
      "Usage: spoofer dnsamp <interface> <victim IP> <dns IP> <timeout us>\n");
  printf("Usage: spoofer scandns <interface> <from IP> <to IP> <timeout ms>\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"Usage: spoofer tcpspoof <interface> <dst IP> <port> <timeout us>\0A\00"
@.str.1 = [66 x i8] c"Usage: spoofer udpspoof <interface> <dst IP> <port> <timeout us>\0A\00"
@.str.2 = [69 x i8] c"Usage: spoofer dnsamp <interface> <victim IP> <dns IP> <timeout us>\0A\00"
@.str.3 = [67 x i8] c"Usage: spoofer scandns <interface> <from IP> <to IP> <timeout ms>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"Usage: spoofer tcpspoof <interface> <dst IP> <port> <timeout us>\00"
@str.4 = [65 x i8] c"Usage: spoofer udpspoof <interface> <dst IP> <port> <timeout us>\00"
@str.5 = [68 x i8] c"Usage: spoofer dnsamp <interface> <victim IP> <dns IP> <timeout us>\00"
@str.6 = [66 x i8] c"Usage: spoofer scandns <interface> <from IP> <to IP> <timeout ms>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.6, i64 0, i64 0))
ret void
}
void **___push_ref(void *arg) {
  *((void **)arg) = 0;
  return arg;
}


x86 assembly (clang, -O0):
<___push_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___push_ref>:
mov    %rdi,%rax
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8** @___push_ref(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
store i8* null, i8** %4
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i8**
ret i8** %6
}

LLVM IR (-O2):
define i8** @___push_ref(i8* writeonly %0) {
%2 = bitcast i8* %0 to i8**
store i8* null, i8** %2
ret i8** %2
}
int set_QC_inputI_limit(int type) { return 0; }


x86 assembly (clang, -O0):
<set_QC_inputI_limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_QC_inputI_limit>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @set_QC_inputI_limit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @set_QC_inputI_limit(i32 %0) {
ret i32 0
}
void EPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000210))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<EPIIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x210(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x210(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntEnable>:
or     %rsi,0x210(%rdi)
ret

LLVM IR (-O0):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 528
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 528
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int S_IRUSR;
int S_IWUSR;
int S_IXUSR;
int /*<<< orphan*/ mkdir(char const *, int);
void make_directory(const char *name) {
  mkdir(name, S_IRUSR | S_IWUSR | S_IXUSR);
}


x86 assembly (clang, -O0):
<make_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_directory>:
mov    0x2eb9(%rip),%rax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
or     (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
define void @make_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IWUSR
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXUSR
%8 = or i32 %6, %7
%9 = call i32 @mkdir(i8* %3, i32 %8)
ret void
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
define void @make_directory(i8* nocapture %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXUSR
%6 = or i32 %4, %5
%7 = tail call i32 @mkdir(i8* %0, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int, int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xcf(void) {
  RST(0x08, 5, 8);
  T_WAIT_UNTIL(11);
  return;
}


x86 assembly (clang, -O0):
<op_0xcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edx
mov    $0x5,%esi
mov    %edx,%edi
call   1030 <RST@plt>
mov    $0xb,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xcf>:
push   %rax
mov    $0x8,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xcf() {
%1 = call i32 @RST(i32 8, i32 5, i32 8)
%2 = call i32 @T_WAIT_UNTIL(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_0xcf() {
%1 = tail call i32 @RST(i32 8, i32 5, i32 8)
%2 = tail call i32 @T_WAIT_UNTIL(i32 11)
ret void
}
/* Type definitions */
struct resman {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wait_for_any_event(struct resman *);
int resman_wait(struct resman *rman) {
  wait_for_any_event(rman);
  return 0;
}


x86 assembly (clang, -O0):
<resman_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wait_for_any_event@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resman_wait>:
push   %rax
call   1030 <wait_for_any_event@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.resman = type { i32 }
define i32 @resman_wait(%struct.resman* %0) {
%2 = alloca %struct.resman*
store %struct.resman* %0, %struct.resman** %2
%3 = load %struct.resman*, %struct.resman** %2
%4 = call i32 @wait_for_any_event(%struct.resman* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.resman = type { i32 }
define i32 @resman_wait(%struct.resman* %0) {
%2 = tail call i32 @wait_for_any_event(%struct.resman* %0)
ret i32 0
}
unsigned xrop3_34_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~S;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_34_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_34_1_0>:
mov    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_34_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = xor i32 %15, -1
store i32 %16, i32* %8
%17 = load i32, i32* %5
%18 = load i32, i32* %8
%19 = and i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = and i32 %24, %25
%27 = or i32 %23, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @xrop3_34_1_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
int main(int argc, char *argv[]) {
  typedef struct {
    char *spointer1;
  } structure;
  structure *pointer1 = 0;
  pointer1 = malloc(4 * sizeof(structure));
  pointer1[1].spointer1 = malloc(64);
  free(pointer1);
  free(pointer1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x40,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.structure = type { i8* }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.structure*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.structure* null, %struct.structure** %6
%7 = call i8* @malloc(i64 32)
%8 = bitcast i8* %7 to %struct.structure*
store %struct.structure* %8, %struct.structure** %6
%9 = call i8* @malloc(i64 64)
%10 = load %struct.structure*, %struct.structure** %6
%11 = getelementptr inbounds %struct.structure, %struct.structure* %10, i64 1
%12 = getelementptr inbounds %struct.structure, %struct.structure* %11, i32 0, i32 0
store i8* %9, i8** %12
%13 = load %struct.structure*, %struct.structure** %6
%14 = bitcast %struct.structure* %13 to i8*
%15 = load %struct.structure*, %struct.structure** %6
%16 = bitcast %struct.structure* %15 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.structure = type { i8* }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *ecalloc(size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (!p)
    die("ecalloc: calloc failed\n");
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <ecalloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ecalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"ecalloc: calloc failed\0A\00"
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [24 x i8] c"ecalloc: calloc failed\0A\00"
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void gdk_pointer_is_grabbed() {}


x86 assembly (clang, -O0):
<gdk_pointer_is_grabbed>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdk_pointer_is_grabbed>:
ret

LLVM IR (-O0):
define void @gdk_pointer_is_grabbed() {
ret void
}

LLVM IR (-O2):
define void @gdk_pointer_is_grabbed() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glVertex4i(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void Vertex4i(GLint a, GLint b, GLint c, GLint d) { glVertex4i(a, b, c, d); }


x86 assembly (clang, -O0):
<Vertex4i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <glVertex4i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vertex4i>:
jmp    1030 <glVertex4i@plt>

LLVM IR (-O0):
define void @Vertex4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glVertex4i(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Vertex4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glVertex4i(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(int /*<<< orphan*/, int, int);
void status_on(void) { gpio_output(0, 20, 1); }


x86 assembly (clang, -O0):
<status_on>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x14,%esi
mov    $0x1,%edx
call   1030 <gpio_output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_on>:
xor    %edi,%edi
mov    $0x14,%esi
mov    $0x1,%edx
jmp    1030 <gpio_output@plt>

LLVM IR (-O0):
define void @status_on() {
%1 = call i32 @gpio_output(i32 0, i32 20, i32 1)
ret void
}

LLVM IR (-O2):
define void @status_on() {
%1 = tail call i32 @gpio_output(i32 0, i32 20, i32 1)
ret void
}
/* Variables and functions */
void wizchip_cris_exit(void) {}


x86 assembly (clang, -O0):
<wizchip_cris_exit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wizchip_cris_exit>:
ret

LLVM IR (-O0):
define void @wizchip_cris_exit() {
ret void
}

LLVM IR (-O2):
define void @wizchip_cris_exit() {
ret void
}
/* Variables and functions */
int bbm_hostif_deselect(void *);
int bbm_com_hostif_deselect(void *handle) {
  int res;
  res = bbm_hostif_deselect(handle);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_hostif_deselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bbm_hostif_deselect@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_hostif_deselect>:
jmp    1030 <bbm_hostif_deselect@plt>

LLVM IR (-O0):
define i32 @bbm_com_hostif_deselect(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @bbm_hostif_deselect(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bbm_com_hostif_deselect(i8* %0) {
%2 = tail call i32 @bbm_hostif_deselect(i8* %0)
ret i32 %2
}
/* Variables and functions */
size_t varCharIndex(char);
int varValue(char var, int V[3]) { return V[varCharIndex(var)]; }


x86 assembly (clang, -O0):
<varValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <varCharIndex@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varValue>:
push   %rbx
mov    %rsi,%rbx
call   1030 <varCharIndex@plt>
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @varValue(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8, i8* %3
%7 = call i64 @varCharIndex(i8 signext %6)
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @varValue(i8 signext %0, i32* nocapture %1) {
%3 = tail call i64 @varCharIndex(i8 signext %0)
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_list_dir(char *dir, void *ctx) { printf("dir %s\n", dir); }


x86 assembly (clang, -O0):
<test_list_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_dir>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"dir %s\0A\00"
define void @test_list_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"dir %s\0A\00"
define void @test_list_dir(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int_array(int *, int);
int main(void) {
  int crap_ints[] = {9, 8, 7, 6, 5, 4, 3, 2, 1};
  print_int_array(crap_ints, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <print_int_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <print_int_array@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.crap_ints = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @print_int_array(i32* %4, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.crap_ints = [9 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_int_array(i32* %3, i32 10)
ret i32 0
}
int user_login(char **args, int argc, int flags) {
  if (argc < 2 + 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<user_login>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1124 <user_login+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <user_login+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_login>:
xor    %eax,%eax
cmp    $0x3,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @user_login(i8** %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %4
br label %12
11: ; preds = %3
store i32 0, i32* %4
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @user_login(i8** nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 3
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo725() {}


x86 assembly (clang, -O0):
<foo725>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo725>:
ret

LLVM IR (-O0):
define void @foo725() {
ret void
}

LLVM IR (-O2):
define void @foo725() {
ret void
}
void func1(int i, void *arg) { printf("%d arg %s\n", i, arg); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%d arg %s\0A\00"
define void @func1(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d arg %s\0A\00"
define void @func1(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
int float_gt_xxxx(int a, int b) {
  if (a < 0) {
    a = 0x80000000u - a;
  }
  if (b < 0) {
    b = 0x80000000u - b;
  }
  return a > b;
}


x86 assembly (clang, -O0):
<float_gt_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <float_gt_xxxx+0x1f>
mov    $0x80000000,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1134 <float_gt_xxxx+0x34>
mov    $0x80000000,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_gt_xxxx>:
mov    $0x80000000,%ecx
mov    $0x80000000,%edx
sub    %edi,%edx
test   %edi,%edi
cmovns %edi,%edx
sub    %esi,%ecx
test   %esi,%esi
cmovns %esi,%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setg   %al
ret

LLVM IR (-O0):
define i32 @float_gt_xxxx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub i32 -2147483648, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub i32 -2147483648, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @float_gt_xxxx(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub i32 -2147483648, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = icmp slt i32 %1, 0
%7 = sub i32 -2147483648, %1
%8 = select i1 %6, i32 %7, i32 %1
%9 = icmp sgt i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: decode file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: decode file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: decode file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int pollMsg(int newsockfd, char *buffer) {
  int n;
  memset(buffer, 0, 256);
  n = read(newsockfd, buffer, 4);
  if (n < 0)
    error("ERROR reading from socket");
  return n;
}


x86 assembly (clang, -O0):
<pollMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1179 <pollMsg+0x49>
lea    0xe8c(%rip),%rdi
call   1050 <error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pollMsg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1168 <pollMsg+0x38>
lea    0xe9d(%rip),%rdi
call   1050 <error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"ERROR reading from socket\00"
define i32 @pollMsg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @memset(i8* %6, i32 0, i32 256)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @read(i32 %8, i8* %9, i32 4)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"ERROR reading from socket\00"
define i32 @pollMsg(i32 %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 256)
%4 = tail call i32 @read(i32 %0, i8* %1, i32 4)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}