xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ceil(double);
int nmea_gsv_npack(int sat_count) {
  int pack_count = (int)ceil(((double)sat_count) / (4));
  if (0 == pack_count)
    pack_count = 1;
  return pack_count;
}


x86 assembly (clang, -O0):
<nmea_gsv_npack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1146 <nmea_gsv_npack+0x36>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_gsv_npack>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <ceil@plt>
test   %eax,%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nmea_gsv_npack(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 4.000000e+00
%7 = call i64 @ceil(double %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @nmea_gsv_npack(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 2.500000e-01
%4 = tail call i64 @ceil(double %3)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setLeds(int, int /*<<< orphan*/);
void exploit(void) {
  printf("\n\nYou are hacked!!!\n\n");
  for (;;) {
    setLeds(0x9700, 0);
  }
}


x86 assembly (clang, -O0):
<exploit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x9700,%edi
xor    %esi,%esi
call   1040 <setLeds@plt>
jmp    1130 <exploit+0x10>

x86 assembly (clang, -O2):
<exploit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0x9700,%edi
xor    %esi,%esi
call   1040 <setLeds@plt>
jmp    1130 <exploit+0x10>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A\0AYou are hacked!!!\0A\0A\00"
define void @exploit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = call i32 @setLeds(i32 38656, i32 0)
br label %2
}

LLVM IR (-O2):
@str = [21 x i8] c"\0A\0AYou are hacked!!!\0A\00"
define void @exploit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @setLeds(i32 38656, i32 0)
br label %2
}
/* Variables and functions */
double round(long double value) {
  long intpart = value;
  value -= intpart;
  if (value >= 0.5)
    intpart++;
  return (double)intpart;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpll -0x28(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fldt   -0x10(%rbp)
fsubp  %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb6(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1167 <round+0x67>
jmp    115b <round+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
fldt   0x8(%rsp)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fld    %st(0)
fistpll -0x10(%rsp)
fldcw  -0x14(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
fsubrp %st,%st(1)
flds   0xec5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sbb    $0xffffffffffffffff,%rax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @round(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to x86_fp80
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %8, %7
store x86_fp80 %9, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %2
%11 = fcmp oge x86_fp80 %10, 0xK3FFE8000000000000000
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
%17 = sitofp i64 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @round(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp oge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
%8 = sitofp i64 %7 to double
ret double %8
}
/* Variables and functions */
int sv_get_song_length_frames(int);
int vox_get_song_length_frames(int slot) {
  return sv_get_song_length_frames(slot);
}


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

x86 assembly (clang, -O2):
<vox_get_song_length_frames>:
jmp    1030 <sv_get_song_length_frames@plt>

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

LLVM IR (-O2):
define i32 @vox_get_song_length_frames(i32 %0) {
%2 = tail call i32 @sv_get_song_length_frames(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("in program\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [12 x i8] c"in program\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [11 x i8] c"in program\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ tapChar(char const);
void tapString(const char *s) {
  const char *sp;
  for (sp = s; *sp; ++sp)
    tapChar(*sp);
}


x86 assembly (clang, -O0):
<tapString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <tapString+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tapChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <tapString+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tapString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <tapString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tapChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tapString+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @tapString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @tapChar(i8 signext %11)
br label %13
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @tapString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @tapChar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *getlogin(void) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<getlogin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @getlogin() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @getlogin() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ scrClear();
int /*<<< orphan*/ shLoop();
int /*<<< orphan*/ tmrSetInterval(int);
int /*<<< orphan*/ uioPrint(char *);
void Init32c(void) {
  scrClear();
  tmrSetInterval(1193);
  uioPrint("Petrichor loaded.\n");
  while (-1)
    shLoop();
}


x86 assembly (clang, -O0):
<Init32c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <scrClear@plt>
mov    $0x4a9,%edi
call   1050 <tmrSetInterval@plt>
lea    0xea4(%rip),%rdi
call   1040 <uioPrint@plt>
mov    $0x0,%al
call   1030 <shLoop@plt>
jmp    1161 <Init32c+0x21>

x86 assembly (clang, -O2):
<Init32c>:
push   %rax
xor    %eax,%eax
call   1060 <scrClear@plt>
mov    $0x4a9,%edi
call   1050 <tmrSetInterval@plt>
lea    0xea7(%rip),%rdi
call   1040 <uioPrint@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <shLoop@plt>
jmp    1160 <Init32c+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"Petrichor loaded.\0A\00"
define void @Init32c() {
%1 = call i32 (...) @scrClear()
%2 = call i32 @tmrSetInterval(i32 1193)
%3 = call i32 @uioPrint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @shLoop()
br label %4
}

LLVM IR (-O2):
@.str = [19 x i8] c"Petrichor loaded.\0A\00"
define void @Init32c() {
%1 = tail call i32 (...) @scrClear()
%2 = tail call i32 @tmrSetInterval(i32 1193)
%3 = tail call i32 @uioPrint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @shLoop()
br label %4
}
void dd_pbl_ios_fb_publish_feed(const char *name, const char *caption,
                                const char *descr, const char *link,
                                const char *picture) {}


x86 assembly (clang, -O0):
<dd_pbl_ios_fb_publish_feed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dd_pbl_ios_fb_publish_feed(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @dd_pbl_ios_fb_publish_feed(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_cc(uint8_t *p_rtp, uint8_t i_cc) {
  p_rtp[0] &= 0xf0;
  p_rtp[0] |= i_cc & 0xf;
}


x86 assembly (clang, -O0):
<rtp_set_cc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xf0,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_set_cc>:
mov    $0xf0,%eax
and    (%rdi),%eax
and    $0xf,%esi
or     %eax,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_cc(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 240
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 15
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @rtp_set_cc(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 240
%5 = and i32 %1, 15
%6 = or i32 %4, %5
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CloseCOM(int);
void owRelease(int portnum) { CloseCOM(portnum); }


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

x86 assembly (clang, -O2):
<owRelease>:
jmp    1030 <CloseCOM@plt>

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

LLVM IR (-O2):
define void @owRelease(i32 %0) {
%2 = tail call i32 @CloseCOM(i32 %0)
ret void
}
int test_imm_7Auint16_reg(unsigned short val) {
  return ((val) & (-0x7A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -122
%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_7Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -122
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a12(int);
void a11(int n) { a12(n); }


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

x86 assembly (clang, -O2):
<a11>:
jmp    1030 <a12@plt>

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

LLVM IR (-O2):
define void @a11(i32 %0) {
%2 = tail call i32 @a12(i32 %0)
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void *Calloc(int x, int s) {
  void *p;
  p = calloc((int)x, (int)s);
  if (p == NULL) {
    printf("ERROR: Not enough memory. (for a block of size %lu)\n", x * s);
    exit(-1);
  }
  return p;
}


x86 assembly (clang, -O0):
<Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <Calloc+0x45>
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <calloc@plt>
test   %rax,%rax
je     1148 <Calloc+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
imul   %ebp,%ebx
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"ERROR: Not enough memory. (for a block of size %lu)\0A\00"
define i8* @Calloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [53 x i8] c"ERROR: Not enough memory. (for a block of size %lu)\0A\00"
define noalias i8* @Calloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = mul nsw i32 %1, %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_will_need() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_will_need"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblock_will_need>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_memblock_will_need\0A\00"
define i32 @pa_memblock_will_need() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_memblock_will_need\00"
define i32 @pa_memblock_will_need() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int exp(double);
double x_inf(const double V) { return 1. / (1. + exp(0.15 * (-50. - V))); }


x86 assembly (clang, -O0):
<x_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_inf>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xee3(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xed3(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @x_inf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double -5.000000e+01, %3
%5 = fmul double 1.500000e-01, %4
%6 = call i32 @exp(double %5)
%7 = sitofp i32 %6 to double
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @x_inf(double %0) {
%2 = fsub double -5.000000e+01, %0
%3 = fmul double %2, 1.500000e-01
%4 = tail call i32 @exp(double %3)
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
_Complex short f23(void) {}


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

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

LLVM IR (-O0):
define i32 @f23() {
%1 = alloca { i16, i16 }
%2 = bitcast { i16, i16 }* %1 to i32*
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @f23() {
ret i32 undef
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", foo()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ MyThreadYield();
int /*<<< orphan*/ printf(char *);
void t1(void *dummy) {
  printf("t1 start\n");
  MyThreadYield();
  printf("t1 again\n");
  MyThreadExit();
  printf("t1 did not exit");
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <MyThreadYield@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <MyThreadYield@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <MyThreadExit@plt>
lea    0xe92(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t1 start\0A\00"
@.str.1 = [10 x i8] c"t1 again\0A\00"
@.str.2 = [16 x i8] c"t1 did not exit\00"
define void @t1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @MyThreadYield()
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @MyThreadExit()
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"t1 did not exit\00"
@str = [9 x i8] c"t1 start\00"
@str.3 = [9 x i8] c"t1 again\00"
define void @t1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadYield()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (...) @MyThreadExit()
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ parse_init(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_loop();
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: tracker (trackfile)\n");
    return 0;
  }
  if (parse_init(argv[1])) {
    read_loop();
  }
  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    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <parse_init@plt>
cmp    $0x0,%rax
je     1186 <main+0x56>
mov    $0x0,%al
call   1040 <read_loop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1144 <main+0x14>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
jmp    1159 <main+0x29>
mov    0x8(%rsi),%rdi
call   1050 <parse_init@plt>
test   %rax,%rax
je     1159 <main+0x29>
xor    %eax,%eax
call   1040 <read_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: tracker (trackfile)\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 %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @parse_init(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (...) @read_loop()
br label %18
18: ; preds = %16, %10
store i32 0, i32* %3
br label %19
19: ; preds = %18, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [27 x i8] c"Usage: tracker (trackfile)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %13
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @parse_init(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 (...) @read_loop()
br label %13
13: ; preds = %6, %11, %4
ret i32 0
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
void initialize_random_seed(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  srand(tv.tv_usec);
}


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

x86 assembly (clang, -O2):
<initialize_random_seed>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @initialize_random_seed() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @srand(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @initialize_random_seed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @srand(i32 %5)
ret void
}
void test_four(int x, int y) {
#pragma omp target parallel for collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int abort_crash(int n) {
  assert(n > 0);
  return 1;
}


x86 assembly (clang, -O0):
<abort_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abort_crash>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setg   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @abort_crash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 1
}

LLVM IR (-O2):
define i32 @abort_crash(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void stub1();
void t_desc(char *name, void (*func)()) {
  printf("\n\x1b[34m\t%s\x1b[0m\n\n", name);
  (*func)();
}


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

x86 assembly (clang, -O2):
<t_desc>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A\1B[34m\09%s\1B[0m\0A\0A\00"
define void @t_desc(i8* %0, void (...)* nocapture %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void (...) %1()
ret void
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, long);
void *sjhashMalloc(long bytes) {
  void *p = malloc(bytes);
  if (p)
    memset(p, 0, bytes);
  return p;
}


x86 assembly (clang, -O0):
<sjhashMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <sjhashMalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sjhashMalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <sjhashMalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sjhashMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ ceil(float);
int range_rect(float r, float w, int m) { return (int)ceil(r); }


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

x86 assembly (clang, -O2):
<range_rect>:
jmp    1030 <ceil@plt>

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

LLVM IR (-O2):
define i32 @range_rect(float %0, float %1, i32 %2) {
%4 = tail call i64 @ceil(float %0)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
void echo() {
  int c;
  while ((c = getchar()) != EOF)
    putchar(c);
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     114e <echo+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <echo+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <echo+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <echo+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @echo() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @putchar(i32 %7)
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @echo() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret void
}
/* Type definitions */
struct cc_usb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cc_usb_printf(struct cc_usb *, char *);
int /*<<< orphan*/ cc_usb_sync(struct cc_usb *);
int cc_usb_reset(struct cc_usb *cc) {
  cc_usb_sync(cc);
  cc_usb_printf(cc, "R\n");
  return 1;
}


x86 assembly (clang, -O0):
<cc_usb_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cc_usb_sync@plt>
mov    -0x8(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <cc_usb_printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_usb_reset>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cc_usb_sync@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <cc_usb_printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cc_usb = type { i32 }
@.str = [3 x i8] c"R\0A\00"
define i32 @cc_usb_reset(%struct.cc_usb* %0) {
%2 = alloca %struct.cc_usb*
store %struct.cc_usb* %0, %struct.cc_usb** %2
%3 = load %struct.cc_usb*, %struct.cc_usb** %2
%4 = call i32 @cc_usb_sync(%struct.cc_usb* %3)
%5 = load %struct.cc_usb*, %struct.cc_usb** %2
%6 = call i32 @cc_usb_printf(%struct.cc_usb* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.cc_usb = type { i32 }
@.str = [3 x i8] c"R\0A\00"
define i32 @cc_usb_reset(%struct.cc_usb* %0) {
%2 = tail call i32 @cc_usb_sync(%struct.cc_usb* %0)
%3 = tail call i32 @cc_usb_printf(%struct.cc_usb* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
unsigned int hash_key_string(const char *str) {
  unsigned char *p;
  unsigned int hval = 0;
  const unsigned int multiplier = 31;
  for (p = (unsigned char *)str; *p != '\0'; p++) {
    hval += (multiplier * hval) + *p;
  }
  return (hval);
}


x86 assembly (clang, -O0):
<hash_key_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1f,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <hash_key_string+0x52>
imul   $0x1f,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111e <hash_key_string+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash_key_string+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_key_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_key_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = shl i32 %7, 5
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ generate_infocontrib(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("too few arguments\n");
    exit(1);
  }
  generate_infocontrib(argv[1], argv[2], argv[3]);
  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   $0x3,-0x8(%rbp)
jge    1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <generate_infocontrib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jle    114e <main+0x1e>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
call   1040 <generate_infocontrib@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"too few arguments\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, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
%21 = call i32 @generate_infocontrib(i8* %14, i8* %17, i8* %20)
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"too few arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @generate_infocontrib(i8* %9, i8* %11, i8* %13)
ret i32 0
}
float _floorf(float x) {
  float y;
  y = x;
  if (x < (float)0.0) {
    y = -y;
  }
  if (y >= (float)16777216.0) {
    return x;
  }
  y = ((float)(((long)(x))));
  if (y > x) {
    y = ((float)(y) - (float)(1.0));
  }
  return y;
}


x86 assembly (clang, -O0):
<_floorf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1137 <_floorf+0x37>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xebc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     115c <_floorf+0x5c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119b <_floorf+0x9b>
cvttss2si -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1191 <_floorf+0x91>
movss  -0xc(%rbp),%xmm0
movss  0xe7c(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_floorf>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
ucomiss 0xeeb(%rip),%xmm3
jae    114e <_floorf+0x4e>
cvttss2si %xmm0,%rax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  0xed8(%rip),%xmm2
addss  %xmm1,%xmm2
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @_floorf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
store float %5, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %4
%10 = fneg float %9
store float %10, float* %4
br label %11
11: ; preds = %8, %1
%12 = load float, float* %4
%13 = fcmp oge float %12, 0x4170000000000000
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load float, float* %3
store float %15, float* %2
br label %28
16: ; preds = %11
%17 = load float, float* %3
%18 = fptosi float %17 to i64
%19 = sitofp i64 %18 to float
store float %19, float* %4
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fcmp ogt float %20, %21
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load float, float* %4
%25 = fsub float %24, 1.000000e+00
store float %25, float* %4
br label %26
26: ; preds = %23, %16
%27 = load float, float* %4
store float %27, float* %2
br label %28
28: ; preds = %26, %14
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @_floorf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp ult float %4, 0x4170000000000000
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = fptosi float %0 to i64
%8 = sitofp i64 %7 to float
%9 = fcmp ogt float %8, %0
%10 = fadd float %8, -1.000000e+00
%11 = select i1 %9, float %10, float %8
br label %12
12: ; preds = %1, %6
%13 = phi float [ %11, %6 ], [ %0, %1 ]
ret float %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_cow_fopen(char const *, char const *);
FILE *do_generic_fopen(char const *name, char const *mode,
                       FILE *(*open_proc)(char const *, char const *)) {
  do_cow_fopen(name, mode);
  do {
  } while (0);
  return open_proc(name, mode);
}


x86 assembly (clang, -O0):
<do_generic_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <do_cow_fopen@plt>
jmp    1136 <do_generic_fopen+0x26>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_generic_fopen>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <do_cow_fopen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
jmp    *%rax

LLVM IR (-O0):
define i32* @do_generic_fopen(i8* %0, i8* %1, i32* (i8*, i8*)* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32* (i8*, i8*)*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* (i8*, i8*)* %2, i32* (i8*, i8*)** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @do_cow_fopen(i8* %7, i8* %8)
br label %10
10: ; preds = %3
br label %11
11: ; preds = %10
%12 = load i32* (i8*, i8*)*, i32* (i8*, i8*)** %6
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32* %12(i8* %13, i8* %14)
ret i32* %15
}

LLVM IR (-O2):
define i32* @do_generic_fopen(i8* %0, i8* %1, i32* (i8*, i8*)* nocapture %2) {
%4 = tail call i32 @do_cow_fopen(i8* %0, i8* %1)
%5 = tail call i32* %2(i8* %0, i8* %1)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int main(void) { initialize(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
ret i32 0
}