xunge/DecIR huggingface dataset:
int if_i_j(n1, n2, n3, mid) {
  if (n3 > n2) {
    if (n3 < n1) {
      mid = n3;
      return (mid);
    } else {
      mid = n1;
      return (mid);
    }
  } else {
    mid = n2;
    return (mid);
  }
}


x86 assembly (clang, -O0):
<if_i_j>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114a <if_i_j+0x4a>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1139 <if_i_j+0x39>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <if_i_j+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <if_i_j+0x56>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_i_j>:
mov    %edi,%eax
cmp    %edi,%edx
cmovl  %edx,%eax
cmp    %esi,%edx
cmovle %esi,%eax
ret

LLVM IR (-O0):
define i32 @if_i_j(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %4
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %8
store i32 %18, i32* %9
%19 = load i32, i32* %9
store i32 %19, i32* %5
br label %26
20: ; preds = %13
%21 = load i32, i32* %6
store i32 %21, i32* %9
%22 = load i32, i32* %9
store i32 %22, i32* %5
br label %26
23: ; preds = %4
%24 = load i32, i32* %7
store i32 %24, i32* %9
%25 = load i32, i32* %9
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %20, %17
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @if_i_j(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %1
%6 = icmp slt i32 %2, %0
%7 = select i1 %6, i32 %2, i32 %0
%8 = select i1 %5, i32 %7, i32 %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ daxpy(void *, int, int);
int multiply(void *, int);
int run_vector_c(void *data, int n) {
  daxpy(data, n, n);
  return multiply(data, n);
}


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

x86 assembly (clang, -O2):
<run_vector_c>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edx
call   1040 <daxpy@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <multiply@plt>

LLVM IR (-O0):
define i32 @run_vector_c(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @daxpy(i8* %5, i32 %6, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @multiply(i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @run_vector_c(i8* %0, i32 %1) {
%3 = tail call i32 @daxpy(i8* %0, i32 %1, i32 %1)
%4 = tail call i32 @multiply(i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int smallest(int, int, int);
int smallest_bit(int, int, int);
int smallest_div(int, int, int);
int test_all_diff() {
  return 3 == smallest(3, 6, 9) && 3 == smallest_div(3, 6, 9) &&
         3 == smallest_bit(3, 6, 9);
}


x86 assembly (clang, -O0):
<test_all_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1050 <smallest@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11ab <test_all_diff+0x7b>
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1030 <smallest_div@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x3,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11ab <test_all_diff+0x7b>
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1040 <smallest_bit@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_diff>:
push   %rbx
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1050 <smallest@plt>
xor    %ebx,%ebx
cmp    $0x3,%eax
jne    1181 <test_all_diff+0x51>
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1030 <smallest_div@plt>
cmp    $0x3,%eax
jne    1181 <test_all_diff+0x51>
mov    $0x3,%edi
mov    $0x6,%esi
mov    $0x9,%edx
call   1040 <smallest_bit@plt>
xor    %ebx,%ebx
cmp    $0x3,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_all_diff() {
%1 = call i32 @smallest(i32 3, i32 6, i32 9)
%2 = icmp eq i32 3, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @smallest_div(i32 3, i32 6, i32 9)
%5 = icmp eq i32 3, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @smallest_bit(i32 3, i32 6, i32 9)
%8 = icmp eq i32 3, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_all_diff() {
%1 = tail call i32 @smallest(i32 3, i32 6, i32 9)
%2 = icmp eq i32 %1, 3
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 @smallest_div(i32 3, i32 6, i32 9)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @smallest_bit(i32 3, i32 6, i32 9)
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ par_close();
void par_close_f_(void) { par_close(); }


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

x86 assembly (clang, -O2):
<par_close_f_>:
xor    %eax,%eax
jmp    1030 <par_close@plt>

LLVM IR (-O0):
define void @par_close_f_() {
%1 = call i32 (...) @par_close()
ret void
}

LLVM IR (-O2):
define void @par_close_f_() {
%1 = tail call i32 (...) @par_close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void memory_error(void) {
  fprintf(stderr, "\n memory allocation error, exiting.\n\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"\0A memory allocation error, exiting.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @memory_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"\0A memory allocation error, exiting.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @memory_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned int cyc_div(unsigned int cpu_freq) { return cpu_freq / 16384; }


x86 assembly (clang, -O0):
<cyc_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyc_div>:
mov    %edi,%eax
shr    $0xe,%eax
ret

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

LLVM IR (-O2):
define i32 @cyc_div(i32 %0) {
%2 = lshr i32 %0, 14
ret i32 %2
}
/* Variables and functions */
scalar_t__ fork();
long DuplicateProcess() { return (long)fork(); }


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

x86 assembly (clang, -O2):
<DuplicateProcess>:
xor    %eax,%eax
jmp    1030 <fork@plt>

LLVM IR (-O0):
define i64 @DuplicateProcess() {
%1 = call i64 (...) @fork()
ret i64 %1
}

LLVM IR (-O2):
define i64 @DuplicateProcess() {
%1 = tail call i64 (...) @fork()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void dtmf_put_digit(void *opaque, int digit) {
  printf("DTMF: got digit '%c'\n", digit);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"DTMF: got digit '%c'\0A\00"
define void @dtmf_put_digit(i8* %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 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"DTMF: got digit '%c'\0A\00"
define void @dtmf_put_digit(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *mem_alloc(size_t);
char *memcpy(char *, char const *, size_t);
int strlen(char const *);
char *my_strdup(const char *str) {
  size_t len = strlen(str) + 1;
  char *dup = mem_alloc(len);
  return memcpy(dup, str, len);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mem_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <mem_alloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @mem_alloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i8* @memcpy(i8* %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @mem_alloc(i64 %4)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %4, i1 false)
ret i8* %5
}
unsigned long r_hash_fn(char *key) {
  unsigned long hash = 5381;
  int c;
  while (c = *key++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<r_hash_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <r_hash_fn+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <r_hash_fn+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_hash_fn>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <r_hash_fn+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <r_hash_fn+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @r_hash_fn(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void *thread_function(void *arg) {
  while (1)
    foo();
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
jmp    111c <thread_function+0xc>

x86 assembly (clang, -O2):
<thread_function>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
jmp    1120 <thread_function+0x10>

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @foo()
br label %3
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @foo()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ ttflush();
int /*<<< orphan*/ ttputc(char);
int ansieeol() {
  ttflush();
  ttputc(0x1B);
  ttputc('[');
  ttputc('K');
  return 0;
}


x86 assembly (clang, -O0):
<ansieeol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ttflush@plt>
mov    $0x1b,%edi
call   1040 <ttputc@plt>
mov    $0x5b,%edi
call   1040 <ttputc@plt>
mov    $0x4b,%edi
call   1040 <ttputc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansieeol>:
push   %rax
xor    %eax,%eax
call   1030 <ttflush@plt>
mov    $0x1b,%edi
call   1040 <ttputc@plt>
mov    $0x5b,%edi
call   1040 <ttputc@plt>
mov    $0x4b,%edi
call   1040 <ttputc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ansieeol() {
%1 = call i32 (...) @ttflush()
%2 = call i32 @ttputc(i8 signext 27)
%3 = call i32 @ttputc(i8 signext 91)
%4 = call i32 @ttputc(i8 signext 75)
ret i32 0
}

LLVM IR (-O2):
define i32 @ansieeol() {
%1 = tail call i32 (...) @ttflush()
%2 = tail call i32 @ttputc(i8 signext 27)
%3 = tail call i32 @ttputc(i8 signext 91)
%4 = tail call i32 @ttputc(i8 signext 75)
ret i32 0
}
/* Type definitions */
struct lzma_handle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
size_t LZMA_write_compress(struct lzma_handle_t *h, unsigned char *mem,
                           size_t len) {
  (void)h;
  (void)mem;
  (void)len;
  fprintf(stderr,
          "LZMA support was not compiled into this executable, sorry.\n");
  exit(255);
}


x86 assembly (clang, -O0):
<LZMA_write_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.lzma_handle_t = type { i32 }
@stderr = global i32 0
@.str = [60 x i8] c"LZMA support was not compiled into this executable, sorry.\0A\00"
define i64 @LZMA_write_compress(%struct.lzma_handle_t* %0, i8* %1, i64 %2) {
%4 = alloca %struct.lzma_handle_t*
%5 = alloca i8*
%6 = alloca i64
store %struct.lzma_handle_t* %0, %struct.lzma_handle_t** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.lzma_handle_t*, %struct.lzma_handle_t** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
%struct.lzma_handle_t = type { i32 }
@stderr = global i32 0
@.str = [60 x i8] c"LZMA support was not compiled into this executable, sorry.\0A\00"
define i64 @LZMA_write_compress(%struct.lzma_handle_t* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 255)
unreachable
}
int prefetch(void *x) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @prefetch(i8* nocapture readnone %0) {
ret i32 1
}
int ind(const int i, const int m) {
  int ind = i % m;
  if (ind == 0)
    ind = m;
  return ind;
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1124 <ind+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %edx,%edx
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ind(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 %1, i32 %3
ret i32 %5
}
void csv_reset_color(void) {}


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

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

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

LLVM IR (-O2):
define void @csv_reset_color() {
ret void
}
/* Variables and functions */
bool _std_managed_heap_specs(size_t ser_pool_addr, size_t ser_pool_size) {}


x86 assembly (clang, -O0):
<_std_managed_heap_specs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_std_managed_heap_specs(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @_std_managed_heap_specs(i64 %0, i64 %1) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strlen(char *);
scalar_t__ strspn(char *, char *);
bool isSymbolName(char *name) {
  return strspn(name, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123"
                      "456789_") == strlen(name);
}


x86 assembly (clang, -O0):
<isSymbolName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbolName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strspn@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_\00"
define i32 @isSymbolName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strspn(i8* %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_\00"
define i32 @isSymbolName(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52_set_acmod(uint8_t *p_a52, uint8_t i_acmod) {
  p_a52[6] &= ~0xe0;
  p_a52[6] |= (i_acmod & 0x7) << 5;
}


x86 assembly (clang, -O0):
<a52_set_acmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xffffff1f,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    $0x5,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_set_acmod>:
mov    $0xffffff1f,%eax
and    0x18(%rdi),%eax
shl    $0x5,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x18(%rdi)
ret

LLVM IR (-O0):
define void @a52_set_acmod(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 = getelementptr inbounds i32, i32* %5, i64 6
%7 = load i32, i32* %6
%8 = and i32 %7, -225
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = shl i32 %10, 5
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52_set_acmod(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = load i32, i32* %3
%5 = and i32 %4, -225
%6 = shl i32 %1, 5
%7 = and i32 %6, 224
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy4(int *x, int *y) { memcpy(x, y, 4); }


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

x86 assembly (clang, -O2):
<copy4>:
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy4(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 @memcpy(i32* %5, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @copy4(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ discardEdited();
int /*<<< orphan*/ readFile();
void undo(void) {
  discardEdited();
  readFile();
}


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

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

LLVM IR (-O0):
define void @undo() {
%1 = call i32 (...) @discardEdited()
%2 = call i32 (...) @readFile()
ret void
}

LLVM IR (-O2):
define void @undo() {
%1 = tail call i32 (...) @discardEdited()
%2 = tail call i32 (...) @readFile()
ret void
}
long long MaxDistance() { return 1000000LL; }


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

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

LLVM IR (-O0):
define i64 @MaxDistance() {
ret i64 1000000
}

LLVM IR (-O2):
define i64 @MaxDistance() {
ret i64 1000000
}
int g_DUMMY_menu_create_floating(int win_id) {
  win_id = win_id;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_create_floating(i32 %0) {
ret i32 -1
}
void xowaitretrace(void) {}


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

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

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

LLVM IR (-O2):
define void @xowaitretrace() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) {
  printf("Usage: %s [-asv] logfile program\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s [-asv] logfile program\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s [-asv] logfile program\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned long get_error_values(int, int /*<<< orphan*/, char const **, int *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
unsigned long ERR_get_error_line(const char **file, int *line) {
  return (get_error_values(1, 0, file, line, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_get_error_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <get_error_values@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_get_error_line>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x1,%edi
xor    %esi,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_get_error_line(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i8**, i8*** %3
%6 = load i32*, i32** %4
%7 = call i64 @get_error_values(i32 1, i32 0, i8** %5, i32* %6, i32* null, i32* null)
ret i64 %7
}

LLVM IR (-O2):
define i64 @ERR_get_error_line(i8** %0, i32* %1) {
%3 = tail call i64 @get_error_values(i32 1, i32 0, i8** %0, i32* %1, i32* null, i32* null)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int /*<<< orphan*/ g(double **);
void f(double *p) {
  double *v;
  v = p;
  g(&p);
  assertTrue("*p == 10", *p == 10);
  ;
  assertTrue("*v == 10", *v == 10);
  ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <g@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeb3(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xea3(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe86(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe7f(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <g@plt>
mov    0x8(%rsp),%rax
movsd  (%rax),%xmm0
cmpeqsd 0xeb7(%rip),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xeb0(%rip),%rdi
call   1030 <assertTrue@plt>
movsd  0xe9b(%rip),%xmm0
cmpeqsd (%rbx),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xe98(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"*p == 10\00"
@.str.1 = [9 x i8] c"*v == 10\00"
define void @f(double* %0) {
%2 = alloca double*
%3 = alloca double*
store double* %0, double** %2
%4 = load double*, double** %2
store double* %4, double** %3
%5 = call i32 @g(double** %2)
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = fcmp oeq double %7, 1.000000e+01
%9 = zext i1 %8 to i32
%10 = call i32 @assertTrue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load double*, double** %3
%12 = load double, double* %11
%13 = fcmp oeq double %12, 1.000000e+01
%14 = zext i1 %13 to i32
%15 = call i32 @assertTrue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"*p == 10\00"
@.str.1 = [9 x i8] c"*v == 10\00"
define void @f(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 @g(double** %2)
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fcmp oeq double %5, 1.000000e+01
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load double, double* %0
%10 = fcmp oeq double %9, 1.000000e+01
%11 = zext i1 %10 to i32
%12 = call i32 @assertTrue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, float);
int /*<<< orphan*/ system(char *);
void emon_log_data(char *name, float value) {
  {
    char cmdline[1024];
    sprintf(cmdline,
            "curl  "
            "\"http://emonpi/input/"
            "post.json?json={%s:%f}&apikey=9c58f6f0491bf90f7c5580de8a7e7999\" "
            "-o emon -s",
            name, value);
    system(cmdline);
  }
}


x86 assembly (clang, -O0):
<emon_log_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movss  -0xc(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emon_log_data>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [102 x i8] c"curl \22http://emonpi/input/post.json?json={%s:%f}&apikey=9c58f6f0491bf90f7c5580de8a7e7999\22 -o emon -s\00"
define void @emon_log_data(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store float %1, float* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load float, float* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %7, float %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [102 x i8] c"curl \22http://emonpi/input/post.json?json={%s:%f}&apikey=9c58f6f0491bf90f7c5580de8a7e7999\22 -o emon -s\00"
define void @emon_log_data(i8* %0, float %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i8* %0, float %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 0x45, y = 0x56;
  printf("\"x==y\" = %2x, \"x==x\" = %2x\n", !(x ^ y), !(x ^ x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x45,-0x8(%rbp)
movl   $0x56,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\22x==y\22 = %2x, \22x==x\22 = %2x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 69, i32* %2
store i32 86, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = xor i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = xor i32 %10, %11
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\22x==y\22 = %2x, \22x==x\22 = %2x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
__attribute__((always_)) void *builtin_memcpy(void *to, const void *from,
                                              unsigned int n) {
  int d0, d1, d2;
  asm volatile("rep ; movsl		\n"
               "movl %4,%%ecx		\n"
               "andl $3,%%ecx		\n"
               "jz 1f			\n"
               "rep ; movsb		\n"
               "1:"
               : "=&c"(d0), "=&D"(d1), "=&S"(d2)
               : "0"(n / 4), "g"(n), "1"((long)to), "2"((long)from)
               : "memory");
  return to;
}


x86 assembly (clang, -O0):
<builtin_memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
shr    $0x2,%ecx
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %eax,-0x24(%rbp)
rep movsl %ds:(%rsi),%es:(%rdi)
mov    -0x24(%rbp),%ecx
and    $0x3,%ecx
je     1133 <builtin_memcpy+0x33>
rep movsb %ds:(%rsi),%es:(%rdi)
mov    %ecx,-0x18(%rbp)
mov    %edi,%eax
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_memcpy>:
mov    %edx,%ecx
mov    %rdi,%rax
mov    %edx,-0x4(%rsp)
shr    $0x2,%ecx
rep movsl %ds:(%rsi),%es:(%rdi)
mov    -0x4(%rsp),%ecx
and    $0x3,%ecx
je     1119 <builtin_memcpy+0x19>
rep movsb %ds:(%rsi),%es:(%rdi)
ret

LLVM IR (-O0):
define i8* @builtin_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = udiv i32 %10, 4
%12 = load i32, i32* %6
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %13 to i64
%15 = load i8*, i8** %5
%16 = ptrtoint i8* %15 to i64
%17 = call { i32, i64, i64 } asm sideeffect "rep ; movsl\09\09\0Amovl $4,%ecx\09\09\0Aandl $$3,%ecx\09\09\0Ajz 1f\09\09\09\0Arep ; movsb\09\09\0A1:", "=&{cx},=&{di},=&{si},0,imr,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %11, i32 %12, i64 %14, i64 %16)
%18 = extractvalue { i32, i64, i64 } %17, 0
%19 = extractvalue { i32, i64, i64 } %17, 1
%20 = extractvalue { i32, i64, i64 } %17, 2
store i32 %18, i32* %7
%21 = trunc i64 %19 to i32
store i32 %21, i32* %8
%22 = trunc i64 %20 to i32
store i32 %22, i32* %9
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @builtin_memcpy(i8* returned %0, i8* %1, i32 %2) {
%4 = lshr i32 %2, 2
%5 = ptrtoint i8* %0 to i64
%6 = ptrtoint i8* %1 to i64
%7 = tail call { i32, i64, i64 } asm sideeffect "rep ; movsl\09\09\0Amovl $4,%ecx\09\09\0Aandl $$3,%ecx\09\09\0Ajz 1f\09\09\09\0Arep ; movsb\09\09\0A1:", "=&{cx},=&{di},=&{si},0,imr,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %2, i64 %5, i64 %6)
ret i8* %0
}
int test_imm_F9int16_mem(short *val) {
  return ((*val) & (-0xF9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F9int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff07,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F9int16_mem>:
movzwl (%rdi),%eax
test   $0xff07,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F9int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -249
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, void *, size_t);
ssize_t read_auto_resume(int fd, void *buffer, size_t n) {
  ssize_t m = 0;
  do {
    m = read(fd, buffer, n);
  } while (m == -1 && errno == EINTR);
  return m;
}


x86 assembly (clang, -O0):
<read_auto_resume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1166 <read_auto_resume+0x56>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    112a <read_auto_resume+0x1a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_auto_resume>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    114b <read_auto_resume+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <read_auto_resume+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @read_auto_resume(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @read(i32 %9, i8* %10, i64 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @read_auto_resume(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ copyMat4(float *, float *);
int /*<<< orphan*/ hpmMultMat4(float *, float *, float *);
int /*<<< orphan*/ hpmTranslation(float, float, float, float *);
void hpmTranslate(float x, float y, float z, float *mat) {
  float trans[16], r[16];
  hpmTranslation(x, y, z, trans);
  hpmMultMat4(trans, mat, r);
  copyMat4(mat, r);
}


x86 assembly (clang, -O0):
<hpmTranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x60(%rbp),%rdi
call   1040 <hpmTranslation@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <hpmMultMat4@plt>
mov    -0x18(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <copyMat4@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmTranslate>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1040 <hpmTranslation@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <hpmMultMat4@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <copyMat4@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @hpmTranslate(float %0, float %1, float %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float*
%9 = alloca [16 x float]
%10 = alloca [16 x float]
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float* %3, float** %8
%11 = load float, float* %5
%12 = load float, float* %6
%13 = load float, float* %7
%14 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%15 = call i32 @hpmTranslation(float %11, float %12, float %13, float* %14)
%16 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%17 = load float*, float** %8
%18 = getelementptr inbounds [16 x float], [16 x float]* %10, i64 0, i64 0
%19 = call i32 @hpmMultMat4(float* %16, float* %17, float* %18)
%20 = load float*, float** %8
%21 = getelementptr inbounds [16 x float], [16 x float]* %10, i64 0, i64 0
%22 = call i32 @copyMat4(float* %20, float* %21)
ret void
}

LLVM IR (-O2):
define void @hpmTranslate(float %0, float %1, float %2, float* %3) {
%5 = alloca [16 x float]
%6 = alloca [16 x float]
%7 = bitcast [16 x float]* %5 to i8*
%8 = bitcast [16 x float]* %6 to i8*
%9 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%10 = call i32 @hpmTranslation(float %0, float %1, float %2, float* %9)
%11 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%12 = call i32 @hpmMultMat4(float* %9, float* %3, float* %11)
%13 = call i32 @copyMat4(float* %3, float* %11)
ret void
}
unsigned char tint(old, new, level) {
  return old * (level - 1) / level + new / level;
}


x86 assembly (clang, -O0):
<tint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tint>:
mov    %edx,%ecx
lea    -0x1(%rcx),%eax
imul   %edi,%eax
cltd
idiv   %ecx
mov    %eax,%edi
mov    %esi,%eax
cltd
idiv   %ecx
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @tint(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = sdiv i32 %10, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sdiv i32 %13, %14
%16 = add nsw i32 %12, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @tint(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = mul nsw i32 %4, %0
%6 = sdiv i32 %5, %2
%7 = sdiv i32 %1, %2
%8 = add nsw i32 %7, %6
%9 = trunc i32 %8 to i8
ret i8 %9
}
unsigned char inb(unsigned short port) {
  unsigned char ret;
  asm volatile("inb %1, %0" : "=a"(ret) : "dN"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
double maxf(double x, double y) {
  if (x >= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<maxf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <maxf+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <maxf+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxf>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @maxf(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}