xunge/DecIR huggingface dataset:
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct rusage a;
  printf("%d", getrusage(RUSAGE_SELF, &a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <getrusage@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@.str = [3 x i8] c"%d\00"
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rusage
store i32 0, i32* %1
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@.str = [3 x i8] c"%d\00"
@RUSAGE_SELF = global i32 0
define i32 @main() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int digits(int val) {
  register int cnt = 0;
  if (val == 0) {
    return 1;
  }
  while (val > 0) {
    cnt++;
    val /= 10;
  }
  return (cnt);
}


x86 assembly (clang, -O0):
<digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <digits+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1155 <digits+0x55>
jmp    1129 <digits+0x29>
cmpl   $0x0,-0x8(%rbp)
jle    114f <digits+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1129 <digits+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits>:
test   %edi,%edi
je     1125 <digits+0x25>
jle    112b <digits+0x2b>
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopl   (%rax)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <digits+0x10>
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %0, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = udiv i32 %7, 10
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ fliph0(int);
void fliph_test(void **state) {
  assert_int_equal(fliph0(0x0123456789ABCDEFul), 0x80C4A2E691D5B3F7ul);
}


x86 assembly (clang, -O0):
<fliph_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x89abcdef,%edi
call   1040 <fliph0@plt>
mov    %eax,%edi
mov    $0x91d5b3f7,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fliph_test>:
push   %rax
mov    $0x89abcdef,%edi
call   1040 <fliph0@plt>
mov    %eax,%edi
mov    $0x91d5b3f7,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @fliph_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @fliph0(i32 -1985229329)
%4 = call i32 @assert_int_equal(i32 %3, i32 -1848265737)
ret void
}

LLVM IR (-O2):
define void @fliph_test(i8** nocapture readnone %0) {
%2 = tail call i32 @fliph0(i32 -1985229329)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 -1848265737)
ret void
}
void ble_rsp_sm_encrypt_start(
    const struct ble_msg_sm_encrypt_start_rsp_t *msg) {}


x86 assembly (clang, -O0):
<ble_rsp_sm_encrypt_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ble_msg_sm_encrypt_start_rsp_t = type opaque
define void @ble_rsp_sm_encrypt_start(%struct.ble_msg_sm_encrypt_start_rsp_t* %0) {
%2 = alloca %struct.ble_msg_sm_encrypt_start_rsp_t*
store %struct.ble_msg_sm_encrypt_start_rsp_t* %0, %struct.ble_msg_sm_encrypt_start_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_sm_encrypt_start_rsp_t = type opaque
define void @ble_rsp_sm_encrypt_start(%struct.ble_msg_sm_encrypt_start_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
char *f2cString(char *, int);
int /*<<< orphan*/ free(char *);
int imodBackupFile(char *);
int imodbackupfile_(char *filename, int strlen) {
  int err;
  char *cstr = f2cString(filename, strlen);
  if (!cstr)
    return -2;
  err = imodBackupFile(cstr);
  free(cstr);
  return err;
}


x86 assembly (clang, -O0):
<imodbackupfile_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <f2cString@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1166 <imodbackupfile_+0x36>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1181 <imodbackupfile_+0x51>
mov    -0x20(%rbp),%rdi
call   1050 <imodBackupFile@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imodbackupfile_>:
push   %rbp
push   %rbx
push   %rax
call   1040 <f2cString@plt>
test   %rax,%rax
je     1156 <imodbackupfile_+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <imodBackupFile@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115b <imodbackupfile_+0x2b>
mov    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @imodbackupfile_(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i8* @f2cString(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %2
store i32 -2, i32* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %7
%16 = call i32 @imodBackupFile(i8* %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %7
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %6
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @imodbackupfile_(i8* %0, i32 %1) {
%3 = tail call i8* @f2cString(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @imodBackupFile(i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -2, %2 ]
ret i32 %9
}
int test_imm_06uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06uint64_lowword_reg>:
test   $0x6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_06uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 6
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_06uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 6
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
void segv() { my_putstr("Segmentation Fault\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Segmentation Fault\0A\00"
define void @segv() {
%1 = call i32 @my_putstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Segmentation Fault\0A\00"
define void @segv() {
%1 = tail call i32 @my_putstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
void ScaleRowDown34_0_Box_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_0_Box_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void reverse(int num) {
  int a;
  while (num != 0) {
    a = num % 10;
    printf("%d", a);
    num = num / 10;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <reverse+0x47>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    111b <reverse+0xb>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1176 <reverse+0x56>
mov    %edi,%ebx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %ebx,%r15
imul   $0x66666667,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %r15d,%esi
sub    %eax,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x9,%r15d
cmp    $0x12,%r15d
ja     1140 <reverse+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = srem i32 %4, 10
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = sdiv i32 %4, 10
%8 = add i32 %4, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function2(int b) {
  printf("You entered %d so function2 was called\n\n", b);
}


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

x86 assembly (clang, -O2):
<function2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"You entered %d so function2 was called\0A\0A\00"
define void @function2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"You entered %d so function2 was called\0A\0A\00"
define void @function2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct correlation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct correlation *);
void free_correlation(struct correlation *c) { free(c); }


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

x86 assembly (clang, -O2):
<free_correlation>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.correlation = type { i32 }
define void @free_correlation(%struct.correlation* nocapture %0) {
%2 = tail call i32 @free(%struct.correlation* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int main(int argc, char *argv[]) {
  f();
  g();
  return 0;
}


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)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = call i32 (...) @f()
%7 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
%4 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int h(int);
int g(int n) { return h(n) + h(n); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <h@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <h@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <h@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <h@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @h(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @h(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = tail call i32 @h(i32 %0)
%3 = tail call i32 @h(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
char *makeStringInHeap();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *myString = makeStringInHeap();
  printf("%p\n", myString);
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1040 <makeStringInHeap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <makeStringInHeap@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @makeStringInHeap()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void serial_close(int sfd) { close(sfd); }


x86 assembly (clang, -O0):
<serial_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @serial_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret void
}

LLVM IR (-O2):
define void @serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int sock_destroy() { return 0; }


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

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

LLVM IR (-O0):
define i32 @sock_destroy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sock_destroy() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void Assert(char *Msg, char *FileName, int LineNo) {
  printf("Assert failed in file %s at line %d:\n", FileName, LineNo);
  printf("%s\n", Msg);
  printf("Aborting program...");
  printf("\a");
  exit(1);
}


x86 assembly (clang, -O0):
<Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Assert>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Assert failed in file %s at line %d:\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [20 x i8] c"Aborting program...\00"
@.str.3 = [2 x i8] c"\07\00"
define void @Assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Assert failed in file %s at line %d:\0A\00"
@.str.2 = [20 x i8] c"Aborting program...\00"
define void @Assert(i8* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 7)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct uwsgi_string_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uwsgi_string_new_list(struct uwsgi_string_list **, char *);
void uwsgi_opt_add_string_list(char *opt, char *value, void *list) {
  struct uwsgi_string_list **ptr = (struct uwsgi_string_list **)list;
  uwsgi_string_new_list(ptr, value);
}


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

x86 assembly (clang, -O2):
<uwsgi_opt_add_string_list>:
mov    %rdx,%rdi
jmp    1030 <uwsgi_string_new_list@plt>

LLVM IR (-O0):
%struct.uwsgi_string_list = type { i32 }
define void @uwsgi_opt_add_string_list(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.uwsgi_string_list**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.uwsgi_string_list**
store %struct.uwsgi_string_list** %9, %struct.uwsgi_string_list*** %7
%10 = load %struct.uwsgi_string_list**, %struct.uwsgi_string_list*** %7
%11 = load i8*, i8** %5
%12 = call i32 @uwsgi_string_new_list(%struct.uwsgi_string_list** %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.uwsgi_string_list = type { i32 }
define void @uwsgi_opt_add_string_list(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.uwsgi_string_list**
%5 = tail call i32 @uwsgi_string_new_list(%struct.uwsgi_string_list** %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float num = 0;
  printf("Digite um valor: ");
  scanf("%f", &num);
  printf("15%% deste valor é: %f\n", (num * 0.15));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xea6(%rip),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"15%% deste valor \C3\A9: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double %6, 1.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"15%% deste valor \C3\A9: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
int answer(int n) { return ((n * (n + 1) * ((2 * n) + 1)) / 6); }


x86 assembly (clang, -O0):
<answer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
lea    (%rdi,%rdi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
movslq %ecx,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @answer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = load i32, i32* %2
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %6, %9
%11 = sdiv i32 %10, 6
ret i32 %11
}

LLVM IR (-O2):
define i32 @answer(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = shl nsw i32 %0, 1
%5 = or i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 6
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int parse_bits(int);
int is_packet_end(uint32_t endocing) {
  uint32_t bits = parse_bits(endocing);
  return ((bits == 0x3) || (bits == 0x0));
}


x86 assembly (clang, -O0):
<is_packet_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <parse_bits@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <is_packet_end+0x2f>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_packet_end>:
push   %rax
call   1030 <parse_bits@plt>
cmp    $0x3,%eax
sete   %cl
test   %eax,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_packet_end(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @parse_bits(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 3
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_packet_end(i32 %0) {
%2 = tail call i32 @parse_bits(i32 %0)
%3 = icmp eq i32 %2, 3
%4 = icmp eq i32 %2, 0
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void memcpy(unsigned long srcaddr, unsigned long dstaddr, unsigned long size) {
  __asm__("1:movsb;loop 1b" ::"c"(size), "S"(srcaddr), "D"(dstaddr));
  return;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
movsb  %ds:(%rsi),%es:(%rdi)
loop   111c <memcpy+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
movsb  %ds:(%rsi),%es:(%rdi)
loop   110c <memcpy+0xc>
ret

LLVM IR (-O0):
define void @memcpy(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @memcpy(i64 %0, i64 %1, i64 %2) {
tail call void asm sideeffect "1:movsb;loop 1b", "{cx},{si},{di},~{dirflag},~{fpsr},~{flags}"(i64 %2, i64 %0, i64 %1)
ret void
}
unsigned int f1(int xxx, unsigned int yyy) { return xxx ? yyy : -1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <f1+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112c <f1+0x2c>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <f1+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %4
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test30(__m64 a, __m64 b) { return _mm_min_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test30>:
jmp    1030 <_mm_min_pu8@plt>

LLVM IR (-O0):
define i32 @test30(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 = load i32, i32* %4
%7 = call i32 @_mm_min_pu8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test30(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void x(int x) { fprintf(stderr, "%c%d\n", 'x', x); }


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x78,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x78,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @x(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 120, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @x(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 120, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ntlink_client_exit();
int /*<<< orphan*/ rt_client_exit();
void sig_handler(int signo) {
  rt_client_exit();
  ntlink_client_exit();
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rt_client_exit@plt>
mov    $0x0,%al
call   1030 <ntlink_client_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rt_client_exit()
%4 = call i32 (...) @ntlink_client_exit()
ret void
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 (...) @rt_client_exit()
%3 = tail call i32 (...) @ntlink_client_exit()
ret void
}
int ath9k_init_debug(struct ath_softc *sc) { return 0; }


x86 assembly (clang, -O0):
<ath9k_init_debug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ath_softc = type opaque
define i32 @ath9k_init_debug(%struct.ath_softc* %0) {
%2 = alloca %struct.ath_softc*
store %struct.ath_softc* %0, %struct.ath_softc** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ath_softc = type opaque
define i32 @ath9k_init_debug(%struct.ath_softc* nocapture readnone %0) {
ret i32 0
}
void ReverseGPIOP$0$In$set(void) { HplMcs51GeneralIOC$P20$set(); }


x86 assembly (clang, -O0):
<ReverseGPIOP$0$In$set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMcs51GeneralIOC$P20$set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseGPIOP$0$In$set>:
xor    %eax,%eax
jmp    1030 <HplMcs51GeneralIOC$P20$set@plt>

LLVM IR (-O0):
define void @"ReverseGPIOP$0$In$set"() {
%1 = call i32 (...) @"HplMcs51GeneralIOC$P20$set"()
ret void
}

LLVM IR (-O2):
define void @"ReverseGPIOP$0$In$set"() {
%1 = tail call i32 (...) @"HplMcs51GeneralIOC$P20$set"()
ret void
}
int NEG(int l) { return l ^ 1; }


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

x86 assembly (clang, -O2):
<NEG>:
mov    %edi,%eax
xor    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @NEG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @NEG(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int getmaxx(int /*<<< orphan*/ *);
int getmax_x(WINDOW *w) { return getmaxx(w); }


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

x86 assembly (clang, -O2):
<getmax_x>:
jmp    1030 <getmaxx@plt>

LLVM IR (-O0):
define i32 @getmax_x(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @getmaxx(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @getmax_x(i32* %0) {
%2 = tail call i32 @getmaxx(i32* %0)
ret i32 %2
}
void __DELETE_org_apache_harmony_luni_internal_nls_Messages(void *me,
                                                            void *client_data) {
}


x86 assembly (clang, -O0):
<__DELETE_org_apache_harmony_luni_internal_nls_Messages>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__DELETE_org_apache_harmony_luni_internal_nls_Messages(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_luni_internal_nls_Messages(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_liba();
int /*<<< orphan*/ test_libb();
int main(void) {
  test_liba();
  test_libb();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_liba@plt>
mov    $0x0,%al
call   1040 <test_libb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_liba@plt>
xor    %eax,%eax
call   1040 <test_libb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_liba()
%3 = call i32 (...) @test_libb()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_liba()
%2 = tail call i32 (...) @test_libb()
ret i32 0
}
unsigned int hash(char *key_input_temp) {
  unsigned int hashval;
  char *s_temp = key_input_temp;
  int i = 0;
  for (hashval = 0; *key_input_temp != '\0'; key_input_temp++) {
    hashval = *key_input_temp + 31 * hashval;
  }
  return (hashval % 32);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <hash+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111e <hash+0x1e>
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x1f,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %4
store i32 0, i32* %5
store i32 0, i32* %3
br label %7
7: ; preds = %19, %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i32, i32* %3
%17 = mul i32 31, %16
%18 = add i32 %15, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %12
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
%24 = urem i32 %23, 32
ret i32 %24
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %7, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 31
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void tabulate(char *dest, unsigned int len, char *src, int amount) {}


x86 assembly (clang, -O0):
<tabulate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tabulate(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @tabulate(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int b_red() { return fputs("[41m", stdout); }


x86 assembly (clang, -O0):
<b_red>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_red>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[41m\00"
@stdout = global i32 0
define i32 @b_red() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[41m\00"
@stdout = global i32 0
define i32 @b_red() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int ENODEV;
int i8042_command(unsigned char *param, int command) { return -ENODEV; }


x86 assembly (clang, -O0):
<i8042_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8042_command>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @i8042_command(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @i8042_command(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
void client() {
  int i;
  for (i = 0; i < 64; i++) {
    echo("MorningSocket");
  }
}


x86 assembly (clang, -O0):
<client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1143 <client+0x33>
lea    0xed0(%rip),%rdi
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <client+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client>:
push   %rbp
push   %rbx
push   %rax
mov    $0x40,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <echo@plt>
add    $0xffffffff,%ebp
jne    1120 <client+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"MorningSocket\00"
define void @client() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 64
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @echo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"MorningSocket\00"
define void @client() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @echo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 64
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int maxise(int *aw, int w) {
  if (w > *aw)
    *aw = w;
  return *aw;
}


x86 assembly (clang, -O0):
<maxise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jle    1123 <maxise+0x23>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxise>:
mov    (%rdi),%eax
cmp    %esi,%eax
jge    110a <maxise+0xa>
mov    %esi,(%rdi)
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxise(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %1, i32* %0
br label %6
6: ; preds = %5, %2
%7 = phi i32 [ %1, %5 ], [ %3, %2 ]
ret i32 %7
}
void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb) {}


x86 assembly (clang, -O0):
<bnxt_vf_rep_rx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bnxt = type opaque
%struct.sk_buff = type opaque
define void @bnxt_vf_rep_rx(%struct.bnxt* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.bnxt*
%4 = alloca %struct.sk_buff*
store %struct.bnxt* %0, %struct.bnxt** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.bnxt = type opaque
%struct.sk_buff = type opaque
define void @bnxt_vf_rep_rx(%struct.bnxt* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
void test() { return; }


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int getpgid(int /*<<< orphan*/);
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
void printProcessId() {
  printf("Process ID: %d\n", getpid());
  printf("Parent ID: %d\n", getppid());
  printf("Group ID: %d\n", getpgid(0));
}


x86 assembly (clang, -O0):
<printProcessId>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getppid@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <getpgid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printProcessId>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getppid@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <getpgid@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Process ID: %d\0A\00"
@.str.1 = [15 x i8] c"Parent ID: %d\0A\00"
@.str.2 = [14 x i8] c"Group ID: %d\0A\00"
define void @printProcessId() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @getppid()
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @getpgid(i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Process ID: %d\0A\00"
@.str.1 = [15 x i8] c"Parent ID: %d\0A\00"
@.str.2 = [14 x i8] c"Group ID: %d\0A\00"
define void @printProcessId() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @getpgid(i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}