xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  f(42);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 42)
ret i32 0
}
/* Variables and functions */
scalar_t__ as_int32(unsigned int);
extern unsigned greater_equal(unsigned a, unsigned b) {
  return as_int32(a) >= as_int32(b);
}


x86 assembly (clang, -O0):
<greater_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <as_int32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <as_int32@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <as_int32@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <as_int32@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setge  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @greater_equal(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 i64 @as_int32(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @as_int32(i32 %7)
%9 = icmp sge i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @greater_equal(i32 %0, i32 %1) {
%3 = tail call i64 @as_int32(i32 %0)
%4 = tail call i64 @as_int32(i32 %1)
%5 = icmp sge i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned char calculaColorMedio(unsigned char *pixel) {
  unsigned media = (*pixel + *(pixel + 1) + *(pixel + 2)) / 3;
  return (unsigned char)media;
}


x86 assembly (clang, -O0):
<calculaColorMedio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaColorMedio>:
movzbl (%rdi),%eax
movzbl 0x1(%rdi),%ecx
add    %eax,%ecx
movzbl 0x2(%rdi),%eax
add    %ecx,%eax
imul   $0xaaab,%eax,%eax
shr    $0x11,%eax
ret

LLVM IR (-O0):
define zeroext i8 @calculaColorMedio(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %6, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nsw i32 %11, %15
%17 = sdiv i32 %16, 3
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @calculaColorMedio(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = add nuw nsw i16 %6, %3
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i16
%11 = add nuw nsw i16 %7, %10
%12 = udiv i16 %11, 3
%13 = trunc i16 %12 to i8
ret i8 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ title;

/* Variables and functions */
int /*<<< orphan*/ format(char *, char *);
int /*<<< orphan*/ get_title(char *, int);
int /*<<< orphan*/ put_str(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void prt_welcome_guild(void) {
  char title[40];
  get_title(title, sizeof(title));
  put_str(format("Welcome to the Adventurer's Guild, %s.", title), 0, 0);
}


x86 assembly (clang, -O0):
<prt_welcome_guild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    $0x28,%esi
call   1050 <get_title@plt>
lea    -0x30(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <format@plt>
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <put_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prt_welcome_guild>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x28,%esi
call   1050 <get_title@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <format@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <put_str@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Welcome to the Adventurer's Guild, %s.\00"
define void @prt_welcome_guild() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_title(i8* %2, i32 40)
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%5 = call i32 @format(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @put_str(i32 %5, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Welcome to the Adventurer's Guild, %s.\00"
define void @prt_welcome_guild() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_title(i8* %2, i32 40)
%4 = call i32 @format(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @put_str(i32 %4, i32 0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ __asan_address_is_poisoned(char volatile *);
int main() {
  char tmp;
  if (__asan_address_is_poisoned((volatile char *)&tmp + 1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__asan_address_is_poisoned@plt>
cmp    $0x0,%rax
je     1142 <main+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <main+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsp),%rdi
call   1030 <__asan_address_is_poisoned@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = call i64 @__asan_address_is_poisoned(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
%2 = getelementptr inbounds i8, i8* %1, i64 1
%3 = call i64 @__asan_address_is_poisoned(i8* %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_66(void) {
  if (*(uint32_t *)0x10000130ul == 0xEul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xe,%rax
jne    1139 <errata_66+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_66+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_66+0x40>
jmp    1139 <errata_66+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_66() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 14
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_66() {
ret i32 1
}
float ctss_fast_cos_impl(const float x) {
  const float x2 = x * x;
  return 0.99940307f + x2 * (-0.49558072f + 0.03679168f * x2);
}


x86 assembly (clang, -O0):
<ctss_fast_cos_impl>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xeda(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xed2(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_fast_cos_impl>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ctss_fast_cos_impl(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 0x3FA2D65BE0000000, float %8, float 0xBFDFB79840000000)
%10 = call float @llvm.fmuladd.f32(float %7, float %9, float 0x3FEFFB1C20000000)
ret float %10
}

LLVM IR (-O2):
define float @ctss_fast_cos_impl(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0x3FA2D65BE0000000, float 0xBFDFB79840000000)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 0x3FEFFB1C20000000)
ret float %4
}
void feenv_nomask_test(const char *flag_name, int fe_exc) {}


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

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

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

LLVM IR (-O2):
define void @feenv_nomask_test(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_14() { pic_send_EOI_normal(14); }


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

x86 assembly (clang, -O2):
<isr_irq_14>:
mov    $0xe,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_14() {
%1 = call i32 @pic_send_EOI_normal(i32 14)
ret void
}

LLVM IR (-O2):
define void @isr_irq_14() {
%1 = tail call i32 @pic_send_EOI_normal(i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc2() {
  Assert_real((isascii(194) == 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_isascii.c",
              975, ("isascii should be 0 for 0xc2"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xc2>:
push   %rax
mov    $0xc2,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3cf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc2\00"
define void @t_isascii_0xc2() {
%1 = call i64 @isascii(i32 194)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc2\00"
define void @t_isascii_0xc2() {
%1 = tail call i64 @isascii(i32 194)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printstring_(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<printstring_>:
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):
<printstring_>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printstring_(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t ext_dev_read_8(uint32_t addr, void *ctxt) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ext_dev_read_8(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ command;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int write(int, unsigned char *, int);
void writeResetToDefaults(int fd) {
  unsigned char command[] = "$PMTK104*37\r\n";
  if (write(fd, command, sizeof(command)) == -1) {
    printf("error writing\n");
    perror("perror writing");
  }
}


x86 assembly (clang, -O0):
<writeResetToDefaults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    118c <writeResetToDefaults+0x5c>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeResetToDefaults>:
sub    $0x18,%rsp
movabs $0xa0d37332a3430,%rax
mov    %rax,0xe(%rsp)
movabs $0x3430314b544d5024,%rax
31 30 34
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xe,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
je     116b <writeResetToDefaults+0x3b>
add    $0x18,%rsp
ret
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
add    $0x18,%rsp
jmp    1050 <perror@plt>

LLVM IR (-O0):
@__const.writeResetToDefaults.command = [14 x i8] c"$PMTK104*37\0D\0A\00"
@.str = [15 x i8] c"error writing\0A\00"
@.str.1 = [15 x i8] c"perror writing\00"
define void @writeResetToDefaults(i32 %0) {
%2 = alloca i32
%3 = alloca [14 x i8]
store i32 %0, i32* %2
%4 = bitcast [14 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 14)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@__const.writeResetToDefaults.command = [14 x i8] c"$PMTK104*37\0D\0A\00"
@.str.1 = [15 x i8] c"perror writing\00"
@str = [14 x i8] c"error writing\00"
define void @writeResetToDefaults(i32 %0) {
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 14)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Disable_Wrap(int);
int /*<<< orphan*/ Enable_Wrap(int);
void CwLnx_linewrap(int fd, int on) {
  if (on)
    Enable_Wrap(fd);
  else
    Disable_Wrap(fd);
}


x86 assembly (clang, -O0):
<CwLnx_linewrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1145 <CwLnx_linewrap+0x25>
mov    -0x4(%rbp),%edi
call   1030 <Enable_Wrap@plt>
jmp    114d <CwLnx_linewrap+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <Disable_Wrap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CwLnx_linewrap>:
test   %esi,%esi
je     1129 <CwLnx_linewrap+0x9>
jmp    1030 <Enable_Wrap@plt>
jmp    1040 <Disable_Wrap@plt>

LLVM IR (-O0):
define void @CwLnx_linewrap(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @Enable_Wrap(i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 @Disable_Wrap(i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @CwLnx_linewrap(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @Enable_Wrap(i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @Disable_Wrap(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
void clear_task_ebb(struct task_struct *t) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @clear_task_ebb(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @clear_task_ebb(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double calculate_tax(int);
void test2(void) { assert(70.0 == calculate_tax(2700)); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa8c,%edi
call   1030 <calculate_tax@plt>
movaps %xmm0,%xmm1
movsd  0xec7(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    $0xa8c,%edi
call   1030 <calculate_tax@plt>
cmpeqsd 0xecc(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test2() {
%1 = call double @calculate_tax(i32 2700)
%2 = fcmp oeq double 7.000000e+01, %1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = tail call double @calculate_tax(i32 2700)
%2 = fcmp oeq double %1, 7.000000e+01
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
int ft_toupper(int c) {
  if (c < 123 && c > 96)
    c -= 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7b,-0x4(%rbp)
jge    1124 <ft_toupper+0x24>
cmpl   $0x60,-0x4(%rbp)
jle    1124 <ft_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int getch();
int PlatformGetCharacter() { return getch(); }


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

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

LLVM IR (-O0):
define i32 @PlatformGetCharacter() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @PlatformGetCharacter() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
float mylog2(x)
double x;
{
  double log();
  return ((float)(log(x) / log((double)2.0)));
}


x86 assembly (clang, -O0):
<mylog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylog2>:
push   %rax
call   1030 <log@plt>
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @mylog2(double %0) {
%2 = tail call double @log(double %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
void *__builtin_memcpy(void *, void const *, size_t);
void *rte_memcpy(void *dst, const void *src, size_t n) {
  return __builtin_memcpy(dst, src, n);
}


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

x86 assembly (clang, -O2):
<rte_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @rte_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @rte_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ prune_arrblk_eq_CAF(int *);
void call_prune_arrblk_eq_Ok() {
  int *x = (int *)malloc(sizeof(int) * 5);
  prune_arrblk_eq_CAF(x);
}


x86 assembly (clang, -O0):
<call_prune_arrblk_eq_Ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <prune_arrblk_eq_CAF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_arrblk_eq_Ok>:
push   %rax
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <prune_arrblk_eq_CAF@plt>

LLVM IR (-O0):
define void @call_prune_arrblk_eq_Ok() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 20)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @prune_arrblk_eq_CAF(i32* %4)
ret void
}

LLVM IR (-O2):
define void @call_prune_arrblk_eq_Ok() {
%1 = tail call i64 @malloc(i32 20)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @prune_arrblk_eq_CAF(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *path_get_nwjs_cache();
char *string_concat(int, char *, char *);
char *getAppListPath() {
  char *dirPath = path_get_nwjs_cache();
  char *listPath = string_concat(2, dirPath, "../appList");
  free(dirPath);
  return listPath;
}


x86 assembly (clang, -O0):
<getAppListPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <path_get_nwjs_cache@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
lea    0xead(%rip),%rdx
call   1050 <string_concat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAppListPath>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <path_get_nwjs_cache@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdx
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <string_concat@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"../appList\00"
define i8* @getAppListPath() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @path_get_nwjs_cache()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @string_concat(i32 2, i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %2
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"../appList\00"
define i8* @getAppListPath() {
%1 = tail call i8* (...) @path_get_nwjs_cache()
%2 = tail call i8* @string_concat(i32 2, i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @free(i8* %1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_num_bits(int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_print_fp(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void BN_print_0(BIGNUM *num) {
  int bits = BN_num_bits(num);
  if ((bits - 1) % 8 <= 3)
    putchar('0');
  BN_print_fp(stdout, num);
}


x86 assembly (clang, -O0):
<BN_print_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BN_num_bits@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jg     1169 <BN_print_0+0x39>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1050 <BN_print_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_print_0>:
push   %rbx
mov    %rdi,%rbx
call   1040 <BN_num_bits@plt>
lea    -0x1(%rax),%ecx
lea    0x6(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffff8,%edx
neg    %edx
add    %edx,%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
jg     115d <BN_print_0+0x2d>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <BN_print_fp@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @BN_print_0(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @BN_num_bits(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = srem i32 %7, 8
%9 = icmp sle i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @putchar(i32 48)
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* @stdout
%14 = load i32*, i32** %2
%15 = call i32 @BN_print_fp(i32 %13, i32* %14)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @BN_print_0(i32* %0) {
%2 = tail call i32 @BN_num_bits(i32* %0)
%3 = add nsw i32 %2, -1
%4 = srem i32 %3, 8
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i32 48)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* @stdout
%10 = tail call i32 @BN_print_fp(i32 %9, i32* %0)
ret void
}
/* Variables and functions */
int epoll_create(int);
int aqcreate() { return epoll_create(1); }


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

x86 assembly (clang, -O2):
<aqcreate>:
mov    $0x1,%edi
jmp    1030 <epoll_create@plt>

LLVM IR (-O0):
define i32 @aqcreate() {
%1 = call i32 @epoll_create(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @aqcreate() {
%1 = tail call i32 @epoll_create(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_thread_get_name() {
  printf("NOT IMPLEMENTED:"
         "pa_thread_get_name"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_thread_get_name\00"
define i32 @pa_thread_get_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double log(double);
double interv2cents(double interv) { return 1200.0 * (log(interv) / log(2.0)); }


x86 assembly (clang, -O0):
<interv2cents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xed4(%rip),%xmm0
call   1030 <log@plt>
movsd  -0x10(%rbp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interv2cents>:
push   %rax
call   1030 <log@plt>
divsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @interv2cents(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = call double @log(double 2.000000e+00)
%6 = fdiv double %4, %5
%7 = fmul double 1.200000e+03, %6
ret double %7
}

LLVM IR (-O2):
define double @interv2cents(double %0) {
%2 = tail call double @log(double %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
%4 = fmul double %3, 1.200000e+03
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Beware the Idea of March!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Beware the Idea of March!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Beware the Idea of March!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank7Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank7();
void vrc2_4_setParamsEXX2(uint16_t addr, uint8_t val) {
  __setCHRBank7Low(addr, val);
  vrc2_4_SetChrROMBank7();
}


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

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

LLVM IR (-O0):
define void @vrc2_4_setParamsEXX2(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 @__setCHRBank7Low(i32 %5, i32 %6)
%8 = call i32 (...) @vrc2_4_SetChrROMBank7()
ret void
}

LLVM IR (-O2):
define void @vrc2_4_setParamsEXX2(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank7Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank7()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void troca(int *end_x, int *end_y) {
  int aux;
  aux = *end_x;
  *end_x = *end_y;
  *end_y = aux;
  printf("Dentro da funcao troca: x = %d, y = %d\n", *end_x, *end_y);
}


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

x86 assembly (clang, -O2):
<troca>:
mov    (%rdi),%edx
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    %edx,(%rsi)
mov    (%rdi),%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Dentro da funcao troca: x = %d, y = %d\0A\00"
define void @troca(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Dentro da funcao troca: x = %d, y = %d\0A\00"
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
%5 = load i32, i32* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %3)
ret void
}
/* Variables and functions */
char *rr_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *salloc(char *str) {
  char *copy = rr_malloc(strlen(str) + 1);
  strcpy(copy, str);
  return (copy);
}


x86 assembly (clang, -O0):
<salloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <rr_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<salloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1040 <rr_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @salloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @rr_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @salloc(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @rr_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeb {
  int dummy;
};

/* Variables and functions */
int ftime(struct timeb *fb) {
  int rc;
  time_t sec;
  time_t milli;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.timeb = type { i32 }
define i32 @ftime(%struct.timeb* %0) {
%2 = alloca %struct.timeb*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store %struct.timeb* %0, %struct.timeb** %2
ret i32 0
}

LLVM IR (-O2):
%struct.timeb = type { i32 }
define i32 @ftime(%struct.timeb* nocapture readnone %0) {
ret i32 0
}
long long sssu() { return 0xffffffffffff7fffLL; }


x86 assembly (clang, -O0):
<sssu>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffff7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sssu>:
mov    $0xffffffffffff7fff,%rax
ret

LLVM IR (-O0):
define i64 @sssu() {
ret i64 -32769
}

LLVM IR (-O2):
define i64 @sssu() {
ret i64 -32769
}
void INT_Excep_TPU9_TGI9B(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU9_TGI9B() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int kbhit(void) {
  int ch;
  ch = getchar();
  if (ch != EOF) {
    ungetc(ch, stdin);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%eax
je     1161 <kbhit+0x41>
mov    -0x8(%rbp),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <kbhit+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     114a <kbhit+0x2a>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <ungetc@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
define i32 @kbhit() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load i32, i32* @stdin
%6 = tail call i32 @ungetc(i32 %1, i32 %5)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %8
}
int is_prime(int n) {
  if (n < 2)
    return 0;
  int i;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <is_prime+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <is_prime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <is_prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <is_prime+0x66>
jmp    1151 <is_prime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <is_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %5, %7, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %13
}
void aa_free_rlimit_rules(struct aa_rlimit *rlims) {}


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

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

LLVM IR (-O0):
%struct.aa_rlimit = type opaque
define void @aa_free_rlimit_rules(%struct.aa_rlimit* %0) {
%2 = alloca %struct.aa_rlimit*
store %struct.aa_rlimit* %0, %struct.aa_rlimit** %2
ret void
}

LLVM IR (-O2):
%struct.aa_rlimit = type opaque
define void @aa_free_rlimit_rules(%struct.aa_rlimit* nocapture %0) {
ret void
}
__attribute__((always_)) void __init_work(struct work_struct *work,
                                          int onstack) {}


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

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

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

LLVM IR (-O2):
%struct.work_struct = type opaque
define void @__init_work(%struct.work_struct* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int accept(int /*<<< orphan*/);
scalar_t__ notzero();
int /*<<< orphan*/ raw();
bool number(void) {
  if (notzero()) {
    raw();
    return true;
  } else
    return accept('0');
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <notzero@plt>
cmp    $0x0,%rax
je     115c <number+0x2c>
mov    $0x0,%al
call   1040 <raw@plt>
movl   $0x1,-0x4(%rbp)
jmp    1169 <number+0x39>
mov    $0x30,%edi
call   1050 <accept@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %rax
xor    %eax,%eax
call   1030 <notzero@plt>
test   %rax,%rax
je     114b <number+0x1b>
xor    %eax,%eax
call   1040 <raw@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x30,%edi
pop    %rax
jmp    1050 <accept@plt>

LLVM IR (-O0):
define i32 @number() {
%1 = alloca i32
%2 = call i64 (...) @notzero()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @raw()
store i32 1, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @accept(i32 48)
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @number() {
%1 = tail call i64 (...) @notzero()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @raw()
br label %7
5: ; preds = %0
%6 = tail call i32 @accept(i32 48)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 1, %3 ], [ %6, %5 ]
ret i32 %8
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  if (s && f) {
    i = 0;
    while (s[i] != '\0') {
      f(i, &s[i]);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <ft_striteri+0x67>
cmpq   $0x0,-0x10(%rbp)
je     1167 <ft_striteri+0x67>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <ft_striteri+0x62>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_striteri+0x2d>
jmp    1167 <ft_striteri+0x67>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striteri+0x33>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
xor    %ebx,%ebx
mov    %r15,%rsi
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %14, %9 ], [ %0, %6 ]
%11 = phi i32 [ %12, %9 ], [ 0, %6 ]
tail call void %1(i32 %11, i8* %10)
%12 = add i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}