xunge/DecIR huggingface dataset:
void binario(int num, int reg[], int i) {
  int aux;
  if (num == 0)
    return;
  aux = num % 2;
  num = num / 2;
  reg[i] = aux;
  i++;
  binario(num, reg, i);
}


x86 assembly (clang, -O0):
<binario>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <binario+0x21>
jmp    1173 <binario+0x63>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <binario@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binario>:
test   %edi,%edi
je     1132 <binario+0x32>
movslq %edx,%rax
lea    (%rsi,%rax,4),%rax
nopl   0x0(%rax,%rax,1)
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
mov    %ecx,%edx
sar    %edx
and    $0xfffffffe,%ecx
mov    %edi,%esi
sub    %ecx,%esi
mov    %esi,(%rax)
add    $0x1,%edi
add    $0x4,%rax
cmp    $0x2,%edi
mov    %edx,%edi
ja     1110 <binario+0x10>
ret

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

LLVM IR (-O2):
define void @binario(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %13, %7 ]
%9 = phi i32 [ %0, %5 ], [ %11, %7 ]
%10 = srem i32 %9, 2
%11 = sdiv i32 %9, 2
%12 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %10, i32* %12
%13 = add i64 %8, 1
%14 = add i32 %9, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %7
16: ; preds = %7, %3
ret void
}
int test_imm_46int8_mem(signed char *val) {
  return ((*val) & (-0x46 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_46int8_mem>:
testb  $0xba,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int **func3(void) { return (int **)0; }


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

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

LLVM IR (-O0):
define i32** @func3() {
ret i32** null
}

LLVM IR (-O2):
define noalias i32** @func3() {
ret i32** null
}
void test1_ModFix_markUsed__E() {}


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

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

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

LLVM IR (-O2):
define void @test1_ModFix_markUsed__E() {
ret void
}
int main() {
  int i = 0;
  int sum = 0;
  while (i++ < 100) {
    if (i % 2 == 0) {
      continue;
    }
    if (i >= 50) {
      break;
    }
    sum++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x64,%eax
jge    1163 <main+0x63>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1146 <main+0x46>
jmp    1119 <main+0x19>
cmpl   $0x32,-0x8(%rbp)
jl     1155 <main+0x55>
jmp    1163 <main+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
xor    %eax,%eax
mov    %edx,%ecx
neg    %ecx
add    $0x1,%edx
nopl   0x0(%rax,%rax,1)
cmp    $0xffffff9c,%ecx
je     1136 <main+0x36>
add    $0xffffffff,%ecx
mov    %edx,%esi
add    $0x1,%esi
test   $0x1,%dl
mov    %esi,%edx
je     1110 <main+0x10>
mov    %ecx,%edx
not    %edx
cmp    $0x30,%edx
jg     1136 <main+0x36>
neg    %ecx
add    $0x1,%eax
mov    %ecx,%edx
jmp    1106 <main+0x6>
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %13, %0
%2 = phi i32 [ %6, %13 ], [ 0, %0 ]
%3 = phi i32 [ %14, %13 ], [ 0, %0 ]
br label %4
4: ; preds = %1, %8
%5 = phi i32 [ %6, %8 ], [ %2, %1 ]
%6 = add i32 %5, 1
%7 = icmp eq i32 %5, 100
br i1 %7, label %15, label %8
8: ; preds = %4
%9 = and i32 %6, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %8
%12 = icmp sgt i32 %5, 48
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = add nuw nsw i32 %3, 1
br label %1
15: ; preds = %11, %4
ret i32 %3
}
unsigned int osmo_pbit_bytesize(unsigned int num_bits) {
  unsigned int pbit_bytesize = num_bits / 8;
  if (num_bits % 8)
    pbit_bytesize++;
  return pbit_bytesize;
}


x86 assembly (clang, -O0):
<osmo_pbit_bytesize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
je     1128 <osmo_pbit_bytesize+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osmo_pbit_bytesize>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0x7,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @osmo_pbit_bytesize(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %0, 7
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
ret i32 %6
}
/* Variables and functions */
int booster_fxstat64(int, int, void *);
int __fxstat64(int ver, int fd, void *buf) {
  return booster_fxstat64(ver, fd, buf);
}


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

x86 assembly (clang, -O2):
<__fxstat64>:
jmp    1030 <booster_fxstat64@plt>

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

LLVM IR (-O2):
define i32 @__fxstat64(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @booster_fxstat64(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_EMT(int /*<<< orphan*/);
int gen_EMT() {
  handle_EMT(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_EMT>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_EMT@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_EMT() {
%1 = call i32 @handle_EMT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_EMT() {
%1 = tail call i32 @handle_EMT(i32 0)
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned SDL_GetTicks() {
  struct timeval t;
  gettimeofday(&t, 0);
  return (t.tv_sec * 1000) + (t.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<SDL_GetTicks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_GetTicks>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @SDL_GetTicks() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @SDL_GetTicks() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
int vde_chain_nm6_alloc(void **mem, const int *idata, const double *rdata) {
  if (mem)
    *mem = 0;
  (void)idata;
  (void)rdata;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm6_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <vde_chain_nm6_alloc+0x26>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm6_alloc>:
test   %rdi,%rdi
je     110c <vde_chain_nm6_alloc+0xc>
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm6_alloc(i8** writeonly %0, i32* nocapture readnone %1, double* nocapture readnone %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* null, i8** %0
br label %6
6: ; preds = %5, %3
ret i32 0
}
int fromHex(char c) {
  if (c < '0' || (c > '9' && (c < 'a' || c > 'f'))) {
    return -1;
  }
  if (c <= '9') {
    return c - '0';
  }
  return c - 'a' + 10;
}


x86 assembly (clang, -O0):
<fromHex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     113e <fromHex+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    114a <fromHex+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <fromHex+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    114a <fromHex+0x4a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <fromHex+0x73>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1166 <fromHex+0x66>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <fromHex+0x73>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromHex>:
mov    $0xffffffff,%eax
cmp    $0x30,%dil
jl     1119 <fromHex+0x19>
cmp    $0x3a,%dil
jb     111a <fromHex+0x1a>
lea    -0x67(%rdi),%ecx
cmp    $0xfa,%cl
jae    111a <fromHex+0x1a>
ret
cmp    $0x39,%dil
ja     1126 <fromHex+0x26>
add    $0xffffffd0,%edi
mov    %edi,%eax
ret
add    $0xffffffa9,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fromHex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 48
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 57
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 97
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 102
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %1
store i32 -1, i32* %2
br label %33
20: ; preds = %15, %7
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 57
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %2
br label %33
28: ; preds = %20
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 97
%32 = add nsw i32 %31, 10
store i32 %32, i32* %2
br label %33
33: ; preds = %28, %24, %19
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @fromHex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 48
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = icmp ugt i8 %0, 57
%6 = add nsw i8 %0, -103
%7 = icmp ult i8 %6, -6
%8 = and i1 %5, %7
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = icmp ult i8 %0, 58
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nsw i32 %2, -48
br label %15
13: ; preds = %9
%14 = add nsw i32 %2, -87
br label %15
15: ; preds = %1, %4, %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ], [ -1, %4 ], [ -1, %1 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wchgat(int /*<<< orphan*/ *, int, int /*<<< orphan*/, short, void const *);
int __darwin_wchgat(WINDOW *w, int i, uint32_t a, short s, const void *p) {
  return wchgat(w, i, a, s, p);
}


x86 assembly (clang, -O0):
<__darwin_wchgat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x12(%rbp),%ax
mov    -0x20(%rbp),%r8
movswl %ax,%ecx
call   1030 <wchgat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwin_wchgat>:
jmp    1030 <wchgat@plt>

LLVM IR (-O0):
define i32 @__darwin_wchgat(i32* %0, i32 %1, i32 %2, i16 signext %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i16
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i16 %3, i16* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i16, i16* %9
%15 = load i8*, i8** %10
%16 = call i32 @wchgat(i32* %11, i32 %12, i32 %13, i16 signext %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @__darwin_wchgat(i32* %0, i32 %1, i32 %2, i16 signext %3, i8* %4) {
%6 = tail call i32 @wchgat(i32* %0, i32 %1, i32 %2, i16 signext %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cursor_invisible;
int /*<<< orphan*/ tty_putp(int /*<<< orphan*/);
void tty_hide_cursor() { tty_putp(cursor_invisible); }


x86 assembly (clang, -O0):
<tty_hide_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <tty_putp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_hide_cursor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <tty_putp@plt>

LLVM IR (-O0):
@cursor_invisible = global i32 0
define void @tty_hide_cursor() {
%1 = load i32, i32* @cursor_invisible
%2 = call i32 @tty_putp(i32 %1)
ret void
}

LLVM IR (-O2):
@cursor_invisible = global i32 0
define void @tty_hide_cursor() {
%1 = load i32, i32* @cursor_invisible
%2 = tail call i32 @tty_putp(i32 %1)
ret void
}
void callee(int **ptr, int *g) { *ptr = g; }


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

x86 assembly (clang, -O2):
<callee>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @callee(i32** nocapture writeonly %0, i32* %1) {
store i32* %1, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GLCD_WindowMax();
int /*<<< orphan*/ wr_cmd(int);
int /*<<< orphan*/ wr_dat_only(unsigned short);
int /*<<< orphan*/ wr_dat_start();
int /*<<< orphan*/ wr_dat_stop();
void GLCD_Clear(unsigned short color) {
  unsigned int i;
  GLCD_WindowMax();
  wr_cmd(0x22);
  wr_dat_start();
  for (i = 0; i < (320 * 240); i++)
    wr_dat_only(color);
  wr_dat_stop();
}


x86 assembly (clang, -O0):
<GLCD_Clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1040 <GLCD_WindowMax@plt>
mov    $0x22,%edi
call   1060 <wr_cmd@plt>
mov    $0x0,%al
call   1050 <wr_dat_start@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x12c00,-0x8(%rbp)
jae    11a2 <GLCD_Clear+0x52>
movzwl -0x2(%rbp),%edi
call   1030 <wr_dat_only@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <GLCD_Clear+0x2e>
mov    $0x0,%al
call   1070 <wr_dat_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLCD_Clear>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <GLCD_WindowMax@plt>
mov    $0x22,%edi
call   1060 <wr_cmd@plt>
xor    %eax,%eax
call   1050 <wr_dat_start@plt>
mov    $0x12c00,%ebp
movzwl %bx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <wr_dat_only@plt>
add    $0xffffffff,%ebp
jne    1180 <GLCD_Clear+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <wr_dat_stop@plt>

LLVM IR (-O0):
define void @GLCD_Clear(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = call i32 (...) @GLCD_WindowMax()
%5 = call i32 @wr_cmd(i32 34)
%6 = call i32 (...) @wr_dat_start()
store i32 0, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 76800
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i16, i16* %2
%12 = call i32 @wr_dat_only(i16 zeroext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
%17 = call i32 (...) @wr_dat_stop()
ret void
}

LLVM IR (-O2):
define void @GLCD_Clear(i16 zeroext %0) {
%2 = tail call i32 (...) @GLCD_WindowMax()
%3 = tail call i32 @wr_cmd(i32 34)
%4 = tail call i32 (...) @wr_dat_start()
br label %5
5: ; preds = %1, %5
%6 = phi i32 [ 0, %1 ], [ %8, %5 ]
%7 = tail call i32 @wr_dat_only(i16 zeroext %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, 76800
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = tail call i32 (...) @wr_dat_stop()
ret void
}
void update_display(void) {}


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

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

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

LLVM IR (-O2):
define void @update_display() {
ret void
}
int memoized_cut_rod_solution(int *p, int size_p, int rod_length, int *maxPrice,
                              int *solution) {
  return 0;
}


x86 assembly (clang, -O0):
<memoized_cut_rod_solution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @memoized_cut_rod_solution(i32* %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @memoized_cut_rod_solution(i32* nocapture readnone %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dealloc_double(void *elem) { free(elem); }


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

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

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

LLVM IR (-O2):
define void @dealloc_double(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int variable_character(char c) {
  return c == '_' || (('A') <= (c) && (c) <= ('Z')) ||
         (('a') <= (c) && (c) <= ('z')) || (('0') <= (c) && (c) <= ('9'));
}


x86 assembly (clang, -O0):
<variable_character>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     118b <variable_character+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     113f <variable_character+0x3f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    118b <variable_character+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1162 <variable_character+0x62>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    118b <variable_character+0x8b>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x3(%rbp)
jg     1185 <variable_character+0x85>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variable_character>:
cmp    $0x5f,%dil
sete   %al
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
setb   %cl
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @variable_character(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 95
br i1 %5, label %32, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 65, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 90
br i1 %13, label %32, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 97, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %32, label %22
22: ; preds = %18, %14
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 48, %24
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 57
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ false, %22 ], [ %29, %26 ]
br label %32
32: ; preds = %30, %18, %10, %1
%33 = phi i1 [ true, %18 ], [ true, %10 ], [ true, %1 ], [ %31, %30 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @variable_character(i8 signext %0) {
%2 = icmp eq i8 %0, 95
%3 = and i8 %0, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %2, %5
%7 = add i8 %0, -48
%8 = icmp ult i8 %7, 10
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
int is_func(char *s, int len, int (*func)(int)) {
  char *p = s;
  for (; len >= 0; p++, len--)
    if (!func(*(unsigned char *)p))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1166 <is_func+0x66>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
jne    1147 <is_func+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_func+0x6d>
jmp    114c <is_func+0x4c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <is_func+0x1b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
test   %esi,%esi
js     113a <is_func+0x3a>
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nopl   0x0(%rax)
movzbl (%rbx),%edi
call   *%r15
test   %eax,%eax
je     1137 <is_func+0x37>
add    $0x1,%rbx
add    $0xffffffff,%ebp
test   %ebp,%ebp
jg     1120 <is_func+0x20>
jmp    113a <is_func+0x3a>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_func(i8* nocapture %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %16
5: ; preds = %3, %12
%6 = phi i8* [ %13, %12 ], [ %0, %3 ]
%7 = phi i32 [ %14, %12 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 %2(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = add nsw i32 %7, -1
%15 = icmp sgt i32 %7, 0
br i1 %15, label %5, label %16
16: ; preds = %5, %12, %3
%17 = phi i32 [ 1, %3 ], [ 1, %12 ], [ 0, %5 ]
ret i32 %17
}
/* Variables and functions */
float fastexp(float);
float fasttanh(float p) { return -1.0f + 2.0f / (1.0f + fastexp(-2.0f * p)); }


x86 assembly (clang, -O0):
<fasttanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <fastexp@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xebe(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0xeae(%rip),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasttanh>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <fastexp@plt>
addss  0xede(%rip),%xmm0
movss  0xeda(%rip),%xmm1
divss  %xmm0,%xmm1
addss  0xed2(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fasttanh(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float -2.000000e+00, %3
%5 = call float @fastexp(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 2.000000e+00, %6
%8 = fadd float -1.000000e+00, %7
ret float %8
}

LLVM IR (-O2):
define float @fasttanh(float %0) {
%2 = fmul float %0, -2.000000e+00
%3 = tail call float @fastexp(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 2.000000e+00, %4
%6 = fadd float %5, -1.000000e+00
ret float %6
}
void __pthread_register_cancel_2(struct __ptcb *__cb) {
  __asm__ __volatile__("call __pthread_register_cancel"
                       :
                       : "a"(__cb)
                       : "ecx", "edx", "memory");
}


x86 assembly (clang, -O0):
<__pthread_register_cancel_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   1030 <__pthread_register_cancel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_register_cancel_2>:
mov    %rdi,%rax
call   1030 <__pthread_register_cancel@plt>
ret

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

LLVM IR (-O2):
%struct.__ptcb = type opaque
define void @__pthread_register_cancel_2(%struct.__ptcb* %0) {
tail call void asm sideeffect "call __pthread_register_cancel", "{ax},~{ecx},~{edx},~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.__ptcb* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void setInUse(uint64_t *guard_object) { ((uint8_t *)guard_object)[1] = 1; }


x86 assembly (clang, -O0):
<setInUse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setInUse>:
movl   $0x1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @setInUse(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @setInUse(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 1, i32* %2
ret void
}
int is_space(char c) {
  return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_space+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
ja     1120 <is_space+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <is_space+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void foo648(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo648(i32 %0) {
ret void
}
int tgetflag(char *id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tgetflag(i8* nocapture readnone %0) {
ret i32 0
}
int target_initialise(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @target_initialise() {
ret i32 0
}
void process_sample(struct Ferret *ferret, ...) { ferret = (ferret); }


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

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

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

LLVM IR (-O2):
%struct.Ferret = type opaque
define void @process_sample(%struct.Ferret* nocapture %0, ...) {
ret void
}
void I420ToARGB1555() {}


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

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

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

LLVM IR (-O2):
define void @I420ToARGB1555() {
ret void
}
void vectorFPNop(double *a, double *b, double *c, int nsize) {
  int j;
  for (j = nsize; j > 0; j--) {
    a++;
    b++;
    c++;
  }
}


x86 assembly (clang, -O0):
<vectorFPNop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    1155 <vectorFPNop+0x55>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1119 <vectorFPNop+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vectorFPNop(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
size_t os_memrlen(const void *in_src, size_t in_max_len) {
  const unsigned char *const ptr = (const unsigned char *)in_src;
  size_t i;
  for (i = in_max_len; (i > 0) && (ptr[i - 1] == 0); --i) {
  }
  return (i);
}


x86 assembly (clang, -O0):
<os_memrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jbe    1145 <os_memrlen+0x45>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1155 <os_memrlen+0x55>
jmp    116b <os_memrlen+0x6b>
jmp    115a <os_memrlen+0x5a>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <os_memrlen+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_memrlen>:
mov    %rsi,%rax
sub    $0x1,%rsi
jb     1110 <os_memrlen+0x10>
cmpb   $0x0,-0x1(%rdi,%rax,1)
je     1100 <os_memrlen>
ret

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

LLVM IR (-O2):
define i64 @os_memrlen(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i64 [ %1, %2 ], [ %7, %6 ]
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = add i64 %4, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3, %6
ret i64 %4
}
void grid_alloc_term(void) {}


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

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

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

LLVM IR (-O2):
define void @grid_alloc_term() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
int main(void) {
  int letter;
  int endline;
  letter = 'a';
  endline = '\n';
  write(1, &letter, 1);
  write(1, &endline, 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    $0x1,%edx
lea    -0x8(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    -0xc(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x61,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 97, i32* %1
store i32 10, i32* %2
%5 = call i32 @write(i32 1, i32* %1, i32 1)
%6 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
int mkdirat(int, char const *, int /*<<< orphan*/);
int xmkdirat(int dirfd, const char *pathname, mode_t mode) {
  int ret = mkdirat(dirfd, pathname, mode);
  if (ret == -1 && errno != EEXIST) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmkdirat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <mkdirat@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    115d <xmkdirat+0x4d>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
je     115d <xmkdirat+0x4d>
jmp    115d <xmkdirat+0x4d>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmkdirat>:
jmp    1030 <mkdirat@plt>

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @xmkdirat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @mkdirat(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i64, i64* @errno
%16 = load i64, i64* @EEXIST
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
br label %19
19: ; preds = %18, %14, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @xmkdirat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @mkdirat(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void read_intermediate_forward_arrays_adios_(void) {}


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

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

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

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

/* Variables and functions */
int ENODEV;
int default_temperature_K(struct battery *b) { return -ENODEV; }


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

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

LLVM IR (-O0):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_temperature_K(%struct.battery* %0) {
%2 = alloca %struct.battery*
store %struct.battery* %0, %struct.battery** %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_temperature_K(%struct.battery* nocapture readnone %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}
short int get_size_of_double_(void) {
  double testdouble;
  short int size_of_double;
  size_of_double = sizeof(testdouble);
  return size_of_double;
}


x86 assembly (clang, -O0):
<get_size_of_double_>:
push   %rbp
mov    %rsp,%rbp
movw   $0x8,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size_of_double_>:
mov    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @get_size_of_double_() {
%1 = alloca double
%2 = alloca i16
store i16 8, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @get_size_of_double_() {
ret i16 8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x79() {
  Assert_real((isgraph(121)),
              "/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/ctype/test_isgraph.c",
              610, ("isgraph should be 1 for y"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x79>:
push   %rbp
mov    %rsp,%rbp
mov    $0x79,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x262,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x79>:
push   %rax
mov    $0x79,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x262,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for y\00"
define void @t_isgraph_0x79() {
%1 = call i32 @isgraph(i32 121)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for y\00"
define void @t_isgraph_0x79() {
%1 = tail call i32 @isgraph(i32 121)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}