xunge/DecIR huggingface dataset:
int ZNK2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ZNK2() {
ret i32 0
}
int funcA() { return 2; }


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

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

LLVM IR (-O0):
define i32 @funcA() {
ret i32 2
}

LLVM IR (-O2):
define i32 @funcA() {
ret i32 2
}
int curses_metric(char *str, int len) { return len; }


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

x86 assembly (clang, -O2):
<curses_metric>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @curses_metric(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @curses_metric(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void inspect_fw_pstr(const char *label, const char *str) {
  printf("%-23s: %s\n", label, str);
}


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

x86 assembly (clang, -O2):
<inspect_fw_pstr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%-23s: %s\0A\00"
define void @inspect_fw_pstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%-23s: %s\0A\00"
define void @inspect_fw_pstr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, char *);
int main(int argc, char const *argv[]) {
  char ch;
  while (scanf("%c", &ch))
    printf("YOU have input %c\n", ch);
  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)
lea    0xec3(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
lea    0xeac(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     117d <main+0x5d>
lea    0xebd(%rip),%r14
lea    0xeb3(%rip),%r15
lea    0xf(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0xf(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [19 x i8] c"YOU have input %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %10, %2
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i8, i8* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8 signext %11)
br label %7
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [19 x i8] c"YOU have input %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8 signext %7)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int);
int romanToInt(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "Usage: ./test roman\n");
    exit(-1);
  }
  printf("%d\n", romanToInt(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
jge    117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <romanToInt@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1161 <main+0x21>
mov    0x8(%rsi),%rdi
call   1060 <romanToInt@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: ./test roman\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @romanToInt(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: ./test roman\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @romanToInt(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void do_stdio_log_char(void *context, char val) {
  FILE *stdio = context;
  fprintf(stdio, "%c", val);
}


x86 assembly (clang, -O0):
<do_stdio_log_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xecb(%rip),%rsi
movsbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stdio_log_char>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @do_stdio_log_char(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i32*
%4 = sext i8 %1 to i32
%5 = tail call i32 @fputc(i32 %4, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xc1() {
  Assert_real((ispunct(193) == 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_ispunct.c",
              970, ("ispunct should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xc1\00"
define void @t_ispunct_0xc1() {
%1 = call i64 @ispunct(i32 193)
%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 970, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xc1\00"
define void @t_ispunct_0xc1() {
%1 = tail call i64 @ispunct(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ random_int_init();
int get_random_int(int range, int shift) {
  random_int_init();
  return (rand() % range) + shift;
}


x86 assembly (clang, -O0):
<get_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random_int_init@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random_int_init@plt>
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @random_int_init()
%6 = call i32 (...) @rand()
%7 = load i32, i32* %3
%8 = srem i32 %6, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_random_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random_int_init()
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double copysignl(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<copysignl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignl>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_long_double@plt>

LLVM IR (-O0):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
int test_imm_1Eint16_reg(short val) {
  return ((val) & (-0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Eint16_reg>:
test   $0xffe2,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -30
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void bitand_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a&b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<bitand_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitand_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a&b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @bitand_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [12 x i8] c"PUSH(a&b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @bitand_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void fftss_check_cpu(void) {}


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

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

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

LLVM IR (-O2):
define void @fftss_check_cpu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  (void)argc;
  ft_putstr(argv[0]);
  ft_putchar('\n');
  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    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @ft_putstr(i8* %9)
%11 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @ft_putstr(i8* %3)
%5 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
int main() {
  int a = 5, b = 10;
  long c;
  unsigned int d;
  &a == 1;
  &a == &c;
  &a == &d;
  &a < &d;
  &a < 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 5, i32* %1
store i32 10, i32* %2
%5 = icmp eq i32* %1, inttoptr (i64 1 to i32*)
%6 = zext i1 %5 to i32
%7 = bitcast i64* %3 to i32*
%8 = icmp eq i32* %1, %7
%9 = zext i1 %8 to i32
%10 = icmp eq i32* %1, %4
%11 = zext i1 %10 to i32
%12 = icmp ult i32* %1, %4
%13 = zext i1 %12 to i32
%14 = icmp ult i32* %1, inttoptr (i64 1 to i32*)
%15 = zext i1 %14 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int rand();
int is_girl() { return (rand() % 100) < 50; }


x86 assembly (clang, -O0):
<is_girl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x32,%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_girl>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x32,%ecx
setl   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_girl() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = icmp slt i32 %2, 50
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_girl() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = icmp slt i32 %2, 50
%4 = zext i1 %3 to i32
ret i32 %4
}
void Settings_StoreString(char *KeyName, char *String) {}


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

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

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

LLVM IR (-O2):
define void @Settings_StoreString(i8* nocapture %0, i8* nocapture %1) {
ret void
}
double geom_J2_sph_rtp_B(double x[], int dir) { return 1.0; }


x86 assembly (clang, -O0):
<geom_J2_sph_rtp_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  0xeed(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_J2_sph_rtp_B>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @geom_J2_sph_rtp_B(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @geom_J2_sph_rtp_B(double* nocapture readnone %0, i32 %1) {
ret double 1.000000e+00
}
unsigned zix_string_hash(const void *key) {
  const char *str = (const char *)key;
  unsigned h = 5381;
  for (const char *s = str; *s != '\0'; ++s) {
    h = (h << 5) + h + *s;
  }
  return h;
}


x86 assembly (clang, -O0):
<zix_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <zix_string_hash+0x55>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <zix_string_hash+0x1f>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zix_string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <zix_string_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <zix_string_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @zix_string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 5381, %1 ], [ %12, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i8 [ %14, %6 ], [ %2, %1 ]
%8 = phi i8* [ %13, %6 ], [ %0, %1 ]
%9 = phi i32 [ %12, %6 ], [ 5381, %1 ]
%10 = sext i8 %7 to i32
%11 = mul i32 %9, 33
%12 = add i32 %11, %10
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %4, label %6
}
void getKeysFreeResult(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               76, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<getKeysFreeResult>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4c,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKeysFreeResult>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x4c,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getKeysFreeResult = [18 x i8] c"getKeysFreeResult\00"
define void @getKeysFreeResult() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 76, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.getKeysFreeResult, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.getKeysFreeResult = [18 x i8] c"getKeysFreeResult\00"
define void @getKeysFreeResult() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 76, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.getKeysFreeResult, i64 0, i64 0))
ret void
}
int hex2char(int c) {
  if ((c >= 0) && (c <= 9))
    return (c + 48);
  else if ((c >= 10) && (c <= 15))
    return (c + 55);
  else
    return -1;
}


x86 assembly (clang, -O0):
<hex2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <hex2char+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <hex2char+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <hex2char+0x52>
cmpl   $0xa,-0x8(%rbp)
jl     114b <hex2char+0x4b>
cmpl   $0xf,-0x8(%rbp)
jg     114b <hex2char+0x4b>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <hex2char+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2char>:
mov    %edi,%eax
cmp    $0x9,%edi
ja     110b <hex2char+0xb>
add    $0x30,%eax
ret
lea    -0xa(%rax),%ecx
add    $0x37,%eax
cmp    $0x6,%ecx
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hex2char(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i32 %0, 48
br label %10
5: ; preds = %1
%6 = add i32 %0, -10
%7 = icmp ult i32 %6, 6
%8 = add nsw i32 %0, 55
%9 = select i1 %7, i32 %8, i32 -1
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ %4, %3 ], [ %9, %5 ]
ret i32 %11
}
int check_pipe(char **args) {
  int i = 0;
  while (args[i] != '\0') {
    if (*args[i] == '|')
      return 1;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_pipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <check_pipe+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x7c,%eax
jne    1146 <check_pipe+0x46>
movl   $0x1,-0x4(%rbp)
jmp    115b <check_pipe+0x5b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <check_pipe+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pipe>:
mov    (%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1121 <check_pipe+0x21>
add    $0x8,%rdi
xchg   %ax,%ax
cmpb   $0x7c,(%rcx)
je     1122 <check_pipe+0x22>
mov    (%rdi),%rcx
add    $0x8,%rdi
test   %rcx,%rcx
jne    1110 <check_pipe+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_pipe(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8*, i8** %0, i64 %13
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8* [ %6, %4 ], [ %2, %1 ]
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 124
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void handler(int numero) { fprintf(stderr, "(%d recu)", numero); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"(%d recu)\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"(%d recu)\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void XRotateWindowProperties() {}


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

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

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

LLVM IR (-O2):
define void @XRotateWindowProperties() {
ret void
}
void snag16(from, to) unsigned char *from;
unsigned char *to;
{
  to[0] = from[0];
  to[1] = from[1];
}


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

x86 assembly (clang, -O2):
<snag16>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
define void @snag16(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @snag16(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
void foo(volatile unsigned int *vaddr) {
  while (*vaddr != *vaddr)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%eax
je     1121 <foo+0x21>
jmp    1108 <foo+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%eax
cmp    (%rdi),%eax
jne    1100 <foo>
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %9, %1
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
%6 = load i32*, i32** %2
%7 = load volatile i32, i32* %6
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foo(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* %0
%4 = load volatile i32, i32* %0
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
void X509_ocspid_print(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ocspid_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vf5();
int /*<<< orphan*/ take_struct_vf5(int /*<<< orphan*/);
void test_struct_vf5() { take_struct_vf5(return_struct_vf5()); }


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

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

LLVM IR (-O0):
define void @test_struct_vf5() {
%1 = call i32 (...) @return_struct_vf5()
%2 = call i32 @take_struct_vf5(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vf5() {
%1 = tail call i32 (...) @return_struct_vf5()
%2 = tail call i32 @take_struct_vf5(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, char *, int, char *, int, char *, int, char *);
int main() {
  foo(7, "hello ", 5, " ", 3, " world ", 9, "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
lea    0xed6(%rip),%rcx
mov    $0x3,%r8d
lea    0xec3(%rip),%r9
lea    0xec4(%rip),%rax
movl   $0x9,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef7(%rip),%rax
lea    0xee1(%rip),%rsi
lea    0xee7(%rip),%rcx
lea    0xeda(%rip),%r9
mov    $0x7,%edi
mov    $0x5,%edx
mov    $0x3,%r8d
push   %rax
push   $0x9
call   1030 <foo@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"hello \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [8 x i8] c" world \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void O_stop_child_send(child_socket_val) int child_socket_val;
{ close(child_socket_val); }


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

x86 assembly (clang, -O2):
<O_stop_child_send>:
xor    %eax,%eax
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @O_stop_child_send(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_strb(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_reg_op();
void t16_strb_reg() { arm_memio_strb(t16_memio_reg_op()); }


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

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

LLVM IR (-O0):
define void @t16_strb_reg() {
%1 = call i32 (...) @t16_memio_reg_op()
%2 = call i32 @arm_memio_strb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_strb_reg() {
%1 = tail call i32 (...) @t16_memio_reg_op()
%2 = tail call i32 @arm_memio_strb(i32 %1)
ret void
}
void bfqg_stats_update_io_remove(struct bfq_group *bfqg, unsigned int op) {}


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

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

LLVM IR (-O0):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_remove(%struct.bfq_group* %0, i32 %1) {
%3 = alloca %struct.bfq_group*
%4 = alloca i32
store %struct.bfq_group* %0, %struct.bfq_group** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_update_io_remove(%struct.bfq_group* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double __dmod(double, double);
double tan(double);
double __dtand(double x) {
  double circle = 360.0;
  return tan(.017453292519943295 * __dmod(x, circle));
}


x86 assembly (clang, -O0):
<__dtand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__dmod@plt>
movaps %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <tan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dtand>:
push   %rax
movsd  0xed7(%rip),%xmm1
call   1030 <__dmod@plt>
mulsd  0xed2(%rip),%xmm0
pop    %rax
jmp    1040 <tan@plt>

LLVM IR (-O0):
define double @__dtand(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 3.600000e+02, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = call double @__dmod(double %4, double %5)
%7 = fmul double 0x3F91DF46A2529D39, %6
%8 = call double @tan(double %7)
ret double %8
}

LLVM IR (-O2):
define double @__dtand(double %0) {
%2 = tail call double @__dmod(double %0, double 3.600000e+02)
%3 = fmul double %2, 0x3F91DF46A2529D39
%4 = tail call double @tan(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ STY16(int /*<<< orphan*/, int);
void Op8CX0(void) { STY16(SA1Absolute(2), 0xFFFF); }


x86 assembly (clang, -O0):
<Op8CX0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1030 <STY16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8CX0>:
push   %rax
mov    $0x2,%edi
call   1040 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <STY16@plt>

LLVM IR (-O0):
define void @Op8CX0() {
%1 = call i32 @SA1Absolute(i32 2)
%2 = call i32 @STY16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op8CX0() {
%1 = tail call i32 @SA1Absolute(i32 2)
%2 = tail call i32 @STY16(i32 %1, i32 65535)
ret void
}
void PRCMCacheRetentionEnable(void) {
  (*((volatile unsigned long *)(0x40082000 + 0x00000224))) |= 0x00000003;
}


x86 assembly (clang, -O0):
<PRCMCacheRetentionEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40082224,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x40082224,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMCacheRetentionEnable>:
orq    $0x3,0x40082224
40 03
ret

LLVM IR (-O0):
define void @PRCMCacheRetentionEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074274852 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1074274852 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMCacheRetentionEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074274852 to i64*)
%2 = or i64 %1, 3
store volatile i64 %2, i64* inttoptr (i64 1074274852 to i64*)
ret void
}
/* Variables and functions */
int generate_snp_sites_generic(char *, int, int, int, char *,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int generate_snp_sites(char filename[], int output_multi_fasta_file,
                       int output_vcf_file, int output_phylip_file,
                       char output_filename[]) {
  return generate_snp_sites_generic(filename, output_multi_fasta_file,
                                    output_vcf_file, output_phylip_file,
                                    output_filename, 0, 0, 0);
}


x86 assembly (clang, -O0):
<generate_snp_sites>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <generate_snp_sites_generic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_snp_sites>:
push   %rax
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <generate_snp_sites_generic@plt>
add    $0x10,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @generate_snp_sites(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @generate_snp_sites_generic(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 0, i32 0, i32 0)
ret i32 %6
}
int rl_tab_insert(count, key)
int count, key __attribute__((unused));
{ return (_rl_insert_char(count, '\t')); }


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

x86 assembly (clang, -O2):
<rl_tab_insert>:
mov    $0x9,%esi
xor    %eax,%eax
jmp    1030 <_rl_insert_char@plt>

LLVM IR (-O0):
define i32 @rl_tab_insert(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 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_rl_insert_char to i32 (i32, i32, ...)*)(i32 %5, i32 9)
ret i32 %6
}

LLVM IR (-O2):
define i32 @rl_tab_insert(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_rl_insert_char to i32 (i32, i32, ...)*)(i32 %0, i32 9)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle31() { kprintf("ISR %d.\n", 31); }


x86 assembly (clang, -O0):
<isrHandle31>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1f,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle31>:
lea    0xee9(%rip),%rdi
mov    $0x1f,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle31() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 31)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle31() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 31)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hydro_random_ensure_initialized();
int hydro_init(void) {
  hydro_random_ensure_initialized();
  return 0;
}


x86 assembly (clang, -O0):
<hydro_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hydro_random_ensure_initialized@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hydro_init() {
%1 = call i32 (...) @hydro_random_ensure_initialized()
ret i32 0
}

LLVM IR (-O2):
define i32 @hydro_init() {
%1 = tail call i32 (...) @hydro_random_ensure_initialized()
ret i32 0
}
void fa146(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
a:
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        p025A:
          goto p025A;
          goto a;
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa146>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa146+0x4>

x86 assembly (clang, -O2):
<fa146>:
jmp    1100 <fa146>

LLVM IR (-O0):
define void @fa146() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; No predecessors!
br label %17
17: ; preds = %17, %16
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa146() {
br label %1
1: ; preds = %1, %0
br label %1
}
int fun312() { return 312; }


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

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

LLVM IR (-O0):
define i32 @fun312() {
ret i32 312
}

LLVM IR (-O2):
define i32 @fun312() {
ret i32 312
}