xunge/DecIR huggingface dataset:
int main() {
  struct Int {
    int i;
  } a;
  struct Int c[1] = {0};
  int d[1] = {1};
  int f = 1;
  int e[1] = {f};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0xecb(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void rrpge_m_free_def(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @rrpge_m_free_def(i8* nocapture %0) {
ret void
}
adrreg0indreg1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[10000000]) = (*p1); }


x86 assembly (clang, -O0):
<adrreg0indreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x2625a00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0indreg1_set>:
mov    (%r9),%eax
mov    %eax,0x2625a00(%r8)
ret

LLVM IR (-O0):
define i32 @adrreg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %12
%17 = getelementptr inbounds i32, i32* %16, i64 10000000
store i32 %15, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adrreg0indreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 10000000
store i32 %7, i32* %8
ret i32 undef
}
/* Variables and functions */
double atof(char *);
char *par_getsl(char *, char *);
double par_getd(char *block, char *name) {
  char *pp = par_getsl(block, name);
  return atof(pp);
}


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

x86 assembly (clang, -O2):
<par_getd>:
push   %rax
call   1040 <par_getsl@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @par_getd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @par_getsl(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call double @atof(i8* %9)
ret double %10
}

LLVM IR (-O2):
define double @par_getd(i8* %0, i8* %1) {
%3 = tail call i8* @par_getsl(i8* %0, i8* %1)
%4 = tail call double @atof(i8* %3)
ret double %4
}
/* Variables and functions */
void *malloc(unsigned int);
void *mymalloc(unsigned int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mymalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mymalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printString(char *string, unsigned long stringLength) {
  for (int i = 0; i < stringLength; ++i) {
    printf("%c\n", string[i]);
  }
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <printString+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xebc(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <printString+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <printString+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define void @printString(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @printString(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
int Q_strlen(const char *string) {
  int len;
  const char *p;
  if (!string)
    return 0;
  len = 0;
  p = string;
  while (*p) {
    p++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<Q_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <Q_strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    115b <Q_strlen+0x5b>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <Q_strlen+0x55>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <Q_strlen+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <Q_strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <Q_strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <Q_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @Q_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nuw nsw i32 %8, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t bitCount_fun_int32_t(int32_t x) {
  uint32_t r = x & 1;
  for (x = x >> 1 & 0x7fffffff; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <bitCount_fun_int32_t+0x42>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <bitCount_fun_int32_t+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_int32_t>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%edi
jb     1120 <bitCount_fun_int32_t+0x20>
mov    %edi,%ecx
nopl   0x0(%rax)
shr    %ecx
mov    %ecx,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <bitCount_fun_int32_t+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_int32_t(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp ult i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %9, %4 ], [ %2, %1 ]
%7 = lshr i32 %5, 1
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %8, %6
%10 = icmp ult i32 %5, 4
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ %2, %1 ], [ %9, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *tmp_name(void);
  printf("Name: %s\n", tmp_name());
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Name: %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @tmp_name()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Name: %s\0A\00"
define i32 @main() {
%1 = tail call i8* @tmp_name()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void cpu_destroy() {}


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

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

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

LLVM IR (-O2):
define void @cpu_destroy() {
ret void
}
void destroy_accept_tbl(void) {}


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

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

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

LLVM IR (-O2):
define void @destroy_accept_tbl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_cmp(int, int);
int /*<<< orphan*/ emit_orreq_imm(int, int, int);
void emit_cmpeq(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_cmp(s1, s2);
  emit_orreq_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_cmpeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <emit_cmp@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_orreq_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmpeq>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <emit_cmp@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <emit_orreq_imm@plt>

LLVM IR (-O0):
define void @emit_cmpeq(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* %7
%10 = load i32, i32* %7
%11 = call i32 @emit_andimm(i32 %9, i32 -2, i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @emit_cmp(i32 %12, i32 %13)
%15 = load i32, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @emit_orreq_imm(i32 %15, i32 1, i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_cmpeq(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_cmp(i32 %0, i32 %1)
%7 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ isprint(char);
char makeprint(char c) {
  if (isprint(c))
    return c;
  else
    return '?';
}


x86 assembly (clang, -O0):
<makeprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
je     113c <makeprint+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1140 <makeprint+0x30>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint@plt>
test   %rax,%rax
mov    $0x3f,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @makeprint(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isprint(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* %3
store i8 %8, i8* %2
br label %10
9: ; preds = %1
store i8 63, i8* %2
br label %10
10: ; preds = %9, %7
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @makeprint(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 63, i8 %0
ret i8 %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int compEQ(char *primary_key1, char *primary_key2) {
  int rc = 0;
  if (strcmp(primary_key1, primary_key2) == 0)
    rc = 1;
  return rc;
}


x86 assembly (clang, -O0):
<compEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1145 <compEQ+0x35>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compEQ>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compEQ(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, long);
int /*<<< orphan*/ stderr;
void long_ok(long got, long expected) {
  if (got == expected)
    return;
  fprintf(stderr, "Got %ld, expected %ld\n", got, expected);
  exit(1);
}


x86 assembly (clang, -O0):
<long_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1144 <long_ok+0x24>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<long_ok>:
cmp    %rsi,%rdi
jne    1126 <long_ok+0x6>
ret
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Got %ld, expected %ld\0A\00"
define void @long_ok(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
ret void
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %11, i64 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Got %ld, expected %ld\0A\00"
define void @long_ok(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int adjtime(struct timeval *, struct timeval *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct timeval a, b;
  a.tv_sec = 0;
  a.tv_usec = 0;
  printf("%d\n", adjtime(&a, &b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <adjtime@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
lea    0x18(%rsp),%rsi
call   1040 <adjtime@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast %struct.timeval* %1 to i8*
%6 = call i32 @adjtime(%struct.timeval* %1, %struct.timeval* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int lsda_util_db2sg(int type_id) {
  switch (type_id) {
  case 19:
    return 18;
  case 22:
    return 21;
  case 10:
    return 9;
  case 8:
    return 7;
  case 17:
    return 15;
  case 4:
    return 3;
  case 14:
    return 12;
  }
  return type_id;
}


x86 assembly (clang, -O0):
<lsda_util_db2sg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x12,%eax
ja     1184 <lsda_util_db2sg+0x84>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x12,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0x15,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0x9,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0x7,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0xf,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0x3,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
movl   $0xc,-0x4(%rbp)
jmp    118a <lsda_util_db2sg+0x8a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsda_util_db2sg>:
lea    -0x4(%rdi),%ecx
cmp    $0x12,%ecx
ja     1123 <lsda_util_db2sg+0x23>
mov    $0x12,%eax
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x3,%eax
ret
mov    %edi,%eax
ret
mov    $0x7,%eax
ret
mov    $0x9,%eax
ret
mov    $0xf,%eax
ret
mov    $0x15,%eax
ret
mov    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @lsda_util_db2sg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 19, label %5
i32 22, label %6
i32 10, label %7
i32 8, label %8
i32 17, label %9
i32 4, label %10
i32 14, label %11
]
5: ; preds = %1
store i32 18, i32* %2
br label %14
6: ; preds = %1
store i32 21, i32* %2
br label %14
7: ; preds = %1
store i32 9, i32* %2
br label %14
8: ; preds = %1
store i32 7, i32* %2
br label %14
9: ; preds = %1
store i32 15, i32* %2
br label %14
10: ; preds = %1
store i32 3, i32* %2
br label %14
11: ; preds = %1
store i32 12, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @lsda_util_db2sg(i32 %0) {
switch i32 %0, label %8 [
i32 19, label %9
i32 22, label %2
i32 10, label %3
i32 8, label %4
i32 17, label %5
i32 4, label %6
i32 14, label %7
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3, %2
%10 = phi i32 [ %0, %8 ], [ 12, %7 ], [ 3, %6 ], [ 15, %5 ], [ 7, %4 ], [ 9, %3 ], [ 21, %2 ], [ 18, %1 ]
ret i32 %10
}
int test_imm_E9int64_lowword_reg(long long val) {
  return ((val) & (0xE9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E9int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 233
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_ver1_func3(void) { printf("B - version 1 func3\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"B - version 1 func3\0A\00"
define void @iface1_ver1_func3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"B - version 1 func3\00"
define void @iface1_ver1_func3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct uml_pt_regs {
  int dummy;
};

/* Variables and functions */
void arch_examine_signal(int sig, struct uml_pt_regs *regs) {}


x86 assembly (clang, -O0):
<arch_examine_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.uml_pt_regs = type { i32 }
define void @arch_examine_signal(i32 %0, %struct.uml_pt_regs* %1) {
%3 = alloca i32
%4 = alloca %struct.uml_pt_regs*
store i32 %0, i32* %3
store %struct.uml_pt_regs* %1, %struct.uml_pt_regs** %4
ret void
}

LLVM IR (-O2):
%struct.uml_pt_regs = type { i32 }
define void @arch_examine_signal(i32 %0, %struct.uml_pt_regs* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void test(double d) { printf("Test: %f\n", d); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Test: %f\0A\00"
define void @test(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Test: %f\0A\00"
define void @test(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
void nscd_flush_cache(char **databases) {}


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

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

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

LLVM IR (-O2):
define void @nscd_flush_cache(i8** nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double pow2_u64(int);
double from_msr_pu_atom(uint64_t msrval) {
  return pow2_u64((msrval >> 0) & 0xF) / 1000.0;
}


x86 assembly (clang, -O0):
<from_msr_pu_atom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x0,%edi
and    $0xf,%edi
call   1030 <pow2_u64@plt>
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_msr_pu_atom>:
push   %rax
and    $0xf,%edi
call   1030 <pow2_u64@plt>
divsd  0xedf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @from_msr_pu_atom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 15
%6 = call double @pow2_u64(i32 %5)
%7 = fdiv double %6, 1.000000e+03
ret double %7
}

LLVM IR (-O2):
define double @from_msr_pu_atom(i32 %0) {
%2 = and i32 %0, 15
%3 = tail call double @pow2_u64(i32 %2)
%4 = fdiv double %3, 1.000000e+03
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int muli(uint32_t *env) {
  uint32_t *context = (uint32_t *)*(uint32_t **)(env + 1);
  int a = (int)*(int *)(context);
  int b = (int)*(int *)(context + 1);
  return a * b;
}


x86 assembly (clang, -O0):
<muli>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<muli>:
mov    0x4(%rdi),%rcx
mov    0x4(%rcx),%eax
imul   (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @muli(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = bitcast i32* %7 to i32**
%9 = load i32*, i32** %8
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @muli(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ init_amulet_material_tab();
int /*<<< orphan*/ init_necklace_material_tab();
int /*<<< orphan*/ init_ring_material_tab();
int /*<<< orphan*/ reset_amulet_material();
int /*<<< orphan*/ reset_amulet_tab();
int /*<<< orphan*/ reset_necklace_material();
int /*<<< orphan*/ reset_necklace_tab();
int /*<<< orphan*/ reset_ring_material();
int /*<<< orphan*/ reset_ring_tab();
void init_acce(void) {
  init_ring_material_tab();
  init_amulet_material_tab();
  init_necklace_material_tab();
  reset_ring_tab();
  reset_amulet_tab();
  reset_necklace_tab();
  reset_ring_material();
  reset_amulet_material();
  reset_necklace_material();
}


x86 assembly (clang, -O0):
<init_acce>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <init_ring_material_tab@plt>
mov    $0x0,%al
call   1060 <init_amulet_material_tab@plt>
mov    $0x0,%al
call   10b0 <init_necklace_material_tab@plt>
mov    $0x0,%al
call   1070 <reset_ring_tab@plt>
mov    $0x0,%al
call   1090 <reset_amulet_tab@plt>
mov    $0x0,%al
call   1050 <reset_necklace_tab@plt>
mov    $0x0,%al
call   10a0 <reset_ring_material@plt>
mov    $0x0,%al
call   1040 <reset_amulet_material@plt>
mov    $0x0,%al
call   1030 <reset_necklace_material@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_acce>:
push   %rax
xor    %eax,%eax
call   1080 <init_ring_material_tab@plt>
xor    %eax,%eax
call   1060 <init_amulet_material_tab@plt>
xor    %eax,%eax
call   10b0 <init_necklace_material_tab@plt>
xor    %eax,%eax
call   1070 <reset_ring_tab@plt>
xor    %eax,%eax
call   1090 <reset_amulet_tab@plt>
xor    %eax,%eax
call   1050 <reset_necklace_tab@plt>
xor    %eax,%eax
call   10a0 <reset_ring_material@plt>
xor    %eax,%eax
call   1040 <reset_amulet_material@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_necklace_material@plt>

LLVM IR (-O0):
define void @init_acce() {
%1 = call i32 (...) @init_ring_material_tab()
%2 = call i32 (...) @init_amulet_material_tab()
%3 = call i32 (...) @init_necklace_material_tab()
%4 = call i32 (...) @reset_ring_tab()
%5 = call i32 (...) @reset_amulet_tab()
%6 = call i32 (...) @reset_necklace_tab()
%7 = call i32 (...) @reset_ring_material()
%8 = call i32 (...) @reset_amulet_material()
%9 = call i32 (...) @reset_necklace_material()
ret void
}

LLVM IR (-O2):
define void @init_acce() {
%1 = tail call i32 (...) @init_ring_material_tab()
%2 = tail call i32 (...) @init_amulet_material_tab()
%3 = tail call i32 (...) @init_necklace_material_tab()
%4 = tail call i32 (...) @reset_ring_tab()
%5 = tail call i32 (...) @reset_amulet_tab()
%6 = tail call i32 (...) @reset_necklace_tab()
%7 = tail call i32 (...) @reset_ring_material()
%8 = tail call i32 (...) @reset_amulet_material()
%9 = tail call i32 (...) @reset_necklace_material()
ret void
}
/* Variables and functions */
int f254(int *);
int f255(int *p) { return f254(p); }


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

x86 assembly (clang, -O2):
<f255>:
jmp    1030 <f254@plt>

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

LLVM IR (-O2):
define i32 @f255(i32* %0) {
%2 = tail call i32 @f254(i32* %0)
ret i32 %2
}
void __attribute__((section(".text.2"))) frame2(void) {
  asm("frame2_label: .globl frame2_label");
  frame3();
}


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

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

LLVM IR (-O0):
define void @frame2() section ".text.2" {
%1 = call i32 (...) @frame3()
ret void
}

LLVM IR (-O2):
define void @frame2() section ".text.2" {
tail call void asm sideeffect "frame2_label: .globl frame2_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @frame3()
ret void
}
void NoSoundDrv_PCM_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_PCM_Shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int pow(int, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("%d", pow(2, 15));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0xf,%esi
call   1050 <pow@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xf,%esi
call   1050 <pow@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = call i32 @pow(i32 2, i32 15)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @pow(i32 2, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int GetFileSize(char const *);
int /*<<< orphan*/ printf(char *, char const *, int);
int GetFileSize_test() {
  const char *file = "./filesystem.c";
  int size = GetFileSize(file);
  printf("%s size = %d\n", file, size);
  return 0;
}


x86 assembly (clang, -O0):
<GetFileSize_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <GetFileSize@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileSize_test>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <GetFileSize@plt>
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"./filesystem.c\00"
@.str.1 = [14 x i8] c"%s size = %d\0A\00"
define i32 @GetFileSize_test() {
%1 = tail call i32 @GetFileSize(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void glFramebufferTexture2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFramebufferTexture2D() {
ret void
}
/* Variables and functions */
double GetSatVapPres(double);
double GetVapPresFromTDewPoint(double TDewPoint) {
  return GetSatVapPres(TDewPoint);
}


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

x86 assembly (clang, -O2):
<GetVapPresFromTDewPoint>:
jmp    1030 <GetSatVapPres@plt>

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

LLVM IR (-O2):
define double @GetVapPresFromTDewPoint(double %0) {
%2 = tail call double @GetSatVapPres(double %0)
ret double %2
}
void RasterEndOfFrameIntEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x40)))) |= (0x00000004);
}


x86 assembly (clang, -O0):
<RasterEndOfFrameIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterEndOfFrameIntEnable>:
add    $0x40,%edi
orl    $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @RasterEndOfFrameIntEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 64
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 4
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterEndOfFrameIntEnable(i32 %0) {
%2 = add i32 %0, 64
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 4
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_IO();
int /*<<< orphan*/ setup_TIM2();
void setup() {
  setup_IO();
  setup_TIM2();
}


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

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

LLVM IR (-O0):
define void @setup() {
%1 = call i32 (...) @setup_IO()
%2 = call i32 (...) @setup_TIM2()
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @setup_IO()
%2 = tail call i32 (...) @setup_TIM2()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ diminuto_fd_write_generic(int, void const *, size_t, size_t);
ssize_t diminuto_fd_write(int fd, const void *buffer, size_t size) {
  return diminuto_fd_write_generic(fd, buffer, size, size);
}


x86 assembly (clang, -O0):
<diminuto_fd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <diminuto_fd_write_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_fd_write>:
mov    %rdx,%rcx
jmp    1030 <diminuto_fd_write_generic@plt>

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

LLVM IR (-O2):
define i32 @diminuto_fd_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @diminuto_fd_write_generic(i32 %0, i8* %1, i64 %2, i64 %2)
ret i32 %4
}
int kernel_has_rtsig(void) {
  return 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @kernel_has_rtsig() {
ret i32 0
}
int bitcount(int num) {
  int ans = 0;
  while (num != 0) {
    ans += 1;
    num &= (num - 1);
  }
  return ans;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
unsigned int samples_for_target_ci(double p, double error, double Z) {
  return (Z * Z) * p * (1 - p) / (error * error);
}


x86 assembly (clang, -O0):
<samples_for_target_ci>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm0,%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<samples_for_target_ci>:
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef0(%rip),%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm3
cvttsd2si %xmm3,%rax
ret

LLVM IR (-O0):
define i32 @samples_for_target_ci(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = fsub double 1.000000e+00, %12
%14 = fmul double %11, %13
%15 = load double, double* %5
%16 = load double, double* %5
%17 = fmul double %15, %16
%18 = fdiv double %14, %17
%19 = fptoui double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @samples_for_target_ci(double %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = fmul double %4, %0
%6 = fsub double 1.000000e+00, %0
%7 = fmul double %6, %5
%8 = fmul double %1, %1
%9 = fdiv double %7, %8
%10 = fptoui double %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() { foo(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
ret i32 0
}