xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SoundDriver_CD_Pause(int);
void CD_Pause(int pauseon) { SoundDriver_CD_Pause(pauseon); }


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

x86 assembly (clang, -O2):
<CD_Pause>:
jmp    1030 <SoundDriver_CD_Pause@plt>

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

LLVM IR (-O2):
define void @CD_Pause(i32 %0) {
%2 = tail call i32 @SoundDriver_CD_Pause(i32 %0)
ret void
}
/* Variables and functions */
int netadd(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", netadd(5, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <netadd@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <netadd@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @netadd(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int h264_start_code(unsigned char *p) {
  if (p[0] == 0 && p[1] == 0 && p[2] == 1) {
    return p[3] & 0x1F;
  }
  return 0;
}


x86 assembly (clang, -O0):
<h264_start_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    114d <h264_start_code+0x4d>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    114d <h264_start_code+0x4d>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x1,%eax
jne    114d <h264_start_code+0x4d>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <h264_start_code+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264_start_code>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1108 <h264_start_code+0x8>
ret
cmpb   $0x0,0x1(%rdi)
jne    1107 <h264_start_code+0x7>
cmpb   $0x1,0x2(%rdi)
jne    1107 <h264_start_code+0x7>
movzbl 0x3(%rdi),%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @h264_start_code(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = and i8 %14, 31
%16 = zext i8 %15 to i32
br label %17
17: ; preds = %1, %4, %8, %12
%18 = phi i32 [ %16, %12 ], [ 0, %8 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %18
}
void foo735() {}


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

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

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

LLVM IR (-O2):
define void @foo735() {
ret void
}
unsigned int gsize_dec_get(void *g, unsigned int pos) {
  return --((unsigned int *)g)[pos];
}


x86 assembly (clang, -O0):
<gsize_dec_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    %eax,%edx
mov    (%rcx,%rdx,4),%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx,%rdx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsize_dec_get>:
mov    %esi,%ecx
mov    (%rdi,%rcx,4),%eax
add    $0xffffffff,%eax
mov    %eax,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @gsize_dec_get(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load i32, i32* %5
%7 = add i32 %6, -1
store i32 %7, i32* %5
ret i32 %7
}
int test_imm_1Aint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Aint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 26
%7 = icmp ne i64 %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_1Aint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1703936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct peer_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void protocol_sendroutes(const struct peer_s *dstpeer) {
  {
    fprintf(stderr, "Sending routes... (not implemented)");
    fflush(stderr);
  };
}


x86 assembly (clang, -O0):
<protocol_sendroutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_sendroutes>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.peer_s = type { i32 }
@stderr = global i32 0
@.str = [36 x i8] c"Sending routes... (not implemented)\00"
define void @protocol_sendroutes(%struct.peer_s* %0) {
%2 = alloca %struct.peer_s*
store %struct.peer_s* %0, %struct.peer_s** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.peer_s = type { i32 }
@stderr = global i32 0
@.str = [36 x i8] c"Sending routes... (not implemented)\00"
define void @protocol_sendroutes(%struct.peer_s* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_stx();
int /*<<< orphan*/ e_writeback();
void e_stx_absy() {
  e_absy();
  e_stx();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_stx_absy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_absy@plt>
mov    $0x0,%al
call   1050 <e_stx@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_stx_absy>:
push   %rax
xor    %eax,%eax
call   1030 <e_absy@plt>
xor    %eax,%eax
call   1050 <e_stx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_stx_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_stx()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_stx_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_stx()
%3 = tail call i32 (...) @e_writeback()
ret void
}
void f3(void) {
  int x[100];
#pragma acc data copyin(x [25:50])
  {
    int *xp;
#pragma acc host_data use_device(x)
    {
#pragma acc parallel present(x) copyout(xp)
      { xp = x; }
    }
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x190(%rbp),%rax
mov    %rax,-0x198(%rbp)
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f3() {
%1 = alloca [100 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
store i32* %3, i32** %2
ret void
}

LLVM IR (-O2):
define void @f3() {
ret void
}
void sc(signed char *p, double x) { *p = x; }


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc>:
cvttsd2si %xmm0,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @sc(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i8
%7 = load i8*, i8** %3
store i8 %6, i8* %7
ret void
}

LLVM IR (-O2):
define void @sc(i8* nocapture writeonly %0, double %1) {
%3 = fptosi double %1 to i8
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawch24(char *, int, int, int);
void putc_lcd_asc24(char *fb, int x, int y, char ch) {
  int addr;
  addr = (ch - 0x20) * 36;
  drawch24(fb, x, y, addr);
}


x86 assembly (clang, -O0):
<putc_lcd_asc24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
sub    $0x20,%eax
imul   $0x24,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <drawch24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_lcd_asc24>:
lea    (%rcx,%rcx,8),%eax
lea    -0x480(,%rax,4),%ecx
jmp    1030 <drawch24@plt>

LLVM IR (-O0):
define void @putc_lcd_asc24(i8* %0, i32 %1, i32 %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 32
%13 = mul nsw i32 %12, 36
store i32 %13, i32* %9
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = call i32 @drawch24(i8* %14, i32 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @putc_lcd_asc24(i8* %0, i32 %1, i32 %2, i8 signext %3) {
%5 = sext i8 %3 to i32
%6 = mul nsw i32 %5, 36
%7 = add nsw i32 %6, -1152
%8 = tail call i32 @drawch24(i8* %0, i32 %1, i32 %2, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doSomesin() { printf("I did something\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"I did something\0A\00"
define void @doSomesin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"I did something\00"
define void @doSomesin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int succeed_test() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @succeed_test() {
ret i32 0
}
void greport_day(const struct userinfostruct *uinfo) { return; }


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

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

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

LLVM IR (-O2):
%struct.userinfostruct = type opaque
define void @greport_day(%struct.userinfostruct* nocapture %0) {
ret void
}
__typeof__(memmove(1, 1, (void *)1)) test_memmove_117(void) {
  return memmove(1, 1, (void *)1);
}


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

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

LLVM IR (-O0):
define i8* @test_memmove_117() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memmove_117() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, int);
int main(void) {
  int prodottoInteri = 1;
  int contatoreControlli;
  for (contatoreControlli = 1; contatoreControlli <= (int)15;
       contatoreControlli += 2) {
    prodottoInteri *= contatoreControlli;
  }
  printf("La somma degli interi pari da %u a %u e' pari a: %d", (unsigned int)1,
         (unsigned int)15, (int)prodottoInteri);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jg     114f <main+0x3f>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%ecx
lea    0xea7(%rip),%rdi
mov    $0x1,%esi
mov    $0xf,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [52 x i8] c"La somma degli interi pari da %u a %u e' pari a: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 15
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 1, i32 15, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"La somma degli interi pari da %u a %u e' pari a: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 1, i32 15, i32 2027025)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ term_exit();
void sighandler(int signal) {
  term_exit();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <term_exit@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
xor    %eax,%eax
call   1030 <term_exit@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @term_exit()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @term_exit()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int d_bge_mr2(double *a1, double a2) {
  return !(__builtin_isgreaterequal(*a1, a2));
}


x86 assembly (clang, -O0):
<d_bge_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_mr2>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_bge_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp oge double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_bge_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ult double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int mallopt(int param, int value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mallopt(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void _assertion_failure_abort(const char *filename, const char *funcname,
                              intmax_t lnum) {
  fprintf(stderr, "[%s:%jd] in function %s\n", filename, lnum, funcname);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<_assertion_failure_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_assertion_failure_abort>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"[%s:%jd] in function %s\0A\00"
define void @_assertion_failure_abort(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"[%s:%jd] in function %s\0A\00"
define void @_assertion_failure_abort(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %1)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int check_balanced_height(struct node *);
bool is_balanced(struct node *leaf) {
  if (check_balanced_height(leaf) != -1)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<is_balanced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_balanced_height@plt>
cmp    $0xffffffff,%eax
je     113a <is_balanced+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_balanced+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_balanced>:
push   %rax
call   1030 <check_balanced_height@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @is_balanced(%struct.node* %0) {
%2 = alloca i32
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = load %struct.node*, %struct.node** %3
%5 = call i32 @check_balanced_height(%struct.node* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @is_balanced(%struct.node* %0) {
%2 = tail call i32 @check_balanced_height(%struct.node* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
void vadd(float *v1, float *v2, float *out) {
  out[0] = v1[0] + v2[0];
  out[1] = v1[1] + v2[1];
  out[2] = v1[2] + v2[2];
}


x86 assembly (clang, -O0):
<vadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadd>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vadd(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vadd(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int z;
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  if (__VERIFIER_nondet_int() != 0) {
    x = 1;
  } else {
    x = -1;
  }
  while (y < 100 && z < 100) {
    y = y + x;
    z = z - x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     114f <main+0x3f>
movl   $0x1,-0x8(%rbp)
jmp    1156 <main+0x46>
movl   $0xffffffff,-0x8(%rbp)
jmp    115b <main+0x4b>
xor    %eax,%eax
cmpl   $0x64,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    1174 <main+0x64>
cmpl   $0x64,-0x10(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x74>
jmp    119b <main+0x8b>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x4b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
%7 = call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %2
br label %11
10: ; preds = %0
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 100
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 100
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = add nsw i32 %21, %22
store i32 %23, i32* %3
%24 = load i32, i32* %4
%25 = load i32, i32* %2
%26 = sub nsw i32 %24, %25
store i32 %26, i32* %4
br label %12
27: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int power_get_voltage();
int monitor_battery_charge() {
  int voltage = power_get_voltage();
  return 0;
}


x86 assembly (clang, -O0):
<monitor_battery_charge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <power_get_voltage@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @monitor_battery_charge() {
%1 = tail call i32 (...) @power_get_voltage()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_msat(uintptr_t);
void fiat_p256_msat(uint64_t out1[5]) {
  internal_fiat_p256_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_msat>:
jmp    1030 <internal_fiat_p256_msat@plt>

LLVM IR (-O0):
define void @fiat_p256_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p256_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p256_msat(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Adafruit_GFX_drawFastHLine(int /*<<< orphan*/, int, int,
                                              int /*<<< orphan*/);
int /*<<< orphan*/ Adafruit_GFX_fillRect(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int, int, int);
int /*<<< orphan*/ Adafruit_GFX_setCursor(int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ Adafruit_GFX_writeText(char *);
int /*<<< orphan*/ Adafruit_SharpMem_refresh();
void display_header_show_time(char *time) {
  Adafruit_GFX_fillRect(0, 0, 48, ((7 + 1) + 1) - 1, 1);
  Adafruit_GFX_setCursor(0, 0);
  Adafruit_GFX_writeText(time);
  Adafruit_GFX_drawFastHLine(0, ((7 + 1) + 1) - 1, 96, 0);
  Adafruit_SharpMem_refresh();
}


x86 assembly (clang, -O0):
<display_header_show_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %esi,%esi
mov    $0x30,%edx
mov    $0x8,%ecx
mov    $0x1,%r8d
mov    %esi,%edi
call   1040 <Adafruit_GFX_fillRect@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <Adafruit_GFX_setCursor@plt>
mov    -0x8(%rbp),%rdi
call   1060 <Adafruit_GFX_writeText@plt>
xor    %ecx,%ecx
mov    $0x8,%esi
mov    $0x60,%edx
mov    %ecx,%edi
call   1030 <Adafruit_GFX_drawFastHLine@plt>
mov    $0x0,%al
call   1070 <Adafruit_SharpMem_refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_header_show_time>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x30,%edx
mov    $0x8,%ecx
mov    $0x1,%r8d
call   1040 <Adafruit_GFX_fillRect@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <Adafruit_GFX_setCursor@plt>
mov    %rbx,%rdi
call   1060 <Adafruit_GFX_writeText@plt>
xor    %edi,%edi
mov    $0x8,%esi
mov    $0x60,%edx
xor    %ecx,%ecx
call   1030 <Adafruit_GFX_drawFastHLine@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <Adafruit_SharpMem_refresh@plt>

LLVM IR (-O0):
define void @display_header_show_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @Adafruit_GFX_fillRect(i32 0, i32 0, i32 48, i32 8, i32 1)
%4 = call i32 @Adafruit_GFX_setCursor(i32 0, i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @Adafruit_GFX_writeText(i8* %5)
%7 = call i32 @Adafruit_GFX_drawFastHLine(i32 0, i32 8, i32 96, i32 0)
%8 = call i32 (...) @Adafruit_SharpMem_refresh()
ret void
}

LLVM IR (-O2):
define void @display_header_show_time(i8* %0) {
%2 = tail call i32 @Adafruit_GFX_fillRect(i32 0, i32 0, i32 48, i32 8, i32 1)
%3 = tail call i32 @Adafruit_GFX_setCursor(i32 0, i32 0)
%4 = tail call i32 @Adafruit_GFX_writeText(i8* %0)
%5 = tail call i32 @Adafruit_GFX_drawFastHLine(i32 0, i32 8, i32 96, i32 0)
%6 = tail call i32 (...) @Adafruit_SharpMem_refresh()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int folderP(char *Name) {
  DIR *Dir;
  if (!(Dir = opendir(Name)))
    return 0;
  closedir(Dir);
  return 1;
}


x86 assembly (clang, -O0):
<folderP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    114f <folderP+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115f <folderP+0x3f>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<folderP>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <folderP+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @folderP(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int IntMin(int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char *);
char *StringIth(char *s, int i) { return (s + IntMin(strlen(s), i)); }


x86 assembly (clang, -O0):
<StringIth>:
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    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <IntMin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringIth>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <IntMin@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @StringIth(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @IntMin(i32 %7, i32 %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @StringIth(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @IntMin(i32 %3, i32 %1)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ pthread_yield_np();
int main(int argc, char **argv) {
  pthread_yield_np();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @pthread_yield_np()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @pthread_yield_np()
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};
struct bionic_stat64 {
  int dummy;
};

/* Variables and functions */
int fstat(int, struct stat *);
int /*<<< orphan*/ stat_to_bionic_stat(struct stat *, struct bionic_stat64 *);
int my_fstat(int fd, struct bionic_stat64 *s) {
  struct stat tmp;
  int ret = fstat(fd, &tmp);
  stat_to_bionic_stat(&tmp, s);
  return ret;
}


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

x86 assembly (clang, -O2):
<my_fstat>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1040 <fstat@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <stat_to_bionic_stat@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.bionic_stat64 = type { i32 }
%struct.stat = type { i32 }
define i32 @my_fstat(i32 %0, %struct.bionic_stat64* %1) {
%3 = alloca i32
%4 = alloca %struct.bionic_stat64*
%5 = alloca %struct.stat
%6 = alloca i32
store i32 %0, i32* %3
store %struct.bionic_stat64* %1, %struct.bionic_stat64** %4
%7 = load i32, i32* %3
%8 = call i32 @fstat(i32 %7, %struct.stat* %5)
store i32 %8, i32* %6
%9 = load %struct.bionic_stat64*, %struct.bionic_stat64** %4
%10 = call i32 @stat_to_bionic_stat(%struct.stat* %5, %struct.bionic_stat64* %9)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
%struct.bionic_stat64 = type { i32 }
%struct.stat = type { i32 }
define i32 @my_fstat(i32 %0, %struct.bionic_stat64* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @fstat(i32 %0, %struct.stat* %3)
%6 = call i32 @stat_to_bionic_stat(%struct.stat* %3, %struct.bionic_stat64* %1)
ret i32 %5
}
int test(int a, int b, int (*sum)(int, int)) { return (*sum)(a, b); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
int com(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @com(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @com(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509_CRL;
scalar_t__ i2d_X509_CRL;
int PEM_write_X509_CRL(FILE *fp, X509_CRL *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_X509_CRL, PEM_STRING_X509_CRL, fp, x,
                        NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_X509_CRL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_X509_CRL>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_CRL = global i64 0
@PEM_STRING_X509_CRL = global i32 0
define i32 @PEM_write_X509_CRL(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_CRL
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509_CRL
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_CRL = global i64 0
@PEM_STRING_X509_CRL = global i32 0
define i32 @PEM_write_X509_CRL(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_CRL
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509_CRL
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
tftpquit() { exit(0); }


x86 assembly (clang, -O0):
<tftpquit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<tftpquit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @tftpquit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @tftpquit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ YvdV(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ Zstr(char *);
void ZthrowThisNil() { YvdV(NULL, Zstr("THIS is NIL")); }


x86 assembly (clang, -O0):
<ZthrowThisNil>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Zstr@plt>
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <YvdV@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZthrowThisNil>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Zstr@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <YvdV@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"THIS is NIL\00"
define void @ZthrowThisNil() {
%1 = call i32 @Zstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @YvdV(i32* null, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"THIS is NIL\00"
define void @ZthrowThisNil() {
%1 = tail call i32 @Zstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @YvdV(i32* null, i32 %1)
ret void
}
int get_link_utilization(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_link_utilization() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eruConfigureETL3(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ eruConfigureOGU0(int);
int /*<<< orphan*/ eruEnable();
unsigned int eru0ConfigureChannel3AorB(void) {
  eruEnable();
  eruConfigureETL3(1, 0,
                   (1 << 0) | (1 << 1) | (1 << 2) | (0 << 3) | (0 << 4) |
                       (3 << 8) | (0 << 10) | (0 << 11));
  eruConfigureOGU0((0 << 0) | (1 << 2) | (1 << 4) | (1 << 15));
  return 0;
}


x86 assembly (clang, -O0):
<eru0ConfigureChannel3AorB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <eruEnable@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x307,%edx
call   1050 <eruConfigureETL3@plt>
mov    $0x8014,%edi
call   1040 <eruConfigureOGU0@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eru0ConfigureChannel3AorB>:
push   %rax
xor    %eax,%eax
call   1030 <eruEnable@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x307,%edx
call   1050 <eruConfigureETL3@plt>
mov    $0x8014,%edi
call   1040 <eruConfigureOGU0@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eru0ConfigureChannel3AorB() {
%1 = call i32 (...) @eruEnable()
%2 = call i32 @eruConfigureETL3(i32 1, i32 0, i32 775)
%3 = call i32 @eruConfigureOGU0(i32 32788)
ret i32 0
}

LLVM IR (-O2):
define i32 @eru0ConfigureChannel3AorB() {
%1 = tail call i32 (...) @eruEnable()
%2 = tail call i32 @eruConfigureETL3(i32 1, i32 0, i32 775)
%3 = tail call i32 @eruConfigureOGU0(i32 32788)
ret i32 0
}
int atoi(char s[]) {
  double atof(char s[]);
  return (int)atof(s);
}


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

x86 assembly (clang, -O2):
<atoi>:
push   %rax
call   1030 <atof@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @atof(i8* %3)
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
%3 = fptosi double %2 to i32
ret i32 %3
}
void insl(int port, void *addr, int cnt) {
  asm volatile("cld\n\trepne\n\tinsl"
               : "=D"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
cld
repnz insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
cld
repnz insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "cld\0A\09repne\0A\09insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "cld\0A\09repne\0A\09insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}