xunge/DecIR huggingface dataset:
unsigned level(expr)
double expr;
{
  if (expr < 1.1e+7)
    return (pow((expr / 1000.0), 0.4875));
  else
    return (pow((expr / 1250.0), 0.4865));
}


x86 assembly (clang, -O0):
<level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115b <level+0x4b>
movsd  -0x10(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <pow@plt>
cvttsd2si %xmm0,%rax
mov    %eax,-0x4(%rbp)
jmp    1181 <level+0x71>
movsd  -0x10(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <pow@plt>
cvttsd2si %xmm0,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level>:
push   %rax
movsd  0xee7(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xedf(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
lea    0xee3(%rip),%rcx
divsd  (%rcx,%rax,8),%xmm0
call   1030 <pow@plt>
cvttsd2si %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @level(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 1.100000e+07
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fdiv double %7, 1.000000e+03
%9 = call double @pow(double %8, double 4.875000e-01)
%10 = fptoui double %9 to i32
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = fdiv double %12, 1.250000e+03
%14 = call double @pow(double %13, double 4.865000e-01)
%15 = fptoui double %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @level(double %0) {
%2 = fcmp olt double %0, 1.100000e+07
%3 = select i1 %2, double 1.000000e+03, double 1.250000e+03
%4 = select i1 %2, double 4.875000e-01, double 4.865000e-01
%5 = fdiv double %0, %3
%6 = tail call double @pow(double %5, double %4)
%7 = fptoui double %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ checkAllBuses();
int /*<<< orphan*/ iopl(int);
int main() {
  iopl(3);
  checkAllBuses();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @iopl(i32 3)
%2 = tail call i32 (...) @checkAllBuses()
ret i32 0
}
int outer_is_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @outer_is_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_6152() {
  Assert_real((isqrt(6152) == 78),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1400, ("Integer square root of 6152 should be 78"));
}


x86 assembly (clang, -O0):
<t_sqrt_6152>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1808,%edi
call   1030 <isqrt@plt>
cmp    $0x4e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x578,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_6152>:
push   %rax
mov    $0x1808,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x4e,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x578,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 6152 should be 78\00"
define void @t_sqrt_6152() {
%1 = call i32 @isqrt(i32 6152)
%2 = icmp eq i32 %1, 78
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1400, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 6152 should be 78\00"
define void @t_sqrt_6152() {
%1 = tail call i32 @isqrt(i32 6152)
%2 = icmp eq i32 %1, 78
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1400, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int startswith(const char *buf, const char *str) {
  while (1) {
    if (*str == 0)
      return 1;
    if (*buf == 0 || *buf != *str)
      return 0;
    buf++;
    str++;
  }
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1128 <startswith+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1177 <startswith+0x77>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <startswith+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115a <startswith+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1177 <startswith+0x77>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <startswith+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
mov    (%rsi),%r8b
mov    $0x1,%eax
test   %r8b,%r8b
je     112c <startswith+0x2c>
xor    %edx,%edx
nop
movzbl (%rdi,%rdx,1),%ecx
test   %cl,%cl
je     112d <startswith+0x2d>
cmp    %r8b,%cl
jne    112d <startswith+0x2d>
movzbl 0x1(%rsi,%rdx,1),%r8d
add    $0x1,%rdx
test   %r8b,%r8b
jne    1110 <startswith+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @startswith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %13
%6 = phi i8 [ %16, %13 ], [ %3, %2 ]
%7 = phi i8* [ %15, %13 ], [ %1, %2 ]
%8 = phi i8* [ %14, %13 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
%11 = icmp eq i8 %9, %6
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %13, %5, %2
%19 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %13 ]
ret i32 %19
}
void ice_rebuild_arfs(struct ice_pf *pf) {}


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

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

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

LLVM IR (-O2):
%struct.ice_pf = type opaque
define void @ice_rebuild_arfs(%struct.ice_pf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_mask_irq(int);
int pic_mask_irqs() {
  int i;
  for (i = 0; i < 0x10; i++) {
    pic_mask_irq(i);
  }
  return 1;
}


x86 assembly (clang, -O0):
<pic_mask_irqs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    113f <pic_mask_irqs+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <pic_mask_irq@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <pic_mask_irqs+0xf>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_mask_irqs>:
push   %rax
xor    %edi,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x1,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x2,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x3,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x4,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x5,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x6,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x7,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x8,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x9,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xa,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xb,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xc,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xd,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xe,%edi
call   1030 <pic_mask_irq@plt>
mov    $0xf,%edi
call   1030 <pic_mask_irq@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pic_mask_irqs() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @pic_mask_irq(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
define i32 @pic_mask_irqs() {
%1 = tail call i32 @pic_mask_irq(i32 0)
%2 = tail call i32 @pic_mask_irq(i32 1)
%3 = tail call i32 @pic_mask_irq(i32 2)
%4 = tail call i32 @pic_mask_irq(i32 3)
%5 = tail call i32 @pic_mask_irq(i32 4)
%6 = tail call i32 @pic_mask_irq(i32 5)
%7 = tail call i32 @pic_mask_irq(i32 6)
%8 = tail call i32 @pic_mask_irq(i32 7)
%9 = tail call i32 @pic_mask_irq(i32 8)
%10 = tail call i32 @pic_mask_irq(i32 9)
%11 = tail call i32 @pic_mask_irq(i32 10)
%12 = tail call i32 @pic_mask_irq(i32 11)
%13 = tail call i32 @pic_mask_irq(i32 12)
%14 = tail call i32 @pic_mask_irq(i32 13)
%15 = tail call i32 @pic_mask_irq(i32 14)
%16 = tail call i32 @pic_mask_irq(i32 15)
ret i32 1
}
void empty_plane(int airplane[16][6]) {
  int row = 0, col = 0;
  for (; row < 16; ++row) {
    for (col = 0; col < 6; ++col) {
      airplane[row][col] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<empty_plane>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    116c <empty_plane+0x6c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1159 <empty_plane+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <empty_plane+0x27>
jmp    115e <empty_plane+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <empty_plane+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_plane>:
push   %rax
mov    $0x180,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @empty_plane([6 x i32]* nocapture writeonly %0) {
%2 = bitcast [6 x i32]* %0 to i8*
ret void
}
int gettaskid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gettaskid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mysql_thread_end();
void database_thread_terminate() { mysql_thread_end(); }


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

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

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

LLVM IR (-O2):
define void @database_thread_terminate() {
%1 = tail call i32 (...) @mysql_thread_end()
ret void
}
void XkbFreeKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeKeyboard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void bred(void) { fputs("\033[0;41m", stdout); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;41m\00"
@stdout = global i32 0
define void @bred() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetErrorMode(unsigned int nErrorMode) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetErrorMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetErrorMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetErrorMode(i32 %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int system(const char *string) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @system(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int XCurses_kbhit();
bool PDC_check_bios_key() { return (XCurses_kbhit()); }


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

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

LLVM IR (-O0):
define i32 @PDC_check_bios_key() {
%1 = call i32 (...) @XCurses_kbhit()
ret i32 %1
}

LLVM IR (-O2):
define i32 @PDC_check_bios_key() {
%1 = tail call i32 (...) @XCurses_kbhit()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Trim(char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int strlen(char *);
void TrimDotINI(char *pszFilePath) {
  int iDot;
  Trim(pszFilePath);
  iDot = strlen(pszFilePath) - 4;
  if (!strcasecmp(&pszFilePath[iDot], ".ini"))
    pszFilePath[iDot] = '\0';
}


x86 assembly (clang, -O0):
<TrimDotINI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Trim@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    0xe9a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1180 <TrimDotINI+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrimDotINI>:
push   %rbx
mov    %rdi,%rbx
call   1040 <Trim@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
add    %rax,%rbx
add    $0xfffffffffffffffc,%rbx
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     115f <TrimDotINI+0x2f>
pop    %rbx
ret
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".ini\00"
define void @TrimDotINI(i8* %0) {
%2 = tail call i32 @Trim(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -4
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 0, i8* %6
br label %10
10: ; preds = %9, %1
ret void
}
int map_value(int value, int min_level, int max_level) {
  int total_global_levels;
  int total_levels;
  double factor;
  double mapped_value;
  total_global_levels = 2048 - 0 + 1;
  total_levels = max_level - min_level + 1;
  factor = ((double)total_global_levels) / ((double)total_levels);
  mapped_value = ((double)value) / (double)factor;
  return ((int)mapped_value) + min_level;
}


x86 assembly (clang, -O0):
<map_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x801,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x28(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_value>:
sub    %esi,%edx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
movsd  0xeef(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @map_value(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 2049, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %8
%18 = sitofp i32 %17 to double
%19 = fdiv double %16, %18
store double %19, double* %9
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = load double, double* %9
%23 = fdiv double %21, %22
store double %23, double* %10
%24 = load double, double* %10
%25 = fptosi double %24 to i32
%26 = load i32, i32* %5
%27 = add nsw i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @map_value(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 1, %1
%5 = add i32 %4, %2
%6 = sitofp i32 %5 to double
%7 = fdiv double 2.049000e+03, %6
%8 = sitofp i32 %0 to double
%9 = fdiv double %8, %7
%10 = fptosi double %9 to i32
%11 = add nsw i32 %10, %1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ function(int, int, int);
int main(void) {
  function(1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <function@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @function(i32 1, i32 2, i32 3)
ret i32 0
}
int sub(int x, int y) { return x - y; }


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

x86 assembly (clang, -O2):
<sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void test_1(unsigned char *x, unsigned int *y) { y[0] = x[1] >> 2; }


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sar    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
movzbl 0x1(%rdi),%eax
shr    $0x2,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @test_1(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 2
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @test_1(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = lshr i8 %4, 2
%6 = zext i8 %5 to i32
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
int pa_threaded_mainloop_start(int *m) {
  empty_log("pa_threaded_mainloop_start: nothing to do\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"pa_threaded_mainloop_start: nothing to do\0A\00"
define i32 @pa_threaded_mainloop_start(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @empty_log(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"pa_threaded_mainloop_start: nothing to do\0A\00"
define i32 @pa_threaded_mainloop_start(i32* nocapture readnone %0) {
%2 = tail call i32 @empty_log(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strrchr(const char *str, int character) {
  char val = (char)character;
  size_t i = 0;
  char *last = NULL;
  do {
    if (str[i] == val) {
      last = (char *)str + i;
    }
  } while (str[i++] != '\0');
  return last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <strrchr+0x45>
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114a <strrchr+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1121 <strrchr+0x21>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ 0, %2 ], [ %13, %5 ]
%7 = phi i8* [ null, %2 ], [ %12, %5 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %4, %10
%12 = select i1 %11, i8* %8, i8* %7
%13 = add i64 %6, 1
%14 = icmp eq i8 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5
ret i8* %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_y_root(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->y_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_y_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonPressedEvent_y_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dumpdata(void *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ dumpzero(int, int /*<<< orphan*/ *);
void dumpdataa(void *addr, int len, FILE *f) {
  dumpdata(addr, len, f);
  if ((len & 15) != 0) {
    dumpzero(16 - (len & 15), f);
  }
}


x86 assembly (clang, -O0):
<dumpdataa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <dumpdata@plt>
mov    -0xc(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     1168 <dumpdataa+0x48>
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    $0x10,%edi
sub    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1030 <dumpzero@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpdataa>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <dumpdata@plt>
and    $0xf,%ebp
je     1147 <dumpdataa+0x27>
mov    $0x10,%edi
sub    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <dumpzero@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dumpdataa(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @dumpdata(i8* %0, i32 %1, i32* %2)
%5 = and i32 %1, 15
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = sub nuw nsw i32 16, %5
%9 = tail call i32 @dumpzero(i32 %8, i32* %2)
br label %10
10: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *gmtime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time() {
  char *str;
  time_t tclock;
  struct tm *gmt;
  tclock = time(NULL);
  gmt = gmtime(&tclock);
  str = asctime(gmt);
  str[strlen(str) - 1] = 0;
  return str;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1060 <gmtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @get_time() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @gmtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i8* @asctime(%struct.tm* %6)
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = load i8*, i8** %1
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
f() {
  int i = 0;
  while (1) {
    printf("in f (%d)\n", i++);
    usleep(1000000);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
jmp    112f <f+0xf>

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xed4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1040 <usleep@plt>
mov    %ebp,%esi
jmp    1130 <f+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"in f (%d)\0A\00"
define i32 @f() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @usleep(i32 1000000)
br label %2
}

LLVM IR (-O2):
@.str = [11 x i8] c"in f (%d)\0A\00"
define i32 @f() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @usleep(i32 1000000)
br label %1
}
/* Variables and functions */
int parse(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) { return -parse(stdin); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <parse@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <parse@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @parse(i32 %2)
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @parse(i32 %1)
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testsingle() {
  int a = 0;
  int *pa = &a;
  printf("a = %d, *pa = %d\n", a, *pa);
  *pa = 2;
  printf("a = %d, *pa = %d\n", a, *pa);
}


x86 assembly (clang, -O0):
<testsingle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testsingle>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"a = %d, *pa = %d\0A\00"
define void @testsingle() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
ret void
}
long long *ann(long long n) {}


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

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

LLVM IR (-O0):
define i64* @ann(i64 %0) {
%2 = alloca i64*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64*, i64** %2
ret i64* %4
}

LLVM IR (-O2):
define noalias i64* @ann(i64 %0) {
ret i64* undef
}
/* Variables and functions */
unsigned char __VERIFIER_nondet_char();
int main() {
  unsigned char a = __VERIFIER_nondet_char();
  unsigned char b = __VERIFIER_nondet_char();
  a = a | 1;
  b = b | 1;
  a = a << 7;
  b = b << 7;
  if (a == 0) {
    goto ERROR;
  }
  if (a != b) {
  ERROR:
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_char@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_char@plt>
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x5(%rbp)
movzbl -0x6(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x7,%eax
mov    %al,-0x5(%rbp)
movzbl -0x6(%rbp),%eax
shl    $0x7,%eax
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    116d <main+0x5d>
jmp    1182 <main+0x72>
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
je     1189 <main+0x79>
jmp    1182 <main+0x72>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call zeroext i8 (...) @__VERIFIER_nondet_char()
store i8 %4, i8* %2
%5 = call zeroext i8 (...) @__VERIFIER_nondet_char()
store i8 %5, i8* %3
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = or i32 %7, 1
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = or i32 %11, 1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 7
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 7
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i8, i8* %2
%23 = zext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %0
br label %33
26: ; preds = %0
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = icmp ne i32 %28, %30
br i1 %31, label %32, label %34
32: ; preds = %26
br label %33
33: ; preds = %32, %25
store i32 -1, i32* %1
br label %34
34: ; preds = %33, %26
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call zeroext i8 (...) @__VERIFIER_nondet_char()
%2 = tail call zeroext i8 (...) @__VERIFIER_nondet_char()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VgaTerminalPut(char);
int putchar(int character) {
  VgaTerminalPut((char)character);
  return character;
}


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

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
movsbl %bl,%edi
call   1030 <VgaTerminalPut@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @VgaTerminalPut(i8 signext %2)
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ insert_performance();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void performance_tests() {
  time_t start, end;
  time(&start);
  sleep(2);
  time(&end);
  printf("Diff: %lf\n", difftime(end, start));
  insert_performance();
}


x86 assembly (clang, -O0):
<performance_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1060 <time@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
lea    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <difftime@plt>
mov    %eax,%esi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <insert_performance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<performance_tests>:
push   %rax
lea    0x4(%rsp),%rdi
call   1060 <time@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
mov    %rsp,%rdi
call   1060 <time@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1050 <difftime@plt>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <insert_performance@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Diff: %lf\0A\00"
define void @performance_tests() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @time(i32* %1)
%4 = call i32 @sleep(i32 2)
%5 = call i32 @time(i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @difftime(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @insert_performance()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Diff: %lf\0A\00"
define void @performance_tests() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @time(i32* %1)
%6 = call i32 @sleep(i32 2)
%7 = call i32 @time(i32* %2)
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 @difftime(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @insert_performance()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int f_scalar_stack_1(int32_t a, int64_t b, int32_t c, double d, long double e,
                     uint8_t f, int8_t g, uint8_t h) {
  return g + h;
}


x86 assembly (clang, -O0):
<f_scalar_stack_1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
fstpt  -0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %r8d,-0x38(%rbp)
mov    %r9d,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_scalar_stack_1>:
lea    (%r8,%r9,1),%eax
ret

LLVM IR (-O0):
define i32 @f_scalar_stack_1(i32 %0, i32 %1, i32 %2, double %3, x86_fp80 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca x86_fp80
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store double %3, double* %12
store x86_fp80 %4, x86_fp80* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %15
%18 = load i32, i32* %16
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f_scalar_stack_1(i32 %0, i32 %1, i32 %2, double %3, x86_fp80 %4, i32 %5, i32 %6, i32 %7) {
%9 = add nsw i32 %7, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void usart_puts(int fd, char *s) { write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<usart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_puts>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @usart_puts(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @usart_puts(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
struct sha256 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha256_sum(struct sha256 *, unsigned char *);
int SHA256_Final(unsigned char *md, struct sha256 *s) {
  sha256_sum(s, md);
  return 1;
}


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

x86 assembly (clang, -O2):
<SHA256_Final>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <sha256_sum@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sha256 = type { i32 }
define i32 @SHA256_Final(i8* %0, %struct.sha256* %1) {
%3 = alloca i8*
%4 = alloca %struct.sha256*
store i8* %0, i8** %3
store %struct.sha256* %1, %struct.sha256** %4
%5 = load %struct.sha256*, %struct.sha256** %4
%6 = load i8*, i8** %3
%7 = call i32 @sha256_sum(%struct.sha256* %5, i8* %6)
ret i32 1
}

LLVM IR (-O2):
%struct.sha256 = type { i32 }
define i32 @SHA256_Final(i8* %0, %struct.sha256* %1) {
%3 = tail call i32 @sha256_sum(%struct.sha256* %1, i8* %0)
ret i32 1
}