xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ MODULAR_EXPONENTIATION(int *, int *, int *);
void RSA_E(int *m, int *e, int *n) { MODULAR_EXPONENTIATION(m, e, n); }


x86 assembly (clang, -O0):
<RSA_E>:
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
mov    -0x18(%rbp),%rdx
call   1030 <MODULAR_EXPONENTIATION@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_E>:
jmp    1030 <MODULAR_EXPONENTIATION@plt>

LLVM IR (-O0):
define void @RSA_E(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @MODULAR_EXPONENTIATION(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @RSA_E(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @MODULAR_EXPONENTIATION(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sub_mnemonics(char *, char *);
void ListMnemonics(char *str) {
  char buf[10];
  memset(buf, 0, 10);
  sub_mnemonics(buf, str);
}


x86 assembly (clang, -O0):
<ListMnemonics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <sub_mnemonics@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListMnemonics>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <sub_mnemonics@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ListMnemonics(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 10)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sub_mnemonics(i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @ListMnemonics(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 10)
%5 = call i32 @sub_mnemonics(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_57(void) {
  { a_0_55(((((34)))), "] ?"); }
}


x86 assembly (clang, -O0):
<a_0_57>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_57>:
lea    0xee9(%rip),%rsi
mov    $0x22,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"] ?\00"
define void @a_0_57() {
%1 = call i32 @a_0_55(i32 34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"] ?\00"
define void @a_0_57() {
%1 = tail call i32 @a_0_55(i32 34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
double LengthMoon(double W, double Diamoon) {
  double Wi, D;
  if (Diamoon == 0)
    Diamoon = (15.541 / 60) * 2;
  Wi = W * 60;
  D = Diamoon * 60;
  return (D - 0.3 * (D + Wi) / 2.0 / Wi) / 60.0;
}


x86 assembly (clang, -O0):
<LengthMoon>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <LengthMoon+0x33>
jp     1133 <LengthMoon+0x33>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebb(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe96(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LengthMoon>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm2,%xmm0
xorpd  %xmm3,%xmm3
cmpeqsd %xmm1,%xmm3
mulsd  %xmm2,%xmm1
movsd  0xee7(%rip),%xmm4
andpd  %xmm3,%xmm4
andnpd %xmm1,%xmm3
orpd   %xmm3,%xmm4
movapd %xmm0,%xmm1
addsd  %xmm4,%xmm1
mulsd  0xed3(%rip),%xmm1
mulsd  0xed3(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm4,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LengthMoon(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0x3FE093BAA41CF1F0, double* %4
br label %10
10: ; preds = %9, %2
%11 = load double, double* %3
%12 = fmul double %11, 6.000000e+01
store double %12, double* %5
%13 = load double, double* %4
%14 = fmul double %13, 6.000000e+01
store double %14, double* %6
%15 = load double, double* %6
%16 = load double, double* %6
%17 = load double, double* %5
%18 = fadd double %16, %17
%19 = fmul double 3.000000e-01, %18
%20 = fdiv double %19, 2.000000e+00
%21 = load double, double* %5
%22 = fdiv double %20, %21
%23 = fsub double %15, %22
%24 = fdiv double %23, 6.000000e+01
ret double %24
}

LLVM IR (-O2):
define double @LengthMoon(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
%4 = fmul double %0, 6.000000e+01
%5 = fmul double %1, 6.000000e+01
%6 = select i1 %3, double 3.108200e+01, double %5
%7 = fadd double %4, %6
%8 = fmul double %7, 3.000000e-01
%9 = fmul double %8, 5.000000e-01
%10 = fdiv double %9, %4
%11 = fsub double %6, %10
%12 = fdiv double %11, 6.000000e+01
ret double %12
}
void xive_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @xive_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inputdata();
int /*<<< orphan*/ inputoptions();
void doinput() {
  inputoptions();
  inputdata();
}


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

x86 assembly (clang, -O2):
<doinput>:
push   %rax
xor    %eax,%eax
call   1040 <inputoptions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <inputdata@plt>

LLVM IR (-O0):
define void @doinput() {
%1 = call i32 (...) @inputoptions()
%2 = call i32 (...) @inputdata()
ret void
}

LLVM IR (-O2):
define void @doinput() {
%1 = tail call i32 (...) @inputoptions()
%2 = tail call i32 (...) @inputdata()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void startItFunHeader(const char *descr) { printf(" *\t- %s\n", descr); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c" *\09- %s\0A\00"
define void @startItFunHeader(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" *\09- %s\0A\00"
define void @startItFunHeader(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char tolower(char);
char *low_string(char *s) {
  char *hold = s;
  while (*s) {
    *s = tolower(*s);
    s++;
  }
  return hold;
}


x86 assembly (clang, -O0):
<low_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <low_string+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <low_string+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<low_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <low_string+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <low_string+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @low_string(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 = %9, %1
%6 = load i8*, i8** %2
%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** %2
%11 = load i8, i8* %10
%12 = call signext i8 @tolower(i8 signext %11)
%13 = load i8*, i8** %2
store i8 %12, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @low_string(i8* returned %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 signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%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 i8* %0
}
int fRound(float flt) { return (int)(flt + 0.5f); }


x86 assembly (clang, -O0):
<fRound>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fRound>:
addss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @fRound(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 5.000000e-01
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @fRound(float %0) {
%2 = fadd float %0, 5.000000e-01
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x74() {
  Assert_real((isascii(116)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              585, ("isascii should be 1 for t"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x74>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x249,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for t\00"
define void @t_isascii_0x74() {
%1 = call i32 @isascii(i32 116)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for t\00"
define void @t_isascii_0x74() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void light_handler(int avg) { printf("Light Value Average: %d\n", avg); }


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

x86 assembly (clang, -O2):
<light_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Light Value Average: %d\0A\00"
define void @light_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Light Value Average: %d\0A\00"
define void @light_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *p_gettext(char const *);
int /*<<< orphan*/ setup();
char *g_libintl_gettext(const char *msgid) {
  setup();
  return p_gettext(msgid);
}


x86 assembly (clang, -O0):
<g_libintl_gettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    -0x8(%rbp),%rdi
call   1030 <p_gettext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_libintl_gettext>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <setup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <p_gettext@plt>

LLVM IR (-O0):
define i8* @g_libintl_gettext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @setup()
%4 = load i8*, i8** %2
%5 = call i8* @p_gettext(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @g_libintl_gettext(i8* %0) {
%2 = tail call i32 (...) @setup()
%3 = tail call i8* @p_gettext(i8* %0)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_unaligned_le32(const uint8_t *buf) {
  return (uint32_t)buf[0] | ((uint32_t)buf[1] << 8) | ((uint32_t)buf[2] << 16) |
         ((uint32_t)buf[3] << 24);
}


x86 assembly (clang, -O0):
<get_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_le32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_unaligned_le32(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 3
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_unaligned_le32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, world.\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void kw2_msi_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @kw2_msi_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_dump(char *);
int main(int argc, char **argv) {
  clean_dump("./testdir");
  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)
lea    0xed3(%rip),%rdi
call   1030 <clean_dump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <clean_dump@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"./testdir\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 = call i32 @clean_dump(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"./testdir\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @clean_dump(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float pow(int, float);
float __exp10f(float x) { return pow(10, x); }


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

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

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

LLVM IR (-O2):
define float @__exp10f(float %0) {
%2 = tail call float @pow(i32 10, float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ Amstrad_PPI_Refresh();
int /*<<< orphan*/ ppi_write_port(int, int);
void PPI_WritePortB(int Data) {
  ppi_write_port(1, Data);
  Amstrad_PPI_Refresh();
}


x86 assembly (clang, -O0):
<PPI_WritePortB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <ppi_write_port@plt>
mov    $0x0,%al
call   1040 <Amstrad_PPI_Refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPI_WritePortB>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <ppi_write_port@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Amstrad_PPI_Refresh@plt>

LLVM IR (-O0):
define void @PPI_WritePortB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ppi_write_port(i32 1, i32 %3)
%5 = call i32 (...) @Amstrad_PPI_Refresh()
ret void
}

LLVM IR (-O2):
define void @PPI_WritePortB(i32 %0) {
%2 = tail call i32 @ppi_write_port(i32 1, i32 %0)
%3 = tail call i32 (...) @Amstrad_PPI_Refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const, char *);
char *strchr(char const *, char const);
int main() {
  const char str[] = "http://www.linkerist.com";
  const char ch = '.';
  char *ret;
  ret = strchr(str, ch);
  printf("string after '%c' is - '%s'\n", ch, ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x8(%rbp)
movb   $0x2e,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xe9f(%rip),%rdi
mov    $0x2e,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xede(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
lea    0xeca(%rip),%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [25 x i8] c"http://www.linkerist.com\00"
@.str = [29 x i8] c"string after '%c' is - '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca i8
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [25 x i8]* %2 to i8*
store i8 46, i8* %3
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%7 = call i8* @strchr(i8* %6, i8 signext 46)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [25 x i8] c"http://www.linkerist.com\00"
@.str = [29 x i8] c"string after '%c' is - '%s'\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i8* @strchr(i8* %2, i8 signext 46)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %3)
ret i32 0
}
void f2(int a, int b, ...) {
  __builtin_va_list ap;
  __builtin_va_start(ap, 10);
  __builtin_va_start(ap, a);
  __builtin_va_start(ap, b);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
test   %al,%al
je     1136 <f2+0x36>
movaps %xmm0,-0xa0(%rbp)
movaps %xmm1,-0x90(%rbp)
movaps %xmm2,-0x80(%rbp)
movaps %xmm3,-0x70(%rbp)
movaps %xmm4,-0x60(%rbp)
movaps %xmm5,-0x50(%rbp)
movaps %xmm6,-0x40(%rbp)
movaps %xmm7,-0x30(%rbp)
mov    %r9,-0xa8(%rbp)
mov    %r8,-0xb0(%rbp)
mov    %rcx,-0xb8(%rbp)
mov    %rdx,-0xc0(%rbp)
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xd0(%rbp),%rcx
mov    %rcx,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x10,-0x20(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x10,-0x20(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x10,-0x20(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x48,%rsp
mov    %rdx,-0x70(%rsp)
mov    %rcx,-0x68(%rsp)
mov    %r8,-0x60(%rsp)
mov    %r9,-0x58(%rsp)
test   %al,%al
je     1143 <f2+0x43>
movaps %xmm0,-0x50(%rsp)
movaps %xmm1,-0x40(%rsp)
movaps %xmm2,-0x30(%rsp)
movaps %xmm3,-0x20(%rsp)
movaps %xmm4,-0x10(%rsp)
movaps %xmm5,(%rsp)
movaps %xmm6,0x10(%rsp)
movaps %xmm7,0x20(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f2(i32 %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x %struct.__va_list_tag]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %5, i64 0, i64 0
%7 = bitcast %struct.__va_list_tag* %6 to i8*
%8 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %5, i64 0, i64 0
%9 = bitcast %struct.__va_list_tag* %8 to i8*
%10 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %5, i64 0, i64 0
%11 = bitcast %struct.__va_list_tag* %10 to i8*
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f2(i32 %0, i32 %1, ...) {
%3 = alloca [1 x %struct.__va_list_tag]
%4 = bitcast [1 x %struct.__va_list_tag]* %3 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int CreateDB(int argc, char **argv) {
  printf("Calling from CreateDB\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<CreateDB>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"Calling from CreateDB\00"
define i32 @CreateDB(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int print_b(char *buf, _Bool val) {
  return sprintf(buf, "%s", val ? "true" : "false");
}


x86 assembly (clang, -O0):
<print_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
and    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%cl
lea    0xed6(%rip),%rdx
lea    0xeca(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_b>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rcx
lea    0xee3(%rip),%rax
test   %esi,%esi
cmovne %rcx,%rax
mov    %rax,%rsi
call   1030 <stpcpy@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @print_b(i8* %0, i1 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = zext i1 %1 to i8
store i8 %5, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = trunc i8 %7 to i1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @print_b(i8* %0, i1 zeroext %1) {
%3 = select i1 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i8* @stpcpy(i8* %0, i8* %3)
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
void glVertexAttribDivisor(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttribDivisor() {
ret void
}
unsigned meet(const unsigned a, const unsigned b) { return b & a; }


x86 assembly (clang, -O0):
<meet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @meet(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
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @meet(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
int loaderGetInt(char *src) {
  int i;
  i = ((src[3] & 255) << 24) + ((src[2] & 255) << 16) + ((src[1] & 255) << 8) +
      (src[0] & 255);
  return i;
}


x86 assembly (clang, -O0):
<loaderGetInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loaderGetInt>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @loaderGetInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
%9 = shl i32 %8, 24
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = and i32 %13, 255
%15 = shl i32 %14, 16
%16 = add nsw i32 %9, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = and i32 %20, 255
%22 = shl i32 %21, 8
%23 = add nsw i32 %16, %22
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = and i32 %27, 255
%29 = add nsw i32 %23, %28
store i32 %29, i32* %3
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @loaderGetInt(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
unsigned int get_hash(void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned int key_hash(const void *key) {
  return get_hash(key, strlen((const char *)key));
}


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

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

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

LLVM IR (-O2):
define i32 @key_hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @get_hash(i8* %0, i32 %2)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xcrossing_display(void *_p) {
  return (void *)((XEvent *)_p)->xcrossing.display;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcrossing_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xcrossing_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xcrossing_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void av_fast_realloc() {}


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

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

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

LLVM IR (-O2):
define void @av_fast_realloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int, int);
int integers_equal_display_error(int left, int right) {
  const int equal = left == right;
  if (!equal) {
    print_error("%d != %d\n", left, right);
  }
  return equal;
}


x86 assembly (clang, -O0):
<integers_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114b <integers_equal_display_error+0x3b>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <print_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integers_equal_display_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    %esi,%edi
je     112b <integers_equal_display_error+0x1b>
lea    0xede(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <print_error@plt>
xor    %eax,%eax
cmp    %ebx,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d != %d\0A\00"
define i32 @integers_equal_display_error(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 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @print_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
br label %16
16: ; preds = %12, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d != %d\0A\00"
define i32 @integers_equal_display_error(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @print_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
void strength_test4(int *data) {
  int i;
  if (data[1]) {
    i = 2;
    goto here;
  }
  i = 0;
  do {
    i = i + 1;
  here:
    data[data[2]] = 2;
  } while (i * 21 < data[3]);
}


x86 assembly (clang, -O0):
<strength_test4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     1122 <strength_test4+0x22>
movl   $0x2,-0xc(%rbp)
jmp    1132 <strength_test4+0x32>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     1129 <strength_test4+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test4>:
mov    $0x2,%eax
xor    %ecx,%ecx
cmpl   $0x0,0x4(%rdi)
jne    1112 <strength_test4+0x12>
add    $0x1,%ecx
mov    %ecx,%eax
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%edx
mov    %eax,%ecx
cmp    0xc(%rdi),%edx
jl     110d <strength_test4+0xd>
ret

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

LLVM IR (-O2):
define void @strength_test4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1, %8
%6 = phi i32 [ %9, %8 ], [ 0, %1 ]
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 2, %1 ]
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = mul nsw i32 %9, 21
%15 = getelementptr inbounds i32, i32* %0, i64 3
%16 = load i32, i32* %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %5, label %18
18: ; preds = %8
ret void
}
int test_imm_C1int16_mem(short *val) {
  return ((*val) & (-0xC1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C1int16_mem>:
movzwl (%rdi),%eax
test   $0xff3f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -193
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  (void)printf("Hello, World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int _vscnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  int n;
  n = vsnprintf(buf, size, fmt, args);
  if (n <= 0) {
    return 0;
  }
  if (n < (int)size) {
    return n;
  }
  return (int)(size - 1);
}


x86 assembly (clang, -O0):
<_vscnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jg     1154 <_vscnprintf+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1179 <_vscnprintf+0x69>
mov    -0x28(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    %ecx,%eax
jge    116e <_vscnprintf+0x5e>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <_vscnprintf+0x69>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vscnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
lea    -0x1(%rbx),%edx
cmp    %ebx,%eax
cmovl  %eax,%edx
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_vscnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i32 @vsnprintf(i8* %11, i64 %12, i8* %13, i32 %14)
store i32 %15, i32* %10
%16 = load i32, i32* %10
%17 = icmp sle i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 0, i32* %5
br label %30
19: ; preds = %4
%20 = load i32, i32* %10
%21 = load i64, i64* %7
%22 = trunc i64 %21 to i32
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = load i32, i32* %10
store i32 %25, i32* %5
br label %30
26: ; preds = %19
%27 = load i64, i64* %7
%28 = sub i64 %27, 1
%29 = trunc i64 %28 to i32
store i32 %29, i32* %5
br label %30
30: ; preds = %26, %24, %18
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @_vscnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = trunc i64 %1 to i32
%7 = icmp slt i32 %5, %6
%8 = add i32 %6, -1
%9 = select i1 %7, i32 %5, i32 %8
%10 = icmp sgt i32 %5, 0
%11 = select i1 %10, i32 %9, i32 0
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(void *, size_t, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void read_file_offset(void *destination, FILE *file, long offset, size_t size) {
  fseek(file, offset, SEEK_SET);
  fread(destination, size, 1, file);
}


x86 assembly (clang, -O0):
<read_file_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file_offset>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %eax,%edx
call   1040 <fseek@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fread@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @read_file_offset(i8* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %6
%10 = load i64, i64* %7
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %9, i64 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %8
%15 = load i32*, i32** %6
%16 = call i32 @fread(i8* %13, i64 %14, i32 1, i32* %15)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @read_file_offset(i8* nocapture %0, i32* nocapture %1, i64 %2, i64 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %1, i64 %2, i32 %5)
%7 = tail call i32 @fread(i8* %0, i64 %3, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega_PB4_clear__E();
int /*<<< orphan*/ atmel_atmega_PB4_makeOutput__E();
void atmega_gpio_Test_01_pollen__ready__E() {
  atmel_atmega_PB4_clear__E();
  atmel_atmega_PB4_makeOutput__E();
}


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

x86 assembly (clang, -O2):
<atmega_gpio_Test_01_pollen__ready__E>:
push   %rax
xor    %eax,%eax
call   1030 <atmel_atmega_PB4_clear__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <atmel_atmega_PB4_makeOutput__E@plt>

LLVM IR (-O0):
define void @atmega_gpio_Test_01_pollen__ready__E() {
%1 = call i32 (...) @atmel_atmega_PB4_clear__E()
%2 = call i32 (...) @atmel_atmega_PB4_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @atmega_gpio_Test_01_pollen__ready__E() {
%1 = tail call i32 (...) @atmel_atmega_PB4_clear__E()
%2 = tail call i32 (...) @atmel_atmega_PB4_makeOutput__E()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int errno;
int pthread_mutex_destroy(int /*<<< orphan*/ *);
int tosMutex_destroy(pthread_mutex_t *mx) {
  int res = 0;
  res = pthread_mutex_destroy(mx);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosMutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <tosMutex_destroy+0x3c>
mov    -0xc(%rbp),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMutex_destroy>:
push   %rax
call   1030 <pthread_mutex_destroy@plt>
test   %eax,%eax
je     112a <tosMutex_destroy+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosMutex_destroy(i32* %0) {
%2 = tail call i32 @pthread_mutex_destroy(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* @errno
br label %5
5: ; preds = %4, %1
%6 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %6
}
void split(char **arr, char *str, const char *del) {}


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

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

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

LLVM IR (-O2):
define void @split(i8** nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}