xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb9() {
  Assert_real((isodigit(185) == 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_isodigit.c",
              930, ("isodigit should be 0 for 0xb9"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3a2,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb9\00"
define void @t_isodigit_0xb9() {
%1 = call i64 @isodigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb9\00"
define void @t_isodigit_0xb9() {
%1 = tail call i64 @isodigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char u8g_font_get_char(const void *s) { return *(const char *)(s); }


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

x86 assembly (clang, -O2):
<u8g_font_get_char>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @u8g_font_get_char(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int _fp_inf(double x) {
  return ((x >= 1.797693e+308) || (x <= -1.797693e+308));
}


x86 assembly (clang, -O0):
<_fp_inf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
movsd  0xee8(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jae    1138 <_fp_inf+0x38>
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fp_inf>:
ucomisd 0xef8(%rip),%xmm0
setae  %al
movsd  0xef5(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_fp_inf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0x7FEFFFFFD7B9609A
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp ole double %6, 0xFFEFFFFFD7B9609A
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_fp_inf(double %0) {
%2 = fcmp oge double %0, 0x7FEFFFFFD7B9609A
%3 = fcmp ole double %0, 0xFFEFFFFFD7B9609A
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
char *null_array_UINT16(uint16_t *arr) {
  if (arr == NULL) {
    return "null";
  } else {
    return "non_null";
  }
}


x86 assembly (clang, -O0):
<null_array_UINT16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <null_array_UINT16+0x23>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <null_array_UINT16+0x2e>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_array_UINT16>:
test   %rdi,%rdi
lea    0xefa(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_UINT16(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_UINT16(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void errExit(char *str) {
  puts(str);
  exit(1);
}


x86 assembly (clang, -O0):
<errExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errExit>:
push   %rax
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @errExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @errExit(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double divideDymola(double, double);
double remainderDymola(double x, double y) {
  return x - divideDymola(x, y) * y;
}


x86 assembly (clang, -O0):
<remainderDymola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <divideDymola@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainderDymola>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <divideDymola@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @remainderDymola(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* %3
%7 = load double, double* %4
%8 = call double @divideDymola(double %6, double %7)
%9 = load double, double* %4
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double %5)
ret double %11
}

LLVM IR (-O2):
define double @remainderDymola(double %0, double %1) {
%3 = tail call double @divideDymola(double %0, double %1)
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double %1, double %0)
ret double %5
}
void protocol_slidekeepalive() {}


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

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

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

LLVM IR (-O2):
define void @protocol_slidekeepalive() {
ret void
}
void test_sprintf() {}


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

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

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

LLVM IR (-O2):
define void @test_sprintf() {
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_19(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x04, 0x14, 0x13, 0x15, 0x1A, 0x1B, 0x0F, 0x16, 0x02, 0x0D, 0x0C,
      0x06, 0x10, 0x17, 0x01, 0x0B, 0x1E, 0x08, 0x1C, 0x18, 0x19, 0x0A,
      0x1F, 0x05, 0x11, 0x09, 0x1D, 0x07, 0x0E, 0x12, 0x03, 0x00,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_19>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_19.LUT = internal global [32 x i8] c"\04\14\13\15\1A\1B\0F\16\02\0D\0C\06\10\17\01\0B\1E\08\1C\18\19\0A\1F\05\11\09\1D\07\0E\12\03\00"
define i32 @yahoo_f01_19(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_19.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_19.LUT = internal global [32 x i8] c"\04\14\13\15\1A\1B\0F\16\02\0D\0C\06\10\17\01\0B\1E\08\1C\18\19\0A\1F\05\11\09\1D\07\0E\12\03\00"
define i32 @yahoo_f01_19(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_19.LUT, i64 0, i64 0))
ret i32 %3
}
void av_dict_set() {}


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

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

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

LLVM IR (-O2):
define void @av_dict_set() {
ret void
}
void I_BeginSplash(void) {}


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

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

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

LLVM IR (-O2):
define void @I_BeginSplash() {
ret void
}
/* Variables and functions */
int randDecimal();
double getRandomConnectionWeight(double weightRange) {
  return (randDecimal() * 2 * weightRange) - weightRange;
}


x86 assembly (clang, -O0):
<getRandomConnectionWeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randDecimal@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomConnectionWeight>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <randDecimal@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getRandomConnectionWeight(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @randDecimal()
%4 = mul nsw i32 %3, 2
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %5, double %6, double %8)
ret double %9
}

LLVM IR (-O2):
define double @getRandomConnectionWeight(double %0) {
%2 = tail call i32 (...) @randDecimal()
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fneg double %0
%6 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/);
void rand_seed() { srand((unsigned)time(0)); }


x86 assembly (clang, -O0):
<rand_seed>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rand_seed() {
%1 = call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @rand_seed() {
%1 = tail call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ screen_load();
int /*<<< orphan*/ screen_save();
int /*<<< orphan*/ show_file(char *, void *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void town_history(void) {
  screen_save();
  (void)show_file("bldg.txt", ((void *)0), 0, 0);
  screen_load();
}


x86 assembly (clang, -O0):
<town_history>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <screen_save@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <show_file@plt>
mov    $0x0,%al
call   1030 <screen_load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<town_history>:
push   %rax
xor    %eax,%eax
call   1050 <screen_save@plt>
lea    0xec1(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <show_file@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <screen_load@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"bldg.txt\00"
define void @town_history() {
%1 = call i32 (...) @screen_save()
%2 = call i32 @show_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* null, i32 0, i32 0)
%3 = call i32 (...) @screen_load()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"bldg.txt\00"
define void @town_history() {
%1 = tail call i32 (...) @screen_save()
%2 = tail call i32 @show_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* null, i32 0, i32 0)
%3 = tail call i32 (...) @screen_load()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void store32(const uint8_t *p, uint32_t val) { *((uint32_t *)p) = (val); }


x86 assembly (clang, -O0):
<store32>:
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):
<store32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
int VBound(int, int, int /*<<< orphan*/);
int ComboAt(int x, int y) {
  x = VBound(x, 255, 0);
  y = VBound(y, 175, 0);
  return (y & 240) + (x >> 4);
}


x86 assembly (clang, -O0):
<ComboAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
xor    %edx,%edx
call   1030 <VBound@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xaf,%esi
xor    %edx,%edx
call   1030 <VBound@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComboAt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    $0xff,%esi
xor    %edx,%edx
call   1030 <VBound@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0xaf,%esi
xor    %edx,%edx
call   1030 <VBound@plt>
and    $0xf0,%eax
sar    $0x4,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ComboAt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @VBound(i32 %5, i32 255, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @VBound(i32 %7, i32 175, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = and i32 %9, 240
%11 = load i32, i32* %3
%12 = ashr i32 %11, 4
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ComboAt(i32 %0, i32 %1) {
%3 = tail call i32 @VBound(i32 %0, i32 255, i32 0)
%4 = tail call i32 @VBound(i32 %1, i32 175, i32 0)
%5 = and i32 %4, 240
%6 = ashr i32 %3, 4
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_14_recursive(double *, int);
void helper_double_14(double *buf) { helper_double_14_recursive(buf, 14); }


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

x86 assembly (clang, -O2):
<helper_double_14>:
mov    $0xe,%esi
jmp    1030 <helper_double_14_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_14(double* %0) {
%2 = tail call i32 @helper_double_14_recursive(double* %0, i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int unlockpt(int fd __attribute__((unused))) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockpt>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @unlockpt(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void quiterr(int code, char *s) {
  perror(s);
  exit(code);
}


x86 assembly (clang, -O0):
<quiterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quiterr>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quiterr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @quiterr(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @perror(i8* %1)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264aud_set_pic_type(uint8_t *p_h264aud, uint8_t i_type) {
  p_h264aud[4] = i_type << 5;
}


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

x86 assembly (clang, -O2):
<h264aud_set_pic_type>:
shl    $0x5,%esi
mov    %esi,0x10(%rdi)
ret

LLVM IR (-O0):
define void @h264aud_set_pic_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h264aud_set_pic_type(i32* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 5
%4 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int pow(int, int);
int pow2(int en, int dva) {
  int ret = pow(en, dva);
  return ret;
}


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

x86 assembly (clang, -O2):
<pow2>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define i32 @pow2(i32 %0, i32 %1) {
%3 = tail call i32 @pow(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void TSPluginInit(int argc, const char *argv[]) { foo(); }


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

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

LLVM IR (-O0):
define void @TSPluginInit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @TSPluginInit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
long _InterlockedExchange(long *, long);
long test_InterlockedExchange(long *Target, long Value) {
  return _InterlockedExchange(Target, Value);
}


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

x86 assembly (clang, -O2):
<test_InterlockedExchange>:
jmp    1030 <_InterlockedExchange@plt>

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

LLVM IR (-O2):
define i64 @test_InterlockedExchange(i64* %0, i64 %1) {
%3 = tail call i64 @_InterlockedExchange(i64* %0, i64 %1)
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
double log(double);
double scrypt_log2(uint32_t n) {
  double temp;
  temp = log(2);
  return (log((double)n) / temp);
}


x86 assembly (clang, -O0):
<scrypt_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
call   1030 <log@plt>
divsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_log2>:
push   %rax
cvtsi2sd %rdi,%xmm0
call   1030 <log@plt>
divsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @scrypt_log2(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = call double @log(double 2.000000e+00)
store double %4, double* %3
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to double
%7 = call double @log(double %6)
%8 = load double, double* %3
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @scrypt_log2(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = tail call double @log(double %2)
%4 = fdiv double %3, 0x3FE62E42FEFA39EF
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int trash_frame(uint8_t *payload, int size) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ queue_flag_set(int, struct request_queue *);
__attribute__((always_)) void blk_set_queue_full(struct request_queue *q,
                                                 int sync) {
  if (sync)
    queue_flag_set(3, q);
  else
    queue_flag_set(4, q);
}


x86 assembly (clang, -O0):
<blk_set_queue_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113c <blk_set_queue_full+0x2c>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
call   1030 <queue_flag_set@plt>
jmp    114a <blk_set_queue_full+0x3a>
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1030 <queue_flag_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blk_set_queue_full>:
mov    %rdi,%rax
cmp    $0x1,%esi
mov    $0x3,%edi
adc    $0x0,%edi
mov    %rax,%rsi
jmp    1030 <queue_flag_set@plt>

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

LLVM IR (-O2):
%struct.request_queue = type { i32 }
define void @blk_set_queue_full(%struct.request_queue* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 4, i32 3
%5 = tail call i32 @queue_flag_set(i32 %4, %struct.request_queue* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_multiline_string_literal(void) {
  __emit_string_literal_range("01234"
                              "56789",
                              4, 3, 6);
}


x86 assembly (clang, -O0):
<test_multiline_string_literal>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiline_string_literal>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @test_multiline_string_literal() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @test_multiline_string_literal() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_FREEZE;
scalar_t__ ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoFreeze(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_FREEZE) < 0)) {
    perror("VIDEO FREEZE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoFreeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    115b <videoFreeze+0x3b>
jmp    1173 <videoFreeze+0x53>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <videoFreeze+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoFreeze>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113b <videoFreeze+0x1b>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_FREEZE = global i32 0
@.str = [15 x i8] c"VIDEO FREEZE: \00"
define i32 @videoFreeze(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_FREEZE
%7 = call i64 @ioctl(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
br i1 %8, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@VIDEO_FREEZE = global i32 0
@.str = [15 x i8] c"VIDEO FREEZE: \00"
define i32 @videoFreeze(i32 %0) {
%2 = load i32, i32* @VIDEO_FREEZE
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
float RAND_MAX;
float rand();
int RandomInt(int max_value) {
  int result = (int)(((1.0f + max_value) / (1.0f + RAND_MAX)) * rand());
  return result <= max_value ? result : max_value;
}


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xed8(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0xecc(%rip),%xmm1
mov    0x2ead(%rip),%rax
addss  (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1179 <RandomInt+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117f <RandomInt+0x6f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
cvtsi2ss %edi,%xmm1
movss  0xedd(%rip),%xmm0
addss  %xmm0,%xmm1
mov    0x2eba(%rip),%rax
addss  (%rax),%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulss  0xc(%rsp),%xmm0
cvttss2si %xmm0,%eax
cmp    %ebx,%eax
cmovg  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define i32 @RandomInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = fadd float 1.000000e+00, %5
%7 = load float, float* @RAND_MAX
%8 = fadd float 1.000000e+00, %7
%9 = fdiv float %6, %8
%10 = call float (...) @rand()
%11 = fmul float %9, %10
%12 = fptosi float %11 to i32
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = load i32, i32* %3
br label %20
18: ; preds = %1
%19 = load i32, i32* %2
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define i32 @RandomInt(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fadd float %2, 1.000000e+00
%4 = load float, float* @RAND_MAX
%5 = fadd float %4, 1.000000e+00
%6 = fdiv float %3, %5
%7 = tail call float (...) @rand()
%8 = fmul float %7, %6
%9 = fptosi float %8 to i32
%10 = icmp sgt i32 %9, %0
%11 = select i1 %10, i32 %0, i32 %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OpcodeArgumentMustBeVariable(long p_position) {
  _Error(p_position, "Opcode argument must be a module variable");
}


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

x86 assembly (clang, -O2):
<Error_OpcodeArgumentMustBeVariable>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Opcode argument must be a module variable\00"
define void @Error_OpcodeArgumentMustBeVariable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Opcode argument must be a module variable\00"
define void @Error_OpcodeArgumentMustBeVariable(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int arrayArray(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[10] = {2, 3, 4, 5, 5, 6, 5, 4, 3, 2};
  int b[3] = {5, 6, 5};
  printf("%d", arrayArray(a, 10, b, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
mov    0xecd(%rip),%rax
mov    %rax,-0x3c(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rdx
mov    $0xa,%esi
mov    $0x3,%ecx
call   1030 <arrayArray@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xee2(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xecf(%rip),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rdx
mov    $0xa,%esi
mov    $0x3,%ecx
call   1030 <arrayArray@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 2, i32 3, i32 4, i32 5, i32 5, i32 6, i32 5, i32 4, i32 3, i32 2]
@__const.main.b = [3 x i32] [i32 5, i32 6, i32 5]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @arrayArray(i32* %5, i32 10, i32* %6, i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int foo(unsigned char *, int, unsigned char *, int);
void bar(unsigned char *w, unsigned char *x, int i, int *result) {
  *result = foo(w, 16, x, i);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x10,%esi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rcx,%rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x10,%esi
call   1030 <foo@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @bar(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 @foo(i8* %9, i32 16, i8* %10, i32 %11)
%13 = load i32*, i32** %8
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @bar(i8* %0, i8* %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @foo(i8* %0, i32 16, i8* %1, i32 %2)
store i32 %5, i32* %3
ret void
}
int foo(int n) {
  int i;
  for (i = 0; i < n; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <foo+0x2d>
jmp    111f <foo+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <foo+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
int main() {
  if (12)
    return 100;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 100
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_ARCH_PRCTL;
int ptrace(int /*<<< orphan*/, int, unsigned long, int);
int os_arch_prctl(int pid, int code, unsigned long *addr) {
  return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long)addr, code);
}


x86 assembly (clang, -O0):
<os_arch_prctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_arch_prctl>:
mov    %esi,%ecx
mov    %edi,%esi
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_ARCH_PRCTL = global i32 0
define i32 @os_arch_prctl(i32 %0, i32 %1, i64* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i32, i32* @PTRACE_ARCH_PRCTL
%8 = load i32, i32* %4
%9 = load i64*, i64** %6
%10 = ptrtoint i64* %9 to i64
%11 = load i32, i32* %5
%12 = call i32 @ptrace(i32 %7, i32 %8, i64 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@PTRACE_ARCH_PRCTL = global i32 0
define i32 @os_arch_prctl(i32 %0, i32 %1, i64* %2) {
%4 = load i32, i32* @PTRACE_ARCH_PRCTL
%5 = ptrtoint i64* %2 to i64
%6 = tail call i32 @ptrace(i32 %4, i32 %0, i64 %5, i32 %1)
ret i32 %6
}
void g_dataset_destroy() {}


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

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

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

LLVM IR (-O2):
define void @g_dataset_destroy() {
ret void
}
void fa107(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    }
  a:;
    int e[n];
    goto a;
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa107>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
jmp    1146 <fa107+0x46>

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

LLVM IR (-O0):
define void @fa107(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %7
%31 = alloca i32, i64 %29
store i64 %29, i64* %8
%32 = load i8*, i8** %7
br label %33
33: ; preds = %33, %1
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
%36 = alloca i32, i64 %35
store i64 %35, i64* %9
br label %33
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
%40 = call i8* @llvm.stacksave()
store i8* %40, i8** %10
%41 = alloca i32, i64 %39
store i64 %39, i64* %11
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
%44 = call i8* @llvm.stacksave()
store i8* %44, i8** %12
%45 = alloca i32, i64 %43
store i64 %43, i64* %13
%46 = load i8*, i8** %12
%47 = load i32, i32* %2
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %14
%50 = alloca i32, i64 %48
store i64 %48, i64* %15
%51 = load i8*, i8** %14
%52 = load i32, i32* %2
%53 = zext i32 %52 to i64
%54 = alloca i32, i64 %53
store i64 %53, i64* %16
%55 = load i8*, i8** %10
%56 = load i32, i32* %2
%57 = zext i32 %56 to i64
%58 = call i8* @llvm.stacksave()
store i8* %58, i8** %17
%59 = alloca i32, i64 %57
store i64 %57, i64* %18
%60 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa107(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int cdrom_start(int trk) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cdrom_start(i32 %0) {
ret i32 0
}
int fn7(int x[][2]) { return sizeof x; }


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

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

LLVM IR (-O0):
define i32 @fn7([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
ret i32 8
}

LLVM IR (-O2):
define i32 @fn7([2 x i32]* nocapture readnone %0) {
ret i32 8
}
float fdi_current_sense_gain(float rs, float ri, float ro, float rf, float rg) {
  return 1.0f / (rs * (ro / ri) * ((rg + rf) / rg));
}


x86 assembly (clang, -O0):
<fdi_current_sense_gain>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
mulss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
mulss  %xmm0,%xmm1
movss  0xeb5(%rip),%xmm0
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdi_current_sense_gain>:
addss  %xmm4,%xmm3
unpcklps %xmm3,%xmm2
unpcklps %xmm4,%xmm1
divps  %xmm1,%xmm2
mulss  %xmm2,%xmm0
shufps $0x55,%xmm2,%xmm2
mulss  %xmm0,%xmm2
movss  0xedf(%rip),%xmm0
divss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fdi_current_sense_gain(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %8
%13 = load float, float* %7
%14 = fdiv float %12, %13
%15 = fmul float %11, %14
%16 = load float, float* %10
%17 = load float, float* %9
%18 = fadd float %16, %17
%19 = load float, float* %10
%20 = fdiv float %18, %19
%21 = fmul float %15, %20
%22 = fdiv float 1.000000e+00, %21
ret float %22
}

LLVM IR (-O2):
define float @fdi_current_sense_gain(float %0, float %1, float %2, float %3, float %4) {
%6 = fadd float %3, %4
%7 = insertelement <2 x float> poison, float %2, i64 0
%8 = insertelement <2 x float> %7, float %6, i64 1
%9 = insertelement <2 x float> poison, float %1, i64 0
%10 = insertelement <2 x float> %9, float %4, i64 1
%11 = fdiv <2 x float> %8, %10
%12 = extractelement <2 x float> %11, i64 0
%13 = fmul float %12, %0
%14 = extractelement <2 x float> %11, i64 1
%15 = fmul float %13, %14
%16 = fdiv float 1.000000e+00, %15
ret float %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void teardown(void *fxtr) {
  FILE *file = (FILE *)fxtr;
  assert(file);
  fclose(file);
}


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

x86 assembly (clang, -O2):
<teardown>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @teardown(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @assert(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
define void @teardown(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @assert(i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}