xunge/DecIR huggingface dataset:
int isPrimer(int a) {
  int i = 2;
  for (; i < a; i++) {
    if (a % i == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isPrimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrimer+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrimer+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <isPrimer+0x50>
jmp    113b <isPrimer+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrimer+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimer>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <isPrimer+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrimer+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrimer+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrimer(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
int main() {
  __asm__(".p2align 4");
  __asm__(".p2align 4, 0");
  __asm__(".p2align 4, 0, 99");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect ".p2align 4", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect ".p2align 4, 0", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect ".p2align 4, 0, 99", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ winsh0(int, int);
int winsh(int x, int y) {
  move(x * 2 - 2, y - 1);
  winsh0(x, y);
}


x86 assembly (clang, -O0):
<winsh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
sub    $0x2,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <move@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <winsh0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<winsh>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%edi
add    $0xfffffffe,%edi
lea    -0x1(%r14),%esi
call   1040 <move@plt>
mov    %ebx,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <winsh0@plt>

LLVM IR (-O0):
define i32 @winsh(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 2
%8 = sub nsw i32 %7, 2
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @move(i32 %8, i32 %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @winsh0(i32 %12, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @winsh(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, -2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @move(i32 %4, i32 %5)
%7 = tail call i32 @winsh0(i32 %0, i32 %1)
ret i32 undef
}
int ehnlc_isdigit(int c) { return (c >= '0' && c <= '9') ? 2048 : 0; }


x86 assembly (clang, -O0):
<ehnlc_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ehnlc_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x800,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
shl    $0xb,%eax
ret

LLVM IR (-O0):
define i32 @ehnlc_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 2048, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ehnlc_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 2048, i32 0
ret i32 %4
}
int omap_mux_config(const char *group) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_mux_config(i8* nocapture readnone %0) {
ret i32 0
}
void default_layer_debug(void) { ; }


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

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

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

LLVM IR (-O2):
define void @default_layer_debug() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeVertice(void *v) { free(v); }


x86 assembly (clang, -O0):
<freeVertice>:
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):
<freeVertice>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeVertice(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 @freeVertice(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int menu() {
  int opc;
  printf("\nEscolha uma opção: ");
  printf("\n1 - Diagonal principal");
  printf("\n2 - Diagonal secundaria");
  printf("\n0 - Fim");
  scanf("%d", &opc);
  return opc;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AEscolha uma op\C3\A7\C3\A3o: \00"
@.str.1 = [24 x i8] c"\0A1 - Diagonal principal\00"
@.str.2 = [25 x i8] c"\0A2 - Diagonal secundaria\00"
@.str.3 = [9 x i8] c"\0A0 - Fim\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AEscolha uma op\C3\A7\C3\A3o: \00"
@.str.1 = [24 x i8] c"\0A1 - Diagonal principal\00"
@.str.2 = [25 x i8] c"\0A2 - Diagonal secundaria\00"
@.str.3 = [9 x i8] c"\0A0 - Fim\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
ret i32 %8
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

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


x86 assembly (clang, -O0):
<get_milliseconds>:
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
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @get_milliseconds() {
%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
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @get_milliseconds() {
%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
%11 = sext i32 %10 to i64
ret i64 %11
}
int uchar2int(char c) { return (int)c - 0x30; }


x86 assembly (clang, -O0):
<uchar2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uchar2int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @uchar2int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @uchar2int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x1b() {
  Assert_real((isprint(27) == 0),
              "/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_isprint.c",
              140, ("isprint should be 0 for 0x1b"));
}


x86 assembly (clang, -O0):
<t_isprint_0x1b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x8c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x8c,%edx
pop    %rax
jmp    1040 <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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x1b\00"
define void @t_isprint_0x1b() {
%1 = call i64 @isprint(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x1b\00"
define void @t_isprint_0x1b() {
%1 = tail call i64 @isprint(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ stl_le_p(int /*<<< orphan*/ *, int);
void stq_le_p(void *ptr, uint64_t v) {
  uint8_t *p = ptr;
  stl_le_p(p, (uint32_t)v);
  stl_le_p(p + 4, v >> 32);
}


x86 assembly (clang, -O0):
<stq_le_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <stl_le_p@plt>
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <stl_le_p@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stq_le_p>:
push   %rbx
mov    %rdi,%rbx
call   1030 <stl_le_p@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <stl_le_p@plt>

LLVM IR (-O0):
define void @stq_le_p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = call i32 @stl_le_p(i32* %8, i32 %9)
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %4
%14 = ashr i32 %13, 32
%15 = call i32 @stl_le_p(i32* %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @stq_le_p(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @stl_le_p(i32* %3, i32 %1)
%5 = getelementptr inbounds i8, i8* %0, i64 16
%6 = bitcast i8* %5 to i32*
%7 = tail call i32 @stl_le_p(i32* %6, i32 poison)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
unsigned char *dh_compute_public_key(unsigned char *pub, size_t pub_size,
                                     const unsigned char *priv,
                                     size_t priv_size) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<dh_compute_public_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dh_compute_public_key>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @dh_compute_public_key(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @dh_compute_public_key(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *std_realloc(void *ptr, size_t size) {
  void *p;
  if ((p = realloc(ptr, size)) == NULL) {
    perror("realloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<std_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <std_realloc+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_realloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <std_realloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @std_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
void stack_dispose(struct stack *stack) { free(stack); }


x86 assembly (clang, -O0):
<stack_dispose>:
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):
<stack_dispose>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @stack_dispose(%struct.stack* nocapture %0) {
%2 = tail call i32 @free(%struct.stack* %0)
ret void
}
/* Variables and functions */
size_t my_strnlen(char const *string, int size) {
  register size_t length;
  for (length = 0; length < size; length += 1)
    if (*string++ == '\0')
      break;
  return length;
}


x86 assembly (clang, -O0):
<my_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jae    115a <my_strnlen+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1144 <my_strnlen+0x44>
jmp    115a <my_strnlen+0x5a>
jmp    1149 <my_strnlen+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <my_strnlen+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strnlen>:
test   %esi,%esi
je     1123 <my_strnlen+0x23>
movslq %esi,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <my_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <my_strnlen+0x10>
mov    %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @my_strnlen(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ %13, %11 ], [ 0, %4 ]
%8 = phi i8* [ %12, %11 ], [ %0, %4 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = add nuw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %2
%16 = phi i64 [ 0, %2 ], [ %7, %6 ], [ %5, %11 ]
ret i64 %16
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_size(const char *filename) {
  struct stat file_stat;
  return stat(filename, &file_stat) == 0 ? file_stat.st_size : -1;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <file_size+0x2e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114b <file_size+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <file_size+0x3b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = phi i32 [ %9, %7 ], [ -1, %10 ]
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
const char *decNumberVersion(void) { return "decNumber 3.36"; }


x86 assembly (clang, -O0):
<decNumberVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decNumberVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"decNumber 3.36\00"
define i8* @decNumberVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"decNumber 3.36\00"
define i8* @decNumberVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void j(uint32_t *pc, uint32_t kte) {
  kte = kte << 2;
  *pc = kte;
}


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

x86 assembly (clang, -O2):
<j>:
shl    $0x2,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @j(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 = shl i32 %5, 2
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32*, i32** %3
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @j(i32* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 2
store i32 %3, i32* %0
ret void
}
int enclave_stat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_stat() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pass(void *, char *);
void makeCallback(void *callback) { pass(callback, "Callback called\n"); }


x86 assembly (clang, -O0):
<makeCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeCallback>:
lea    0xee9(%rip),%rsi
jmp    1030 <pass@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Callback called\0A\00"
define void @makeCallback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pass(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Callback called\0A\00"
define void @makeCallback(i8* %0) {
%2 = tail call i32 @pass(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ cmpxchg_64(int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/);
void *cmpxchg_ptr(void *p, void *old, void *new) {
  return (void *)cmpxchg_64((uint64_t *)p, (uint64_t)old, (uint64_t) new);
}


x86 assembly (clang, -O0):
<cmpxchg_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <cmpxchg_64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpxchg_ptr>:
jmp    1030 <cmpxchg_64@plt>

LLVM IR (-O0):
define i8* @cmpxchg_ptr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i32
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i32
%13 = call i64 @cmpxchg_64(i32* %8, i32 %10, i32 %12)
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @cmpxchg_ptr(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i32*
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = ptrtoint i8* %2 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i64 @cmpxchg_64(i32* %4, i32 %6, i32 %8)
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
void map2check_binop_sub_uint(unsigned param1, unsigned param2, unsigned line,
                              unsigned scope, char *function_name) {}


x86 assembly (clang, -O0):
<map2check_binop_sub_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @map2check_binop_sub_uint(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
unsigned int ld4(char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<ld4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld4>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movsbl 0x1(%rdi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x8,%edx
movsbl 0x3(%rdi),%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ld4(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ld4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = shl nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int unlink(char const *);
int pidfile_remove(const char *pidfile) { return unlink(pidfile); }


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

x86 assembly (clang, -O2):
<pidfile_remove>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @pidfile_remove(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isFSUB(const char *comm) { return strcmp(comm, "fsub") == 0; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"fsub\00"
define i32 @isFSUB(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int main() {
  double i = 1.234;
  int j1 = 5;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 1.234000e+00, double* %2
store i32 5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void cprop_test10(int *data) {
  int j = 1;
  if (j)
    j = 10;
  else
    j = data[0];
  data[0] = j * 21 + data[1];
}


x86 assembly (clang, -O0):
<cprop_test10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1125 <cprop_test10+0x25>
movl   $0xa,-0xc(%rbp)
jmp    112e <cprop_test10+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
imul   $0x15,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test10>:
mov    $0xd2,%eax
add    0x4(%rdi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_test10(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 210
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *mystrdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <mystrdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <mystrdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
int isascii(c)
int c;
{ return (((c) & ~0x7F) == 0); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -128
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ exp(float);
float log(scalar_t__);
float flogadd(float V, float lp) {
  if (lp > V) {
    float t = lp;
    lp = V;
    V = t;
  }
  return V + log(1.0 + exp(lp - V));
}


x86 assembly (clang, -O0):
<flogadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    115f <flogadd+0x3f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe7b(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flogadd>:
push   %rax
movaps %xmm0,%xmm2
minss  %xmm1,%xmm2
maxss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
subss  %xmm1,%xmm2
movaps %xmm2,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeb2(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <log@plt>
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @flogadd(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %5
%11 = load float, float* %3
store float %11, float* %4
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %9, %2
%14 = load float, float* %3
%15 = load float, float* %4
%16 = load float, float* %3
%17 = fsub float %15, %16
%18 = call i64 @exp(float %17)
%19 = sitofp i64 %18 to double
%20 = fadd double 1.000000e+00, %19
%21 = fptosi double %20 to i64
%22 = call float @log(i64 %21)
%23 = fadd float %14, %22
ret float %23
}

LLVM IR (-O2):
define float @flogadd(float %0, float %1) {
%3 = fcmp ogt float %1, %0
%4 = select i1 %3, float %0, float %1
%5 = select i1 %3, float %1, float %0
%6 = fsub float %4, %5
%7 = tail call i64 @exp(float %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fptosi double %9 to i64
%11 = tail call float @log(i64 %10)
%12 = fadd float %5, %11
ret float %12
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
char *perflite_rdtsc();
uint64_t perflite_rdtsc_sync(void) {
  uint64_t t;
  asm volatile("mfence" ::: "memory");
  t = perflite_rdtsc();
  asm volatile("mfence" ::: "memory");
  return t;
}


x86 assembly (clang, -O0):
<perflite_rdtsc_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mfence
mov    $0x0,%al
call   1030 <perflite_rdtsc@plt>
mov    %rax,-0x8(%rbp)
mfence
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @perflite_rdtsc_sync() {
%1 = alloca i8*
%2 = call i8* (...) @perflite_rdtsc()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @perflite_rdtsc_sync() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i8* (...) @perflite_rdtsc()
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_20(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x51AE2B42;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x51ae2b42,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_20>:
xor    $0x51ae2b42,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_20(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 1370368834
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_20(i32 %0, i32 %1) {
%3 = xor i32 %0, 1370368834
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
void test(void) {}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
void vnum_result9(int *data) {
  int i = data[0];
  int j = data[1];
  if (i == j)
    data[2] = 0;
  else
    data[2] = i + j;
}


x86 assembly (clang, -O0):
<vnum_result9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1137 <vnum_result9+0x37>
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
jmp    1144 <vnum_result9+0x44>
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_result9>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rcx,%rax,1),%edx
xor    %esi,%esi
cmp    %ecx,%eax
cmovne %edx,%esi
mov    %esi,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @vnum_result9(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp eq i32 %2, %4
%6 = add nsw i32 %4, %2
%7 = select i1 %5, i32 0, i32 %6
%8 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %7, i32* %8
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
double int2double_time(uint32_t seconds, uint32_t useconds) {
  double value;
  value = (double)seconds + (double)useconds / 1000000;
  return value;
}


x86 assembly (clang, -O0):
<int2double_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2double_time>:
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @int2double_time(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @int2double_time(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %5, %3
ret double %6
}
int do_374() { return 374; }


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

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

LLVM IR (-O0):
define i32 @do_374() {
ret i32 374
}

LLVM IR (-O2):
define i32 @do_374() {
ret i32 374
}
int min_from_two(int x, int y) {
  int __uni220;
  if (x < y) {
    __uni220 = x;
  } else {
    __uni220 = y;
  }
  return __uni220;
}


x86 assembly (clang, -O0):
<min_from_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min_from_two+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_from_two+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min_from_two(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void bit_clear32(volatile uint32_t *ptr, uint8_t bit) {
  *((volatile uint32_t *)(((uintptr_t)ptr) | (1 << 26))) =
      (uint32_t)(~(1ul << bit));
}


x86 assembly (clang, -O0):
<bit_clear32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
or     $0x4000000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_clear32>:
mov    %rsi,%rcx
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
or     $0x4000000,%rdi
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_clear32(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = xor i64 %6, -1
%8 = load i64*, i64** %3
%9 = ptrtoint i64* %8 to i64
%10 = or i64 %9, 67108864
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @bit_clear32(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = xor i64 %3, -1
%5 = ptrtoint i64* %0 to i64
%6 = or i64 %5, 67108864
%7 = inttoptr i64 %6 to i64*
store volatile i64 %4, i64* %7
ret void
}