xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gfx_init();
int /*<<< orphan*/ gfx_putchar(int);
void clrscr() {
  gfx_init();
  gfx_putchar(0x0c);
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gfx_init@plt>
mov    $0xc,%edi
call   1030 <gfx_putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
xor    %eax,%eax
call   1040 <gfx_init@plt>
mov    $0xc,%edi
pop    %rax
jmp    1030 <gfx_putchar@plt>

LLVM IR (-O0):
define void @clrscr() {
%1 = call i32 (...) @gfx_init()
%2 = call i32 @gfx_putchar(i32 12)
ret void
}

LLVM IR (-O2):
define void @clrscr() {
%1 = tail call i32 (...) @gfx_init()
%2 = tail call i32 @gfx_putchar(i32 12)
ret void
}
unsigned long virt_to_phys(void *x) { return (unsigned long)x; }


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

x86 assembly (clang, -O2):
<virt_to_phys>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closefrom_close(int fd) { (void)close(fd); }


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

x86 assembly (clang, -O2):
<closefrom_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closefrom_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DecodeString(char *);
scalar_t__ FindPostString(char *, char *, char *, int);
int GetPostString(char *cBuffer, char *sSearch, char *sReturn,
                  int dReturnSize) {
  if (FindPostString(cBuffer, sSearch, sReturn, dReturnSize) < 0) {
    return -1;
  }
  DecodeString(sReturn);
  return 0;
}


x86 assembly (clang, -O0):
<GetPostString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <FindPostString@plt>
cmp    $0x0,%rax
jge    1161 <GetPostString+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <GetPostString+0x51>
mov    -0x20(%rbp),%rdi
call   1040 <DecodeString@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPostString>:
push   %rbx
mov    %rdx,%rbx
call   1030 <FindPostString@plt>
test   %rax,%rax
js     113a <GetPostString+0x1a>
mov    %rbx,%rdi
call   1040 <DecodeString@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @GetPostString(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i64 @FindPostString(i8* %0, i8* %1, i8* %2, i32 %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @DecodeString(i8* %2)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int triplet_1(int);
int triplet_2(int);
int main() {
  int temp1 = triplet_1(1000);
  printf("Answer produced by the first approach - %d\n", temp1);
  int temp2 = triplet_2(1000);
  printf("Answer produced by the second approach - %d\n", temp2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1040 <triplet_1@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1050 <triplet_2@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1040 <triplet_1@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3e8,%edi
call   1050 <triplet_2@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Answer produced by the first approach - %d\0A\00"
@.str.1 = [45 x i8] c"Answer produced by the second approach - %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @triplet_1(i32 1000)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @triplet_2(i32 1000)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Answer produced by the first approach - %d\0A\00"
@.str.1 = [45 x i8] c"Answer produced by the second approach - %d\0A\00"
define i32 @main() {
%1 = tail call i32 @triplet_1(i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @triplet_2(i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ height;

/* Variables and functions */
int largestRectangleArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
void largestRectangleAreaMain(void) {
  int height[] = {4, 2, 0, 3, 2, 5};
  int len = sizeof(height) / sizeof(height[0]);
  printf("%d\n", largestRectangleArea(height, len));
}


x86 assembly (clang, -O0):
<largestRectangleAreaMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <largestRectangleArea@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largestRectangleAreaMain>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <largestRectangleArea@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.largestRectangleAreaMain.height = [6 x i32] [i32 4, i32 2, i32 0, i32 3, i32 2, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define void @largestRectangleAreaMain() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
store i32 6, i32* %2
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @largestRectangleArea(i32* %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.largestRectangleAreaMain.height = [6 x i32] [i32 4, i32 2, i32 0, i32 3, i32 2, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define void @largestRectangleAreaMain() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @largestRectangleArea(i32* %3, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int test_imm_9Buint8_mem(unsigned char *val) {
  return ((*val) & (0x9B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Buint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -101
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ os_compatible_path(char *);
int /*<<< orphan*/ save_MGW_file(char *, char *);
int /*<<< orphan*/ set_MGW_statusfname(int /*<<< orphan*/, char *);
void save_MGW_status(char *NXTaddr, char *jsonstr) {
  char fname[1024];
  set_MGW_statusfname(os_compatible_path(fname), NXTaddr);
  save_MGW_file(fname, jsonstr);
}


x86 assembly (clang, -O0):
<save_MGW_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
call   1040 <os_compatible_path@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <set_MGW_statusfname@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <save_MGW_file@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_MGW_status>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <os_compatible_path@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <set_MGW_statusfname@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <save_MGW_file@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @save_MGW_status(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i32 @os_compatible_path(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @set_MGW_statusfname(i32 %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @save_MGW_file(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @save_MGW_status(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @os_compatible_path(i8* %4)
%6 = call i32 @set_MGW_statusfname(i32 %5, i8* %0)
%7 = call i32 @save_MGW_file(i8* %4, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ constant_time_select(unsigned int, unsigned int, unsigned int);
int constant_time_select_int(unsigned int mask, int a, int b) {
  return (int)(constant_time_select(mask, (unsigned)(a), (unsigned)(b)));
}


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

x86 assembly (clang, -O2):
<constant_time_select_int>:
jmp    1030 <constant_time_select@plt>

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

LLVM IR (-O2):
define i32 @constant_time_select_int(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @constant_time_select(i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum = 0;
  for (i = 1; i <= 20; i++) {
    sum = sum + (i * i);
  }
  printf("Suma kwadratów liczb naturalnych od 1 do 20 to %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     1154 <main+0x44>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
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    $0xb36,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Suma kwadrat\C3\B3w liczb naturalnych od 1 do 20 to %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 20
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"Suma kwadrat\C3\B3w liczb naturalnych od 1 do 20 to %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 2870)
ret i32 0
}
void expand(dst, c) char *dst;
register int c;
{
  if (isprint(c)) {
    dst[0] = c;
    dst[1] = '\0';
  } else
    (void)sprintf(dst, "%#.3o", (unsigned int)c);
}


x86 assembly (clang, -O0):
<expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
je     1158 <expand+0x38>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    116d <expand+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <isprint@plt>
test   %eax,%eax
je     1144 <expand+0x24>
mov    %bl,(%r14)
movb   $0x0,0x1(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xeb5(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%#.3o\00"
define void @expand(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @isprint(i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %7
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
long get_file_size(const char *fname) {
  struct stat buf;
  if (stat(fname, &buf) == 0)
    return (long)buf.st_size;
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1140 <get_file_size+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <get_file_size+0x38>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1124 <get_file_size+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_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 i64, i64* %6
%8 = select i1 %5, i64 %7, i64 0
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sbc(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regr_op();
void arm_sbc_regr() { arm_arith_sbc(arm_data_regr_op()); }


x86 assembly (clang, -O0):
<arm_sbc_regr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_regr_op@plt>
mov    %eax,%edi
call   1040 <arm_arith_sbc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sbc_regr>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_regr_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_arith_sbc@plt>

LLVM IR (-O0):
define void @arm_sbc_regr() {
%1 = call i32 (...) @arm_data_regr_op()
%2 = call i32 @arm_arith_sbc(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sbc_regr() {
%1 = tail call i32 (...) @arm_data_regr_op()
%2 = tail call i32 @arm_arith_sbc(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Copy_Src_To_Dst_And_Add_1_To_Dst();
int /*<<< orphan*/ Read_Time_Stamp_Counter();
int main(int argc, char *argv[]) {
  Copy_Src_To_Dst_And_Add_1_To_Dst();
  Read_Time_Stamp_Counter();
  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   1040 <Copy_Src_To_Dst_And_Add_1_To_Dst@plt>
mov    $0x0,%al
call   1030 <Read_Time_Stamp_Counter@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Copy_Src_To_Dst_And_Add_1_To_Dst@plt>
xor    %eax,%eax
call   1030 <Read_Time_Stamp_Counter@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 (...) @Copy_Src_To_Dst_And_Add_1_To_Dst()
%7 = call i32 (...) @Read_Time_Stamp_Counter()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Copy_Src_To_Dst_And_Add_1_To_Dst()
%4 = tail call i32 (...) @Read_Time_Stamp_Counter()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset(void *);
void armv7m_reset(void *opaque) { cpu_reset(opaque); }


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

x86 assembly (clang, -O2):
<armv7m_reset>:
jmp    1030 <cpu_reset@plt>

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

LLVM IR (-O2):
define void @armv7m_reset(i8* %0) {
%2 = tail call i32 @cpu_reset(i8* %0)
ret void
}
int min(int i, int j) { return (i < j ? i : j); }


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_relocations();
int /*<<< orphan*/ original_init(int, char **, char **);
__attribute__((section(".text._init"))) int init(int argc, char **argv,
                                                 char **env) {
  do_relocations();
  original_init(argc, argv, env);
  return 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <do_relocations@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <original_init@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <do_relocations@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <original_init@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @init(i32 %0, i8** %1, i8** %2) section ".text._init" {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 (...) @do_relocations()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 @original_init(i32 %8, i8** %9, i8** %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @init(i32 %0, i8** %1, i8** %2) section ".text._init" {
%4 = tail call i32 (...) @do_relocations()
%5 = tail call i32 @original_init(i32 %0, i8** %1, i8** %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_orl_direct(char *str, uint8_t direct) {
  sprintf(str,
          "ORL   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_orl_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_orl_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ORL A, 0x%02X \00"
define void @sprint_orl_direct(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 i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ORL A, 0x%02X \00"
define void @sprint_orl_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
unsigned int _rotl(unsigned int, int);
unsigned int test_rotl(unsigned int value, int shift) {
  return _rotl(value, shift);
}


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

x86 assembly (clang, -O2):
<test_rotl>:
jmp    1030 <_rotl@plt>

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

LLVM IR (-O2):
define i32 @test_rotl(i32 %0, i32 %1) {
%3 = tail call i32 @_rotl(i32 %0, i32 %1)
ret i32 %3
}
int Operand_mr3_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_mr3_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double tv_to_double(struct timeval *);
double get_time_accurate() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv_to_double(&tv);
}


x86 assembly (clang, -O0):
<get_time_accurate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
call   1030 <tv_to_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_accurate>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    %rbx,%rdi
call   1030 <tv_to_double@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @get_time_accurate() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = call double @tv_to_double(%struct.timeval* %1)
ret double %3
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @get_time_accurate() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = call double @tv_to_double(%struct.timeval* %1)
ret double %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t IntToFixedPlusHalf(int val) { return (val << 16) + 0x8000; }


x86 assembly (clang, -O0):
<IntToFixedPlusHalf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
add    $0x8000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntToFixedPlusHalf>:
shl    $0x10,%edi
lea    0x8000(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @IntToFixedPlusHalf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = add nsw i32 %4, 32768
ret i32 %5
}

LLVM IR (-O2):
define i32 @IntToFixedPlusHalf(i32 %0) {
%2 = shl i32 %0, 16
%3 = or i32 %2, 32768
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ lang_callFunction_void(char *);
char *lang_eval_doCallPreliminary(int /*<<< orphan*/ *);
void lang_eval_doCall_void(FILE *lang_in) {
  char *name;
  name = lang_eval_doCallPreliminary(lang_in);
  lang_callFunction_void(name);
}


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

x86 assembly (clang, -O2):
<lang_eval_doCall_void>:
push   %rax
call   1030 <lang_eval_doCallPreliminary@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <lang_callFunction_void@plt>

LLVM IR (-O0):
define void @lang_eval_doCall_void(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i8* @lang_eval_doCallPreliminary(i32* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @lang_callFunction_void(i8* %6)
ret void
}

LLVM IR (-O2):
define void @lang_eval_doCall_void(i32* %0) {
%2 = tail call i8* @lang_eval_doCallPreliminary(i32* %0)
%3 = tail call i32 @lang_callFunction_void(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ get_flg_stat_bar_hint_chr();
scalar_t__ get_flg_stat_bar_hint_obj();
long calc_stat_bar_line_n(void) {
  long n;
  n = 0;
  if (get_flg_stat_bar_hint_chr())
    n++;
  if (get_flg_stat_bar_hint_obj())
    n++;
  return n;
}


x86 assembly (clang, -O0):
<calc_stat_bar_line_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_flg_stat_bar_hint_chr@plt>
cmp    $0x0,%rax
je     114d <calc_stat_bar_line_n+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_flg_stat_bar_hint_obj@plt>
cmp    $0x0,%rax
je     116a <calc_stat_bar_line_n+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_stat_bar_line_n>:
push   %rbx
xor    %eax,%eax
call   1040 <get_flg_stat_bar_hint_chr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
xor    %eax,%eax
call   1030 <get_flg_stat_bar_hint_obj@plt>
lea    0x1(%rbx),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @calc_stat_bar_line_n() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 (...) @get_flg_stat_bar_hint_chr()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i64, i64* %1
%6 = add nsw i64 %5, 1
store i64 %6, i64* %1
br label %7
7: ; preds = %4, %0
%8 = call i64 (...) @get_flg_stat_bar_hint_obj()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i64, i64* %1
%12 = add nsw i64 %11, 1
store i64 %12, i64* %1
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
define i64 @calc_stat_bar_line_n() {
%1 = tail call i64 (...) @get_flg_stat_bar_hint_chr()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = tail call i64 (...) @get_flg_stat_bar_hint_obj()
%5 = icmp eq i64 %4, 0
%6 = select i1 %2, i64 2, i64 1
%7 = select i1 %5, i64 %3, i64 %6
ret i64 %7
}
void ERR_get_error(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_error() {
ret void
}
void trap_AAS_SetCurrentWorld(int index) {}


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

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

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

LLVM IR (-O2):
define void @trap_AAS_SetCurrentWorld(i32 %0) {
ret void
}
unsigned int TimerCalcMilliseconds(unsigned int s) { return s * 1000; }


x86 assembly (clang, -O0):
<TimerCalcMilliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerCalcMilliseconds>:
imul   $0x3e8,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @TimerCalcMilliseconds(i32 %0) {
%2 = mul i32 %0, 1000
ret i32 %2
}
int m_to_dec(int n, int m) {
  return n / 0x10 == 0 ? n : (n & 0xf) + m * m_to_dec(n >> 4, m);
}


x86 assembly (clang, -O0):
<m_to_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    113d <m_to_dec+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    116a <m_to_dec+0x5a>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
mov    -0x8(%rbp),%esi
call   1030 <m_to_dec@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_to_dec>:
mov    %edi,%eax
lea    0xf(%rax),%ecx
cmp    $0x1e,%ecx
jbe    1139 <m_to_dec+0x29>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %eax,%ebp
and    $0xf,%ebp
sar    $0x4,%eax
mov    %eax,%edi
call   1030 <m_to_dec@plt>
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @m_to_dec(i32 %0, i32 %1) {
%3 = add i32 %0, 15
%4 = icmp ult i32 %3, 31
br i1 %4, label %5, label %7
5: ; preds = %2, %7
%6 = phi i32 [ %12, %7 ], [ %0, %2 ]
ret i32 %6
7: ; preds = %2
%8 = and i32 %0, 15
%9 = ashr i32 %0, 4
%10 = tail call i32 @m_to_dec(i32 %9, i32 %1)
%11 = mul nsw i32 %10, %1
%12 = add nsw i32 %11, %8
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int socket_set_non_blocking(int sockfd) {
  int rc;
  rc = fcntl(sockfd, F_GETFL, 0);
  if (rc) {
    rc |= O_NONBLOCK;
    rc = fcntl(sockfd, F_SETFL, rc);
  }
  return rc;
}


x86 assembly (clang, -O0):
<socket_set_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1161 <socket_set_non_blocking+0x51>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_set_non_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
je     1143 <socket_set_non_blocking+0x33>
mov    0x2eba(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @socket_set_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* @O_NONBLOCK
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* @F_SETFL
%15 = load i32, i32* %3
%16 = call i32 @fcntl(i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @socket_set_non_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFL
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
int isPrime(unsigned int number) {
  if (number <= 1)
    return 0;
  unsigned int i;
  for (i = 2; i * i <= number; i++) {
    if (number % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
ja     111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116b <isPrime+0x6b>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1164 <isPrime+0x64>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1151 <isPrime+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <isPrime+0x6b>
jmp    1156 <isPrime+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <isPrime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jae    110a <isPrime+0xa>
mov    %ecx,%eax
ret
cmp    $0x4,%edi
jae    1115 <isPrime+0x15>
mov    $0x1,%eax
ret
mov    $0x2,%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     1107 <isPrime+0x7>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jbe    1120 <isPrime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ule i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %26
8: ; preds = %1
store i32 2, i32* %4
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul i32 %10, %11
%13 = load i32, i32* %3
%14 = icmp ule i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %9
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = urem i32 %16, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 0, i32* %2
br label %26
21: ; preds = %15
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %9
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul i32 %12, %12
%7 = icmp ugt i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %12, %5 ], [ 2, %3 ]
%10 = urem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add i32 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %5, %8, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int fltcmp(float, float);
int fltcmp_asc(float v1, float v2) { return fltcmp(v1, v2); }


x86 assembly (clang, -O0):
<fltcmp_asc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fltcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltcmp_asc>:
jmp    1030 <fltcmp@plt>

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

LLVM IR (-O2):
define i32 @fltcmp_asc(float %0, float %1) {
%3 = tail call i32 @fltcmp(float %0, float %1)
ret i32 %3
}
int test_imm_E0uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E0uint16_mem>:
movzwl (%rdi),%eax
test   $0xff20,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -224
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float Min(float a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <Min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <Min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @Min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: parsetime [timespec]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"usage: parsetime [timespec]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: parsetime [timespec]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strndup(char *, size_t);
long long strtoll(char *, int /*<<< orphan*/ *, int);
long long flu_stoll(char *s, size_t l, int base) {
  char *ss = strndup(s, l);
  long long r = strtoll(ss, NULL, base);
  free(ss);
  return r;
}


x86 assembly (clang, -O0):
<flu_stoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strndup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <strtoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_stoll>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
call   1040 <strndup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <strtoll@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @flu_stoll(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i8* @strndup(i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i32, i32* %6
%14 = call i64 @strtoll(i8* %12, i32* null, i32 %13)
store i64 %14, i64* %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i64, i64* %8
ret i64 %17
}

LLVM IR (-O2):
define i64 @flu_stoll(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i8* @strndup(i8* %0, i64 %1)
%5 = tail call i64 @strtoll(i8* nocapture %4, i32* null, i32 %2)
%6 = tail call i32 @free(i8* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s [-p] [-b type] [-d delim] [-f type] "
                "[-h type] [-i incr] [-l num]\n\t[-n format] [-s sep] "
                "[-v startnum] [-w width] [file]\n",
                getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [130 x i8] c"Usage: %s [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num]\0A\09[-n format] [-s sep] [-v startnum] [-w width] [file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [130 x i8] c"Usage: %s [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num]\0A\09[-n format] [-s sep] [-v startnum] [-w width] [file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}