xunge/DecIR huggingface dataset:
OP(dd, b3) {
  illegal_1();
  op_b3();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b3()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b3()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yield();
void tester(void *dead) {
  yield();
  printf("Back from tester\n");
}


x86 assembly (clang, -O0):
<tester>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <yield@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tester>:
push   %rax
xor    %eax,%eax
call   1040 <yield@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Back from tester\0A\00"
define void @tester(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @yield()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Back from tester\00"
define void @tester(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @yield()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned xrop3_39_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_39_1_1>:
mov    %esi,%ecx
or     %edi,%esi
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%ecx
mov    %ecx,%edx
xor    %eax,%edx
or     %esi,%eax
or     %ecx,%eax
or     %edx,%eax
not    %eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_39_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_39_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, %4
%8 = or i8 %1, %0
%9 = zext i8 %8 to i32
%10 = or i32 %4, %9
%11 = or i32 %10, %6
%12 = or i32 %11, %7
%13 = xor i32 %12, -1
%14 = or i32 %9, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int answer = 0;
  printf("%d\n", answer);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ do_maxsum(struct TreeNode *, int *);
int maxPathSum(struct TreeNode *root) {
  if (!root)
    return (0);
  int sum = INT_MIN;
  do_maxsum(root, &sum);
  return (sum);
}


x86 assembly (clang, -O0):
<maxPathSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <maxPathSum+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1152 <maxPathSum+0x42>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <do_maxsum@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxPathSum>:
test   %rdi,%rdi
je     1136 <maxPathSum+0x26>
push   %rax
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <do_maxsum@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
@INT_MIN = global i32 0
define i32 @maxPathSum(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
%4 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
%5 = load %struct.TreeNode*, %struct.TreeNode** %3
%6 = icmp ne %struct.TreeNode* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* @INT_MIN
store i32 %9, i32* %4
%10 = load %struct.TreeNode*, %struct.TreeNode** %3
%11 = call i32 @do_maxsum(%struct.TreeNode* %10, i32* %4)
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
@INT_MIN = global i32 0
define i32 @maxPathSum(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = icmp eq %struct.TreeNode* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = bitcast i32* %2 to i8*
%6 = load i32, i32* @INT_MIN
store i32 %6, i32* %2
%7 = call i32 @do_maxsum(%struct.TreeNode* %0, i32* %2)
%8 = load i32, i32* %2
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *deleteNode(struct ListNode *);
struct ListNode *shift(struct ListNode *head) {
  return deleteNode(head);
}


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

x86 assembly (clang, -O2):
<shift>:
jmp    1030 <deleteNode@plt>

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

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define %struct.ListNode* @shift(%struct.ListNode* %0) {
%2 = tail call %struct.ListNode* @deleteNode(%struct.ListNode* %0)
ret %struct.ListNode* %2
}
/* Variables and functions */
void *malloc(int);
void *init_data() { return malloc(1); }


x86 assembly (clang, -O0):
<init_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_data>:
mov    $0x1,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @init_data() {
%1 = call i8* @malloc(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @init_data() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
ret i8* %1
}
void int_val_compare_and_swap(int *p, int i, int j, int *q) {
  *q = __sync_val_compare_and_swap(p, i, j);
}


x86 assembly (clang, -O0):
<int_val_compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_val_compare_and_swap>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @int_val_compare_and_swap(i32* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = cmpxchg i32* %9, i32 %10, i32 %11 seq_cst seq_cst
%13 = extractvalue { i32, i1 } %12, 0
%14 = load i32*, i32** %8
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @int_val_compare_and_swap(i32* nocapture %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%6 = extractvalue { i32, i1 } %5, 0
store i32 %6, i32* %3
ret void
}
void DH_up_ref(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_up_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showVersion(void) {
  printf("Version: "
         "0.1"
         "\n"
         "Build date: "
         "Mar 16 2022"
         ", "
         "07:07:03"
         "\n"
         "Compiled by: "
         "<+AUTHOR+>"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"Version: 0.1\0ABuild date: Mar 16 2022, 07:07:03\0ACompiled by: <+AUTHOR+>\0A\00"
define void @showVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [71 x i8] c"Version: 0.1\0ABuild date: Mar 16 2022, 07:07:03\0ACompiled by: <+AUTHOR+>\00"
define void @showVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int x, y;
  while (scanf("%d%d", &x, &y) == 2)
    printf("%d\n", gcd(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    117a <main+0x4a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1199 <main+0x69>
lea    0xead(%rip),%r14
lea    0xea1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <gcd@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp eq i32 %12, 2
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct timeval {
  long tv_usec;
  int tv_sec;
};

/* Variables and functions */
long int timeval_diff(struct timeval *t2, struct timeval *t1) {
  return (t2->tv_usec + 1000000 * t2->tv_sec) -
         (t1->tv_usec + 1000000 * t1->tv_sec);
}


x86 assembly (clang, -O0):
<timeval_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
imul   $0xf4240,0x8(%rcx),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
imul   $0xf4240,0x8(%rdx),%edx
movslq %edx,%rdx
add    %rdx,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_diff>:
movslq 0x8(%rdi),%rax
imul   $0xf4240,%rax,%rax
movslq 0x8(%rsi),%rcx
add    (%rdi),%rax
imul   $0xf4240,%rcx,%rcx
add    (%rsi),%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @timeval_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = mul nsw i32 1000000, %10
%12 = sext i32 %11 to i64
%13 = add nsw i64 %7, %12
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = mul nsw i32 1000000, %19
%21 = sext i32 %20 to i64
%22 = add nsw i64 %16, %21
%23 = sub nsw i64 %13, %22
ret i64 %23
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @timeval_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 1000000
%14 = sext i32 %13 to i64
%15 = add i64 %4, %8
%16 = add i64 %10, %14
%17 = sub i64 %15, %16
ret i64 %17
}
void populateVarTbl(char *varTbl, int size) {
  int i = 0;
  for (i = 0; i < size; i++)
    varTbl[i] = '#';
}


x86 assembly (clang, -O0):
<populateVarTbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <populateVarTbl+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x23,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <populateVarTbl+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<populateVarTbl>:
test   %esi,%esi
jle    1125 <populateVarTbl+0x15>
push   %rax
mov    %esi,%edx
mov    $0x23,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @populateVarTbl(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void system_sound_shutdown(void) { return; }


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

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

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

LLVM IR (-O2):
define void @system_sound_shutdown() {
ret void
}
void prepare_update() {}


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

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

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

LLVM IR (-O2):
define void @prepare_update() {
ret void
}
/* Type definitions */
struct ptr_ring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __ptr_ring_discard_one(struct ptr_ring *);
void *__ptr_ring_peek(struct ptr_ring *);
void *__ptr_ring_consume(struct ptr_ring *r) {
  void *ptr;
  ptr = __ptr_ring_peek(r);
  if (ptr) {
    __ptr_ring_discard_one(r);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<__ptr_ring_consume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ptr_ring_peek@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <__ptr_ring_consume+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <__ptr_ring_discard_one@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptr_ring_consume>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <__ptr_ring_peek@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113c <__ptr_ring_consume+0x1c>
mov    %r14,%rdi
call   1040 <__ptr_ring_discard_one@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = alloca %struct.ptr_ring*
%3 = alloca i8*
store %struct.ptr_ring* %0, %struct.ptr_ring** %2
%4 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%5 = call i8* @__ptr_ring_peek(%struct.ptr_ring* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.ptr_ring*, %struct.ptr_ring** %2
%10 = call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
%struct.ptr_ring = type { i32 }
define i8* @__ptr_ring_consume(%struct.ptr_ring* %0) {
%2 = tail call i8* @__ptr_ring_peek(%struct.ptr_ring* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__ptr_ring_discard_one(%struct.ptr_ring* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Dao_GetErrorDLL();
void *Dao_OpenDLL(const char *name) {
  void *handle = NULL;
  if (!handle) {
    Dao_GetErrorDLL();
    return 0;
  }
  return handle;
}


x86 assembly (clang, -O0):
<Dao_OpenDLL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1143 <Dao_OpenDLL+0x33>
mov    $0x0,%al
call   1030 <Dao_GetErrorDLL@plt>
movq   $0x0,-0x8(%rbp)
jmp    114b <Dao_OpenDLL+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @Dao_OpenDLL(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @Dao_GetErrorDLL()
ret i8* null
}
int char_is_backspace(int c) { return c == '\b' || c == 0x7f; }


x86 assembly (clang, -O0):
<char_is_backspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <char_is_backspace+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_is_backspace>:
cmp    $0x8,%edi
sete   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @char_is_backspace(i32 %0) {
%2 = icmp eq i32 %0, 8
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 LNET_NETNUM(__u32 net) { return net & 0xffff; }


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

x86 assembly (clang, -O2):
<LNET_NETNUM>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @LNET_NETNUM(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_win_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_win_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_win_wch+0x2a>
jmp    1170 <cmd_win_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_win_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_win_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_win_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_win_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPID;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPID_it;
OCSP_RESPID *OCSP_RESPID_new(void) {
  return (OCSP_RESPID *)ASN1_item_new(&OCSP_RESPID_it);
}


x86 assembly (clang, -O0):
<OCSP_RESPID_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_RESPID_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@OCSP_RESPID_it = global i32 0
define i32* @OCSP_RESPID_new() {
%1 = call i64 @ASN1_item_new(i32* @OCSP_RESPID_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@OCSP_RESPID_it = global i32 0
define i32* @OCSP_RESPID_new() {
%1 = tail call i64 @ASN1_item_new(i32* @OCSP_RESPID_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int ikitwin_tick(int);
int iscreen_tick(int fps) { return ikitwin_tick(fps); }


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

x86 assembly (clang, -O2):
<iscreen_tick>:
jmp    1030 <ikitwin_tick@plt>

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

LLVM IR (-O2):
define i32 @iscreen_tick(i32 %0) {
%2 = tail call i32 @ikitwin_tick(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *emalloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *newstr(char *s, int l) {
  char *rv = emalloc(l + 1);
  rv[l] = '\0';
  strncpy(rv, s, l);
  return rv;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <emalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <emalloc@plt>
mov    %rax,%rbx
movslq %r15d,%rdx
movb   $0x0,(%rax,%rdx,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @emalloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @strncpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @newstr(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @emalloc(i32 %3)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %6
%7 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
ret i8* %4
}
int redecl9(void) {}


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

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

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

LLVM IR (-O2):
define i32 @redecl9() {
ret i32 undef
}
void g_value_array_insert() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_insert() {
ret void
}
void disable_irq(void) { asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_irq() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void *unload_clib(void *l) { dlclose(l); }


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

x86 assembly (clang, -O2):
<unload_clib>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define noalias i8* @unload_clib(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *cmalloc(size_t size) {
  void *space = NULL;
  if (size == 0) {
    perror("Malloc null size");
    exit(1);
  }
  space = malloc(size);
  if (space == NULL) {
    perror("Bad memory allocation");
    exit(1);
  }
  return space;
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1165 <cmalloc+0x35>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1193 <cmalloc+0x63>
lea    0xe8d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %rax
test   %rdi,%rdi
je     1142 <cmalloc+0x12>
call   1030 <malloc@plt>
test   %rax,%rax
je     114b <cmalloc+0x1b>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
jmp    1152 <cmalloc+0x22>
lea    0xebf(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Malloc null size\00"
@.str.1 = [22 x i8] c"Bad memory allocation\00"
define i8* @cmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i64, i64* %2
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"Malloc null size\00"
@.str.1 = [22 x i8] c"Bad memory allocation\00"
define noalias i8* @cmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i8* @malloc(i64 %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %6
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ mem_readb_phys_dma(int);
void DMAPageRead(uint32_t PhysAddress, uint8_t *DataRead, uint32_t TotalSize) {
  int i = 0;
  for (i = 0; i < TotalSize; i++)
    DataRead[i] = mem_readb_phys_dma(PhysAddress + i);
}


x86 assembly (clang, -O0):
<DMAPageRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <DMAPageRead+0x52>
mov    -0x4(%rbp),%edi
add    -0x18(%rbp),%edi
call   1030 <mem_readb_phys_dma@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <DMAPageRead+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMAPageRead>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <DMAPageRead+0x36>
mov    %rsi,%r14
mov    %edx,%r15d
mov    %edi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%edi
call   1030 <mem_readb_phys_dma@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <DMAPageRead+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @DMAPageRead(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = trunc i64 %8 to i32
%10 = add i32 %9, %0
%11 = tail call i32 @mem_readb_phys_dma(i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void set_nonblock(int fd) {
  int flags = fcntl(fd, F_GETFL);
  if (flags == -1)
    return;
  fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1140 <set_nonblock+0x30>
jmp    115f <set_nonblock+0x4f>
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e92(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1146 <set_nonblock+0x36>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb0(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
br label %17
10: ; preds = %1
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 (i32, i32, ...) @fcntl(i32 %11, i32 %12, i32 %15)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
ret void
}
/* Variables and functions */
int atoi(char *);
char *read_value(char *);
int vcpfr_read_int(char *propertyName) {
  char *value = read_value(propertyName);
  if (value != NULL)
    return atoi(value);
  else
    return 0;
}


x86 assembly (clang, -O0):
<vcpfr_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <read_value@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <vcpfr_read_int+0x35>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <vcpfr_read_int+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcpfr_read_int>:
push   %rax
call   1030 <read_value@plt>
test   %rax,%rax
je     1134 <vcpfr_read_int+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vcpfr_read_int(i8* %0) {
%2 = tail call i8* @read_value(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
double exp(double);
double GaussPhi(double X) { return (exp(-X * X * 0.5)); }


x86 assembly (clang, -O0):
<GaussPhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GaussPhi>:
mulsd  %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @GaussPhi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fmul double %6, 5.000000e-01
%8 = call double @exp(double %7)
ret double %8
}

LLVM IR (-O2):
define double @GaussPhi(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @exp(double %4)
ret double %5
}
int wizard(uname) const char *uname;
{
  int flag;
  if ((flag = checkout(uname)) != 0)
    printf("You are the Great wizard %s.\n", uname);
  return flag;
}


x86 assembly (clang, -O0):
<wizard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <checkout@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1155 <wizard+0x35>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wizard>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <checkout@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1144 <wizard+0x24>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"You are the Great wizard %s.\0A\00"
define i32 @wizard(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @checkout to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [30 x i8] c"You are the Great wizard %s.\0A\00"
define i32 @wizard(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @checkout to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int xmessagePresent(void) {
  static int lXmessagePresent = -1;
  if (lXmessagePresent < 0) {
    lXmessagePresent = detectPresence("xmessage");
  }
  return lXmessagePresent && graphicMode();
}


x86 assembly (clang, -O0):
<xmessagePresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <xmessagePresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <xmessagePresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %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):
<xmessagePresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <xmessagePresent+0x23>
test   %eax,%eax
je     1159 <xmessagePresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <xmessagePresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@xmessagePresent.lXmessagePresent = internal global i32 -1
@.str = [9 x i8] c"xmessage\00"
define i32 @xmessagePresent() {
%1 = load i32, i32* @xmessagePresent.lXmessagePresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @xmessagePresent.lXmessagePresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @xmessagePresent.lXmessagePresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@xmessagePresent.lXmessagePresent = internal unnamed_addr global i32 -1
@.str = [9 x i8] c"xmessage\00"
define i32 @xmessagePresent() {
%1 = load i32, i32* @xmessagePresent.lXmessagePresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @xmessagePresent.lXmessagePresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
int fegetexcept(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fegetexcept() {
ret i32 -1
}