xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float dvn(float f, float s) {
  float t;
  t = f / s;
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<dvn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1169 <dvn+0x49>
movss  0xea5(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1188 <dvn+0x68>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvn>:
push   %rax
divss  %xmm1,%xmm0
ucomiss 0xec4(%rip),%xmm0
ja     114d <dvn+0x1d>
movss  0xebe(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     114d <dvn+0x1d>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [2 x i8] c"\0A\00"
define float @dvn(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp ogt float %9, 0x416312CFE0000000
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load float, float* %5
%13 = fcmp olt float %12, 0xC16312CFE0000000
br i1 %13, label %14, label %18
14: ; preds = %11, %2
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = load float, float* %5
ret float %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
define float @dvn(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fcmp ogt float %3, 0x416312CFE0000000
%5 = fcmp olt float %3, 0xC16312CFE0000000
%6 = or i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vprintf(char const *, int /*<<< orphan*/);
int time_stamps_printf(const char *format, va_list arg) {
  return vprintf(format, arg);
}


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

x86 assembly (clang, -O2):
<time_stamps_printf>:
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define i32 @time_stamps_printf(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 @vprintf(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @time_stamps_printf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* %0, i32 %1)
ret i32 %3
}
int null_readtoc_session(unsigned char *b, int msf, int maxlen) { return 0; }


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

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

LLVM IR (-O0):
define i32 @null_readtoc_session(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @null_readtoc_session(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ motion_set(int);
void right(void) { motion_set(0x0A); }


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <motion_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
mov    $0xa,%edi
jmp    1030 <motion_set@plt>

LLVM IR (-O0):
define void @right() {
%1 = call i32 @motion_set(i32 10)
ret void
}

LLVM IR (-O2):
define void @right() {
%1 = tail call i32 @motion_set(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xe9() {
  Assert_real((islower(233) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1170, ("islower should be 0 for 0xe9"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe9\00"
define void @t_islower_0xe9() {
%1 = call i64 @islower(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe9\00"
define void @t_islower_0xe9() {
%1 = tail call i64 @islower(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ gettext(char *);
void print_usage(FILE *stream) {
  fputs(gettext("Usage: yp_dump_binding [-d domain]\n"), stream);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <gettext@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: yp_dump_binding [-d domain]\0A\00"
define void @print_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @gettext(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @fputs(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: yp_dump_binding [-d domain]\0A\00"
define void @print_usage(i32* %0) {
%2 = tail call i32 @gettext(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fputs(i32 %2, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int /*<<< orphan*/);
int main(void) {
  foo(1, 2, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ local();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  local();
  printf("\nLa variable local x en main es: %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    $0x0,%al
call   1040 <local@plt>
mov    -0x8(%rbp),%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
xor    %eax,%eax
call   1040 <local@plt>
lea    0xed1(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"\0ALa variable local x en main es: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @local()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int main() {
  int a = 0;
  int b = 1;
  int c = 2, d = 3;
  return a + b + c - d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void *glwin_create(char const *wintitle, int width, int height) {
  { return ((void *)0); }
}


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

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

LLVM IR (-O0):
define i8* @glwin_create(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @glwin_create(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* null
}
void h_cgdcont(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_cgdcont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_cgdcont>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cgdcont = [10 x i8] c"h_cgdcont\00"
define void @h_cgdcont(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.h_cgdcont, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cgdcont = [10 x i8] c"h_cgdcont\00"
define void @h_cgdcont(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.h_cgdcont, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("Hello and bye!\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello and bye!\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello and bye!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ putst_uart(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
void puthx_uart(uint32_t v) {
  uint8_t buf[12];
  sprintf((char *)buf, "0x%lx", v);
  putst_uart(buf);
}


x86 assembly (clang, -O0):
<puthx_uart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <putst_uart@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthx_uart>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <putst_uart@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0x%lx\00"
define void @puthx_uart(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%9 = call i32 @putst_uart(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%lx\00"
define void @puthx_uart(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @putst_uart(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int Overlap(int a1, int a2, int b1, int b2) {
  if (a1 <= b1)
    return (b1 <= a2);
  else
    return (a1 <= b2);
}


x86 assembly (clang, -O0):
<Overlap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1132 <Overlap+0x32>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <Overlap+0x43>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Overlap>:
xor    %eax,%eax
cmp    %esi,%edx
setle  %al
xor    %esi,%esi
cmp    %ecx,%edi
setle  %sil
cmp    %edx,%edi
cmovg  %esi,%eax
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @Overlap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %2
%6 = icmp sle i32 %2, %1
%7 = icmp sle i32 %0, %3
%8 = select i1 %5, i1 %7, i1 %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int random();
float random_float() {
  int x;
  float f;
  x = random();
  f = (float)x / (float)RAND_MAX;
  return f;
}


x86 assembly (clang, -O0):
<random_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mov    0x2eba(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2ss %eax,%xmm0
mov    0x2ec5(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @random_float() {
%1 = alloca i32
%2 = alloca float
%3 = call i32 (...) @random()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
store float %8, float* %2
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @random_float() {
%1 = tail call i32 (...) @random()
%2 = sitofp i32 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fclose(int /*<<< orphan*/ *);
cierraFichero(FILE *fichero) { return fclose(fichero) != EOF; }


x86 assembly (clang, -O0):
<cierraFichero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cierraFichero>:
push   %rax
call   1030 <fclose@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @cierraFichero(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @cierraFichero(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test(int *);
int /*<<< orphan*/ test2(int *);
int main() {
  int a[5] = {5, 6, 7, 8, 9};
  test(a);
  test2(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <test@plt>
lea    -0x20(%rbp),%rdi
call   1030 <test2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <test@plt>
mov    %rbx,%rdi
call   1030 <test2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @test(i32* %4)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @test2(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @test(i32* %3)
%5 = call i32 @test2(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bwa_print_sam_PG() {
  printf("@PG\tID:bwa\tPN:bwa\tVN:%s\n", "0.5.10-evan.6.3");
}


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

x86 assembly (clang, -O2):
<bwa_print_sam_PG>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [16 x i8] c"0.5.10-evan.6.3\00"
define void @bwa_print_sam_PG() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [16 x i8] c"0.5.10-evan.6.3\00"
define void @bwa_print_sam_PG() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ S_empty(struct Stack *);
struct Stack *S_pop(struct Stack *);
void S_destroy(struct Stack *s) {
  while (!S_empty(s))
    s = S_pop(s);
}


x86 assembly (clang, -O0):
<S_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <S_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <S_destroy+0x2a>
jmp    115c <S_destroy+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <S_pop@plt>
mov    %rax,-0x8(%rbp)
jmp    112c <S_destroy+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_destroy>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <S_empty@plt>
test   %eax,%eax
jne    1149 <S_destroy+0x29>
mov    %rbx,%rdi
call   1030 <S_pop@plt>
mov    %rax,%rbx
mov    %rax,%rdi
jmp    1130 <S_destroy+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.Stack = type { i32 }
define void @S_destroy(%struct.Stack* %0) {
%2 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.Stack*, %struct.Stack** %2
%5 = call i32 @S_empty(%struct.Stack* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.Stack*, %struct.Stack** %2
%10 = call %struct.Stack* @S_pop(%struct.Stack* %9)
store %struct.Stack* %10, %struct.Stack** %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.Stack = type { i32 }
define void @S_destroy(%struct.Stack* %0) {
%2 = tail call i32 @S_empty(%struct.Stack* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi %struct.Stack* [ %6, %4 ], [ %0, %1 ]
%6 = tail call %struct.Stack* @S_pop(%struct.Stack* %5)
%7 = tail call i32 @S_empty(%struct.Stack* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %1
ret void
}
int test_imm_2Eint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Eint64_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, 46
%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_2Eint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3014656
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void v_ntoh(void *, int);
void v16_ntoh(void *p) { return v_ntoh(p, 2); }


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

x86 assembly (clang, -O2):
<v16_ntoh>:
mov    $0x2,%esi
jmp    1030 <v_ntoh@plt>

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

LLVM IR (-O2):
define void @v16_ntoh(i8* %0) {
tail call void @v_ntoh(i8* %0, i32 2)
ret void
}
void RtmpMgmtTaskExit(struct rt_rtmp_adapter *pAd) { return; }


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

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

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

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type opaque
define void @RtmpMgmtTaskExit(%struct.rt_rtmp_adapter* nocapture %0) {
ret void
}
int bar(void) {
  static void *b[] = {&&addr};
  baz(b);
addr:
  return 17;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0d(%rip),%rdi
mov    $0x0,%al
call   1030 <baz@plt>
mov    $0x11,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0x2f10(%rip),%rdi
xor    %eax,%eax
call   1030 <baz@plt>
mov    $0x11,%eax
pop    %rcx
ret

LLVM IR (-O0):
@bar.b = internal global [1 x i8*] [i8* blockaddress(@bar, %2)]
define i32 @bar() {
%1 = call i32 (i8**, ...) bitcast (i32 (...)* @baz to i32 (i8**, ...)*)(i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @bar.b, i64 0, i64 0))
br label %2
2: ; preds = %0, %3
ret i32 17
3: ; No predecessors!
indirectbr i8* undef, [label %2]
}

LLVM IR (-O2):
@bar.b = internal global [1 x i8*] [i8* blockaddress(@bar, %2)]
define i32 @bar() {
%1 = tail call i32 (i8**, ...) bitcast (i32 (...)* @baz to i32 (i8**, ...)*)(i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @bar.b, i64 0, i64 0))
br label %2
2: ; preds = %0
ret i32 17
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ fputs(void *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void bee_tree_print_key_default(void *key) {
  assert(key);
  fputs(key, stdout);
}


x86 assembly (clang, -O0):
<bee_tree_print_key_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bee_tree_print_key_default>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @bee_tree_print_key_default(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @bee_tree_print_key_default(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *threadFunc(void *x) {
  int i = *(int *)x;
  printf("child %d", i);
  return x;
}


x86 assembly (clang, -O0):
<threadFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadFunc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"child %d\00"
define i8* @threadFunc(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_complex_2_x();
int main() {
  struct_complex_2_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <struct_complex_2_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_complex_2_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int checkop(char operator) {
  switch (operator) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '%':
  case '^':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x25,%eax
je     1166 <checkop+0x66>
jmp    111f <checkop+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     1166 <checkop+0x66>
jmp    1133 <checkop+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1166 <checkop+0x66>
jmp    1144 <checkop+0x44>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1166 <checkop+0x66>
jmp    1155 <checkop+0x55>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1172 <checkop+0x72>
jmp    1166 <checkop+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1179 <checkop+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkop>:
add    $0xffffffdb,%edi
cmp    $0x39,%edi
ja     111e <checkop+0x1e>
mov    $0x1,%eax
movabs $0x200000000000561,%rcx
bt     %rdi,%rcx
jae    111e <checkop+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkop(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 37, label %6
i32 94, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @checkop(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 43, label %4
i32 45, label %4
i32 42, label %4
i32 47, label %4
i32 37, label %4
i32 94, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  scalar_t__ sin_port;
  int /*<<< orphan*/ sin_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ inet_addr(char const *);
void init_sockaddr_in(struct sockaddr_in *sin, const char *addr) {
  sin->sin_family = AF_INET;
  sin->sin_port = 0;
  sin->sin_addr.s_addr = inet_addr(addr);
}


x86 assembly (clang, -O0):
<init_sockaddr_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sockaddr_in>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rdi)
movq   $0x0,0x8(%rdi)
mov    %rsi,%rdi
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i64, i32 }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
define void @init_sockaddr_in(%struct.sockaddr_in* %0, i8* %1) {
%3 = alloca %struct.sockaddr_in*
%4 = alloca i8*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %3
store i8* %1, i8** %4
%5 = load i32, i32* @AF_INET
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i32 %5, i32* %7
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i64 0, i64* %9
%10 = load i8*, i8** %4
%11 = call i32 @inet_addr(i8* %10)
%12 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%13 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %12, i32 0, i32 0
%14 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %13, i32 0, i32 0
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i64, i32 }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
define void @init_sockaddr_in(%struct.sockaddr_in* nocapture writeonly %0, i8* %1) {
%3 = load i32, i32* @AF_INET
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 2
store i32 %3, i32* %4
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 1
store i64 0, i64* %5
%6 = tail call i32 @inet_addr(i8* %1)
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0, i32 0
store i32 %6, i32* %7
ret void
}
int fixed_mod(int a, int b) {
  int rem = a % b;
  while (rem < 0)
    rem += b;
  return rem;
}


x86 assembly (clang, -O0):
<fixed_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112c <fixed_mod+0x2c>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <fixed_mod+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sub    %esi,%eax
nopl   0x0(%rax)
add    %esi,%eax
js     1110 <fixed_mod+0x10>
ret

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

LLVM IR (-O2):
define i32 @fixed_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %7, %4 ]
%6 = icmp slt i32 %5, 0
%7 = add nsw i32 %5, %1
br i1 %6, label %4, label %8
8: ; preds = %4
ret i32 %5
}
int test_imm_F4int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F4int64_highword_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, 32
%6 = and i64 %5, 244
%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_F4int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1047972020224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
short ntohs(short);
double f2dot14(short x) {
  short y = ntohs(x);
  return (y >> 14) + ((y & 0x3fff) / 16384.0);
}


x86 assembly (clang, -O0):
<f2dot14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <ntohs@plt>
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
sar    $0xe,%eax
cvtsi2sd %eax,%xmm0
movswl -0x4(%rbp),%eax
and    $0x3fff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2dot14>:
push   %rax
call   1030 <ntohs@plt>
cwtl
mov    %eax,%ecx
sar    $0xe,%ecx
cvtsi2sd %ecx,%xmm1
and    $0x3fff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f2dot14(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call signext i16 @ntohs(i16 signext %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = ashr i32 %7, 14
%9 = sitofp i32 %8 to double
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = and i32 %11, 16383
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 1.638400e+04
%15 = fadd double %9, %14
ret double %15
}

LLVM IR (-O2):
define double @f2dot14(i16 signext %0) {
%2 = tail call signext i16 @ntohs(i16 signext %0)
%3 = sext i16 %2 to i32
%4 = ashr i32 %3, 14
%5 = sitofp i32 %4 to double
%6 = and i32 %3, 16383
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 0x3F10000000000000
%9 = fadd double %8, %5
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() {
  int x;
  x = 1 + 2;
  f(x);
  if (4 * 5) {
    x++;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getdw(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/);
void ToMapDump(FILE *HelpFile, long FileLength) {
  long i;
  for (i = 0; i * 4L < FileLength; i++) {
    printf("TopicNum: %-12ld TopicOffset: 0x%08lX\n", i, getdw(HelpFile));
  }
}


x86 assembly (clang, -O0):
<ToMapDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
cmp    -0x10(%rbp),%rax
jge    117e <ToMapDump+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getdw@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <ToMapDump+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToMapDump>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rsi,%rsi
jle    1162 <ToMapDump+0x42>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %r13d,%r13d
lea    0xec2(%rip),%r15
xor    %ebx,%ebx
mov    %r14,%rdi
call   1040 <getdw@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x4,%r13
cmp    %r12,%r13
jl     1140 <ToMapDump+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [39 x i8] c"TopicNum: %-12ld TopicOffset: 0x%08lX\0A\00"
define void @ToMapDump(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = mul nsw i64 %7, 4
%9 = load i64, i64* %4
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i64, i64* %5
%13 = load i32*, i32** %3
%14 = call i32 @getdw(i32* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %14)
br label %16
16: ; preds = %11
%17 = load i64, i64* %5
%18 = add nsw i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"TopicNum: %-12ld TopicOffset: 0x%08lX\0A\00"
define void @ToMapDump(i32* %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = tail call i32 @getdw(i32* %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %6)
%8 = add nuw nsw i64 %5, 1
%9 = shl nsw i64 %8, 2
%10 = icmp slt i64 %9, %1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
void XtRegisterExtensionSelector() {}


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

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

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

LLVM IR (-O2):
define void @XtRegisterExtensionSelector() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
unsigned long fread(unsigned char *, int, unsigned long, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void load(FILE *fh, unsigned char *ptr, unsigned long sz) {
  if (fread(ptr, 1, sz, fh) != sz) {
    fprintf(stderr, "Read error!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x18(%rbp),%rax
je     1183 <load+0x53>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    114b <load+0x1b>
pop    %rbx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Read error!\0A\00"
define void @load(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32*, i32** %4
%10 = call i64 @fread(i8* %7, i32 1, i64 %8, i32* %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Read error!\0A\00"
define void @load(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp eq i64 %4, %2
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int a = 3;
  int b = a++;
  int c = ++b;
  printf("a = %d b = %d c = %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"a = %d b = %d c = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
store i32 %9, i32* %7
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 1
store i32 %12, i32* %7
store i32 %12, i32* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"a = %d b = %d c = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4, i32 4, i32 4)
ret i32 0
}