xunge/DecIR huggingface dataset:
/* Variables and functions */
int bgetw();
int /*<<< orphan*/ brseek(int, long);
int brtell();
int CheckMarker() {

  int Length;
  int v1;
  Length = brtell();
  v1 = bgetw();
  if (v1 >= 0xffc0) {
    brseek(Length, 0L);
    return (v1 & 0xff);
  }
  brseek(Length, 0L);
  return (0);
}


x86 assembly (clang, -O0):
<CheckMarker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <brtell@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bgetw@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffc0,-0xc(%rbp)
jl     1175 <CheckMarker+0x45>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <brseek@plt>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <CheckMarker+0x58>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <brseek@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckMarker>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <brtell@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <bgetw@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1050 <brseek@plt>
cmp    $0xffc0,%ebp
movzbl %bpl,%eax
cmovl  %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CheckMarker() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @brtell()
store i32 %4, i32* %2
%5 = call i32 (...) @bgetw()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 65472
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @brseek(i32 %9, i64 0)
%11 = load i32, i32* %3
%12 = and i32 %11, 255
store i32 %12, i32* %1
br label %16
13: ; preds = %0
%14 = load i32, i32* %2
%15 = call i32 @brseek(i32 %14, i64 0)
store i32 0, i32* %1
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @CheckMarker() {
%1 = tail call i32 (...) @brtell()
%2 = tail call i32 (...) @bgetw()
%3 = icmp sgt i32 %2, 65471
%4 = tail call i32 @brseek(i32 %1, i64 0)
%5 = and i32 %2, 255
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void writeVar() {
  emitln("call\t_convertToAscii");
  emitln("call\t_writeIobuf");
}


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

x86 assembly (clang, -O2):
<writeVar>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef1(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"call\09_convertToAscii\00"
@.str.1 = [17 x i8] c"call\09_writeIobuf\00"
define void @writeVar() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"call\09_convertToAscii\00"
@.str.1 = [17 x i8] c"call\09_writeIobuf\00"
define void @writeVar() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ScaleARGBRowDownEven_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDownEven_NEON() {
ret void
}
/* Variables and functions */
int rand();
double rand_radian(double r) {
  int a = rand() % 1000000;
  return ((double)a) / 1000000.0 * r;
}


x86 assembly (clang, -O0):
<rand_radian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_radian>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
divsd  0xeb9(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_radian(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 1000000
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = load double, double* %2
%10 = fmul double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @rand_radian(double %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 1000000
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
double __builtin_HEXAGON_F2_dfsub(double, double);
double test3(double rss, double rtt) {
  return __builtin_HEXAGON_F2_dfsub(rss, rtt);
}


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

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <__builtin_HEXAGON_F2_dfsub@plt>

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

LLVM IR (-O2):
define double @test3(double %0, double %1) {
%3 = tail call double @__builtin_HEXAGON_F2_dfsub(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xeb() {
  Assert_real((ispunct(235) == 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",
              1180, ("ispunct should be 0 for 0xeb"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0xeb>:
push   %rax
mov    $0xeb,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x49c,%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 0xeb\00"
define void @t_ispunct_0xeb() {
%1 = call i64 @ispunct(i32 235)
%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 1180, 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 0xeb\00"
define void @t_ispunct_0xeb() {
%1 = tail call i64 @ispunct(i32 235)
%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 1180, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int error_parse();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("yyparse() = %d\n", error_parse());
  return 0;
}


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

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

LLVM IR (-O2):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @error_parse()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
bool __u64_eq(void *a, void *b) { return *(uint64_t *)a == *(uint64_t *)b; }


x86 assembly (clang, -O0):
<__u64_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__u64_eq>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @__u64_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ queue_test();
int main() {
  if (queue_test()) {
    printf("QUEUE TESTS PASSED\n");
  } else
    printf("BAD!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <queue_test@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x3d>
lea    0xebc(%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 <queue_test@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xecd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"QUEUE TESTS PASSED\0A\00"
@.str.1 = [7 x i8] c"BAD!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @queue_test()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"BAD!!\00"
@str.2 = [19 x i8] c"QUEUE TESTS PASSED\00"
define i32 @main() {
%1 = tail call i64 (...) @queue_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
int test_imm_1Bint16_mem(short *val) {
  return ((*val) & (0x1B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 27
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ rlc_hl();
void opcb_06() { rlc_hl(); }


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

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

LLVM IR (-O0):
define void @opcb_06() {
%1 = call i32 (...) @rlc_hl()
ret void
}

LLVM IR (-O2):
define void @opcb_06() {
%1 = tail call i32 (...) @rlc_hl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x31() {
  Assert_real((isascii(49)),
              "/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_isascii.c",
              250, ("isascii should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isascii_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x31>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xfa,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 1\00"
define void @t_isascii_0x31() {
%1 = call i32 @isascii(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 1\00"
define void @t_isascii_0x31() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long double sinh(double);
long double sinhl(long double x) { return sinh((double)x); }


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sinh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinhl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <sinh@plt>

LLVM IR (-O0):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @sinh(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @sinh(double %2)
ret x86_fp80 %3
}
int fun1008() { return 1008; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x3f0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x3f0,%eax
ret

LLVM IR (-O0):
define i32 @fun1008() {
ret i32 1008
}

LLVM IR (-O2):
define i32 @fun1008() {
ret i32 1008
}
unsigned int antiflood_hash(char *nick) {
  unsigned int hash = 0;
  while (*nick)
    hash = (hash << 5) - hash + *nick++;
  return hash & 255;
}


x86 assembly (clang, -O0):
<antiflood_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <antiflood_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <antiflood_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<antiflood_hash>:
mov    (%rdi),%al
test   %al,%al
je     112b <antiflood_hash+0x2b>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
movzbl %al,%ecx
add    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <antiflood_hash+0x10>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @tick_shutdown_broadcast_oneshot(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *fp1;
  fp1 = fopen("test.txt", "a");
  FILE **fp2;
  fp2 = &fp1;
  fclose(fp1);
  fclose(*fp2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32**
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
store i32** %1, i32*** %2
%4 = load i32*, i32** %1
%5 = call i32 @fclose(i32* %4)
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int atomic_int_add_and_fetch(int volatile *, int);
int atomic_int_dec(volatile int *ptr) {
  return atomic_int_add_and_fetch(ptr, -1);
}


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

x86 assembly (clang, -O2):
<atomic_int_dec>:
mov    $0xffffffff,%esi
jmp    1030 <atomic_int_add_and_fetch@plt>

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

LLVM IR (-O2):
define i32 @atomic_int_dec(i32* %0) {
%2 = tail call i32 @atomic_int_add_and_fetch(i32* %0, i32 -1)
ret i32 %2
}
void init_cycfg_routing(void) {}


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

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

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

LLVM IR (-O2):
define void @init_cycfg_routing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void emit_nop(void) { Emit1(0x90); }


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

x86 assembly (clang, -O2):
<emit_nop>:
mov    $0x90,%edi
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @emit_nop() {
%1 = call i32 @Emit1(i32 144)
ret void
}

LLVM IR (-O2):
define void @emit_nop() {
%1 = tail call i32 @Emit1(i32 144)
ret void
}
/* Variables and functions */
int VL_GetActiveBuffer();
int VL_GetNumBuffers();
int RF_GetLastPage(int page) {
  return (VL_GetActiveBuffer() - page + VL_GetNumBuffers()) %
         VL_GetNumBuffers();
}


x86 assembly (clang, -O0):
<RF_GetLastPage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <VL_GetActiveBuffer@plt>
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <VL_GetNumBuffers@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <VL_GetNumBuffers@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @RF_GetLastPage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @VL_GetActiveBuffer()
%4 = load i32, i32* %2
%5 = sub nsw i32 %3, %4
%6 = call i32 (...) @VL_GetNumBuffers()
%7 = add nsw i32 %5, %6
%8 = call i32 (...) @VL_GetNumBuffers()
%9 = srem i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @RF_GetLastPage(i32 %0) {
%2 = tail call i32 (...) @VL_GetActiveBuffer()
%3 = sub i32 %2, %0
%4 = tail call i32 (...) @VL_GetNumBuffers()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @VL_GetNumBuffers()
%7 = srem i32 %5, %6
ret i32 %7
}
/* Variables and functions */
long general_str_hash_func(void *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
long str_hash_func(void *key) {
  return general_str_hash_func(key, strlen((char *)key));
}


x86 assembly (clang, -O0):
<str_hash_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <general_str_hash_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash_func>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <general_str_hash_func@plt>

LLVM IR (-O0):
define i64 @str_hash_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i64 @general_str_hash_func(i8* %3, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @str_hash_func(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @general_str_hash_func(i8* %0, i32 %2)
ret i64 %3
}
int http_request(char *url) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @http_request(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cw_interrupt_handler();
void __interrupt_handler() { cw_interrupt_handler(); }


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

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

LLVM IR (-O0):
define void @__interrupt_handler() {
%1 = call i32 (...) @cw_interrupt_handler()
ret void
}

LLVM IR (-O2):
define void @__interrupt_handler() {
%1 = tail call i32 (...) @cw_interrupt_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int decrescente(int N, int N0) {
  if (N == 0) {
    printf("N: %d\n", N0);
    return 0;
  } else {
    printf("N: %d\n", N0);
    return decrescente(N - 1, N0 + 1);
  }
}


x86 assembly (clang, -O0):
<decrescente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <decrescente+0x33>
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1176 <decrescente+0x56>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1040 <decrescente@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrescente>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     1142 <decrescente+0x32>
mov    %edi,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1130 <decrescente+0x20>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"N: %d\0A\00"
define i32 @decrescente(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 0, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = call i32 @decrescente(i32 %15, i32 %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"N: %d\0A\00"
define i32 @decrescente(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %7, %2
%5 = phi i32 [ %1, %2 ], [ %12, %7 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
7: ; preds = %2, %7
%8 = phi i32 [ %12, %7 ], [ %1, %2 ]
%9 = phi i32 [ %11, %7 ], [ %0, %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8)
%11 = add nsw i32 %9, -1
%12 = add nsw i32 %8, 1
%13 = icmp eq i32 %11, 0
br i1 %13, label %4, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("Hello world\n");
  sleep(3600);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xe10,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xe10,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 3600)
ret i32 0
}
int iabs(int a) {
  if (a < 0) {
    return (-1 * a);
  }
  return a;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1120 <iabs+0x20>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <iabs+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void HMAC_CTX_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @HMAC_CTX_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_handler(int signal) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
float call_clampf(float x, float a, float b) {
  return ((x) < (a) ? (a) : ((x) > (b) ? (b) : (x)));
}


x86 assembly (clang, -O0):
<call_clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <call_clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <call_clampf+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <call_clampf+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <call_clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @call_clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @call_clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_mode(int, char *);
int /*<<< orphan*/ gpio_set_value(int, int);
void skip_crc() {
  gpio_set_mode(38, "out");
  gpio_set_mode(40, "out");
  gpio_set_value(38, 1);
  gpio_set_value(40, 1);
  gpio_set_value(40, 0);
}


x86 assembly (clang, -O0):
<skip_crc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%edi
lea    0xed0(%rip),%rsi
call   1030 <gpio_set_mode@plt>
mov    $0x28,%edi
lea    0xebf(%rip),%rsi
call   1030 <gpio_set_mode@plt>
mov    $0x26,%edi
mov    $0x1,%esi
call   1040 <gpio_set_value@plt>
mov    $0x28,%edi
mov    $0x1,%esi
call   1040 <gpio_set_value@plt>
mov    $0x28,%edi
xor    %esi,%esi
call   1040 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_crc>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x26,%edi
mov    %rbx,%rsi
call   1030 <gpio_set_mode@plt>
mov    $0x28,%edi
mov    %rbx,%rsi
call   1030 <gpio_set_mode@plt>
mov    $0x26,%edi
mov    $0x1,%esi
call   1040 <gpio_set_value@plt>
mov    $0x28,%edi
mov    $0x1,%esi
call   1040 <gpio_set_value@plt>
mov    $0x28,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <gpio_set_value@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"out\00"
define void @skip_crc() {
%1 = call i32 @gpio_set_mode(i32 38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gpio_set_mode(i32 40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @gpio_set_value(i32 38, i32 1)
%4 = call i32 @gpio_set_value(i32 40, i32 1)
%5 = call i32 @gpio_set_value(i32 40, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"out\00"
define void @skip_crc() {
%1 = tail call i32 @gpio_set_mode(i32 38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gpio_set_mode(i32 40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @gpio_set_value(i32 38, i32 1)
%4 = tail call i32 @gpio_set_value(i32 40, i32 1)
%5 = tail call i32 @gpio_set_value(i32 40, i32 0)
ret void
}
void g_date_valid_weekday() {}


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

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

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

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

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/);
int mkdir(const char *path, mode_t mode) { return syscall(39, path, mode); }


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

x86 assembly (clang, -O2):
<mkdir>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x27,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 39, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ DWC_IN_BH();
char *dwc_bh(void) { return DWC_IN_BH() ? "BH" : ""; }


x86 assembly (clang, -O0):
<dwc_bh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DWC_IN_BH@plt>
mov    %rax,%rdx
lea    0xedd(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwc_bh>:
push   %rax
xor    %eax,%eax
call   1030 <DWC_IN_BH@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"BH\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @dwc_bh() {
%1 = call i64 (...) @DWC_IN_BH()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"BH\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @dwc_bh() {
%1 = tail call i64 (...) @DWC_IN_BH()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int rand_minstd();
uint32_t random_uint32(void) {
  uint16_t A = (rand_minstd() >> 15);
  uint16_t B = (rand_minstd() >> 15);
  return (((uint32_t)A) << 16) | B;
}


x86 assembly (clang, -O0):
<random_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand_minstd@plt>
sar    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand_minstd@plt>
sar    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uint32>:
push   %rbx
xor    %eax,%eax
call   1030 <rand_minstd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand_minstd@plt>
sar    $0xf,%eax
add    %ebx,%ebx
and    $0xffff0000,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_uint32() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand_minstd()
%4 = ashr i32 %3, 15
store i32 %4, i32* %1
%5 = call i32 (...) @rand_minstd()
%6 = ashr i32 %5, 15
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = shl i32 %7, 16
%9 = load i32, i32* %2
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @random_uint32() {
%1 = tail call i32 (...) @rand_minstd()
%2 = tail call i32 (...) @rand_minstd()
%3 = ashr i32 %2, 15
%4 = shl i32 %1, 1
%5 = and i32 %4, -65536
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]\n\n     Print the user name associated with the "
         "current effective user ID. \n     -h, --help\t\tdisplay this help\n  "
         "   -V, --version\tdisplay version information\n\n     Report bugs to "
         "<bulliver@gmail.com>\n",
         "whoami");
}


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

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

LLVM IR (-O0):
@.str = [218 x i8] c"Usage: %s [OPTION]\0A\0A Print the user name associated with the current effective user ID. \0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [7 x i8] c"whoami\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [218 x i8] c"Usage: %s [OPTION]\0A\0A Print the user name associated with the current effective user ID. \0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [7 x i8] c"whoami\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void putcs(char *s) {
  int i;
  putchar('\r');
  for (i = 0; i < 78; i++)
    putchar(' ');
  putchar('\r');
  fputs(s, stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<putcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4e,-0xc(%rbp)
jge    116f <putcs+0x3f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <putcs+0x1d>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcs>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0x4e,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <putcs+0x20>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    0x2e70(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
mov    0x0(%rbp),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @putcs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @putchar(i8 signext 13)
store i32 0, i32* %3
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 78
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 @putchar(i8 signext 32)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = call i32 @putchar(i8 signext 13)
%15 = load i8*, i8** %2
%16 = load i32, i32* @stdout
%17 = call i32 @fputs(i8* %15, i32 %16)
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @putcs(i8* %0) {
%2 = tail call i32 @putchar(i8 signext 13)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 78
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @putchar(i8 signext 13)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fputs(i8* %0, i32 %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fflush(i32 %12)
ret void
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 F(__u32 X, __u32 Y, __u32 Z) { return (X & Y) | ((~X) & Z); }


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_sendCommand(int);
int /*<<< orphan*/ keyboard_sendData(unsigned char);
void ps2aux_sendData(unsigned char data) {
  keyboard_sendCommand(0xD4);
  keyboard_sendData(data);
}


x86 assembly (clang, -O0):
<ps2aux_sendData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xd4,%edi
call   1040 <keyboard_sendCommand@plt>
movzbl -0x1(%rbp),%edi
call   1030 <keyboard_sendData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2aux_sendData>:
push   %rbx
mov    %edi,%ebx
mov    $0xd4,%edi
call   1040 <keyboard_sendCommand@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <keyboard_sendData@plt>

LLVM IR (-O0):
define void @ps2aux_sendData(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @keyboard_sendCommand(i32 212)
%4 = load i8, i8* %2
%5 = call i32 @keyboard_sendData(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @ps2aux_sendData(i8 zeroext %0) {
%2 = tail call i32 @keyboard_sendCommand(i32 212)
%3 = tail call i32 @keyboard_sendData(i8 zeroext %0)
ret void
}
/* Variables and functions */
int do_modinfo(int, char **);
int main(int argc, char *argv[]) { return do_modinfo(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <do_modinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <do_modinfo@plt>

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 = call i32 @do_modinfo(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @do_modinfo(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int getbegx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getbegx() { return getbegx(stdscr); }


x86 assembly (clang, -O0):
<t_getbegx>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getbegx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getbegx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getbegx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getbegx() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getbegx(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getbegx() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getbegx(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void cmnWriteRegister32(volatile void *Register, uint32_t Value) {
  *(volatile uint32_t *)Register = Value;
}


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

x86 assembly (clang, -O2):
<cmnWriteRegister32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @cmnWriteRegister32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}