xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_format_from_string() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_format_from_string"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sndfile_format_from_string>:
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_sndfile_format_from_string>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_sndfile_format_from_string\00"
define i32 @pa_sndfile_format_from_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ do_list_rules(int /*<<< orphan*/, int);
list_all_krules() { do_list_rules(0, 1); }


x86 assembly (clang, -O0):
<list_all_krules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <do_list_rules@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_all_krules>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <do_list_rules@plt>

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

LLVM IR (-O2):
define i32 @list_all_krules() {
%1 = tail call i32 @do_list_rules(i32 0, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main() {
  foo("l");
  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 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"l\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool isOdd(int number) { return number % 2 == 1 ? true : false; }


x86 assembly (clang, -O0):
<isOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOdd>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isOdd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
double baz(double foo, double bar) {
  return foo * foo * foo * foo * bar * bar * bar * bar;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @baz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = load double, double* %4
%17 = fmul double %15, %16
%18 = load double, double* %4
%19 = fmul double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @baz(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %3, %0
%5 = fmul double %4, %0
%6 = fmul double %5, %1
%7 = fmul double %6, %1
%8 = fmul double %7, %1
%9 = fmul double %8, %1
ret double %9
}
int kmain() {
  monitor_clear();
  monitor_write("My SO\n\n");
  gdt_init();
  idt_init();
  asm volatile("sti");
  asm volatile("int $0x3");
  asm volatile("int $0x4");
  init_keyboard();
  paging();
  while (1)
    ;
  return 1;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <monitor_clear@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1070 <monitor_write@plt>
mov    $0x0,%al
call   1080 <gdt_init@plt>
mov    $0x0,%al
call   1060 <idt_init@plt>
sti
int3
int    $0x4
mov    $0x0,%al
call   1050 <init_keyboard@plt>
mov    $0x0,%al
call   1030 <paging@plt>
jmp    1199 <kmain+0x39>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1040 <monitor_clear@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1070 <monitor_write@plt>
xor    %eax,%eax
call   1080 <gdt_init@plt>
xor    %eax,%eax
call   1060 <idt_init@plt>
sti
int3
int    $0x4
xor    %eax,%eax
call   1050 <init_keyboard@plt>
xor    %eax,%eax
call   1030 <paging@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    11a0 <kmain+0x40>

LLVM IR (-O0):
@.str = [8 x i8] c"My SO\0A\0A\00"
define i32 @kmain() {
%1 = call i32 (...) @monitor_clear()
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @monitor_write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gdt_init()
%4 = call i32 (...) @idt_init()
%5 = call i32 (...) @init_keyboard()
%6 = call i32 (...) @paging()
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"My SO\0A\0A\00"
define i32 @kmain() {
%1 = tail call i32 (...) @monitor_clear()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @monitor_write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @gdt_init()
%4 = tail call i32 (...) @idt_init()
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x4", "~{dirflag},~{fpsr},~{flags}"()
%5 = tail call i32 (...) @init_keyboard()
%6 = tail call i32 (...) @paging()
br label %7
7: ; preds = %0, %7
br label %7
}
/* Type definitions */
struct Pl_utl_bsema {
  int dummy;
};

/* Variables and functions */
scalar_t__ pl_utl_sema_i_create(int /*<<< orphan*/);
struct Pl_utl_bsema *pl_utl_bsema_i_create(void) {
  return (struct Pl_utl_bsema *)pl_utl_sema_i_create(0);
}


x86 assembly (clang, -O0):
<pl_utl_bsema_i_create>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pl_utl_sema_i_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_utl_bsema_i_create>:
xor    %edi,%edi
jmp    1030 <pl_utl_sema_i_create@plt>

LLVM IR (-O0):
%struct.Pl_utl_bsema = type { i32 }
define %struct.Pl_utl_bsema* @pl_utl_bsema_i_create() {
%1 = call i64 @pl_utl_sema_i_create(i32 0)
%2 = inttoptr i64 %1 to %struct.Pl_utl_bsema*
ret %struct.Pl_utl_bsema* %2
}

LLVM IR (-O2):
%struct.Pl_utl_bsema = type { i32 }
define %struct.Pl_utl_bsema* @pl_utl_bsema_i_create() {
%1 = tail call i64 @pl_utl_sema_i_create(i32 0)
%2 = inttoptr i64 %1 to %struct.Pl_utl_bsema*
ret %struct.Pl_utl_bsema* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
uint16_t chitcp_htons(uint16_t hostshort) { return htons(hostshort); }


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

x86 assembly (clang, -O2):
<chitcp_htons>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i32 @chitcp_htons(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fail_test() {
  printf("FAILED\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fail_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [8 x i8] c"FAILED\0A\00"
define void @fail_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"FAILED\00"
define void @fail_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int test_computed_goto(int);
int main(void) {
  assert(test_computed_goto(0) == 1234);
  assert(test_computed_goto(1) == 4567);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <test_computed_goto@plt>
cmp    $0x4d2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <test_computed_goto@plt>
cmp    $0x11d7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <test_computed_goto@plt>
xor    %edi,%edi
cmp    $0x4d2,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
call   1040 <test_computed_goto@plt>
xor    %edi,%edi
cmp    $0x11d7,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test_computed_goto(i32 0)
%3 = icmp eq i32 %2, 1234
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @test_computed_goto(i32 1)
%7 = icmp eq i32 %6, 4567
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_computed_goto(i32 0)
%2 = icmp eq i32 %1, 1234
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @test_computed_goto(i32 1)
%6 = icmp eq i32 %5, 4567
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
void yy_1_SectionsTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_SectionsTransient(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 @yy_1_SectionsTransient(i8* nocapture %0, i32 %1) {
ret void
}
void testptr2(char *aqi1, int *ahi1, long *asi1, long long *adi1, float *af1,
              double *ad1) {
  *aqi1 += 5;
  *ahi1 += 10;
  *asi1 += 11;
  *adi1 += 12;
  *af1 += 4.5;
  *ad1 += 5.5;
}


x86 assembly (clang, -O0):
<testptr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x5,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xa,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0xb,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0xc,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xe85(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testptr2>:
addb   $0x5,(%rdi)
addl   $0xa,(%rsi)
addq   $0xb,(%rdx)
addq   $0xc,(%rcx)
movss  (%r8),%xmm0
addss  0xee5(%rip),%xmm0
movss  %xmm0,(%r8)
movsd  (%r9),%xmm0
addsd  0xedb(%rip),%xmm0
movsd  %xmm0,(%r9)
ret

LLVM IR (-O0):
define void @testptr2(i8* %0, i32* %1, i64* %2, i64* %3, float* %4, double* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca float*
%12 = alloca double*
store i8* %0, i8** %7
store i32* %1, i32** %8
store i64* %2, i64** %9
store i64* %3, i64** %10
store float* %4, float** %11
store double* %5, double** %12
%13 = load i8*, i8** %7
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, 5
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 10
store i32 %20, i32* %18
%21 = load i64*, i64** %9
%22 = load i64, i64* %21
%23 = add nsw i64 %22, 11
store i64 %23, i64* %21
%24 = load i64*, i64** %10
%25 = load i64, i64* %24
%26 = add nsw i64 %25, 12
store i64 %26, i64* %24
%27 = load float*, float** %11
%28 = load float, float* %27
%29 = fpext float %28 to double
%30 = fadd double %29, 4.500000e+00
%31 = fptrunc double %30 to float
store float %31, float* %27
%32 = load double*, double** %12
%33 = load double, double* %32
%34 = fadd double %33, 5.500000e+00
store double %34, double* %32
ret void
}

LLVM IR (-O2):
define void @testptr2(i8* nocapture %0, i32* nocapture %1, i64* nocapture %2, i64* nocapture %3, float* nocapture %4, double* nocapture %5) {
%7 = load i8, i8* %0
%8 = add i8 %7, 5
store i8 %8, i8* %0
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 10
store i32 %10, i32* %1
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 11
store i64 %12, i64* %2
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 12
store i64 %14, i64* %3
%15 = load float, float* %4
%16 = fadd float %15, 4.500000e+00
store float %16, float* %4
%17 = load double, double* %5
%18 = fadd double %17, 5.500000e+00
store double %18, double* %5
ret void
}
/* Variables and functions */
float hipotenus(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a, b, c;
  printf("Enter a and b: ");
  scanf("%f%f", &a, &b);
  c = hipotenus(a, b);
  printf("C = %f", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <hipotenus@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
call   1030 <hipotenus@plt>
cvtss2sd %xmm0,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a and b: \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [7 x i8] c"C = %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call float @hipotenus(float %7, float %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a and b: \00"
@.str.1 = [5 x i8] c"%f%f\00"
@.str.2 = [7 x i8] c"C = %f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call float @hipotenus(float %7, float %8)
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}
int pdf_rc4_write(void *_ctx, char *in, char *out, int req) {
  int tmplen = 0;
  return tmplen;
}


x86 assembly (clang, -O0):
<pdf_rc4_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pdf_rc4_write(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
int fesetround(int round) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fesetround(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  x = 1 + 2;
  printf("%d\n", x);
  return 0;
}


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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
struct int96_num {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ int96_get_low64bit(struct int96_num const *);
int /*<<< orphan*/ int96_is_neg_int64(struct int96_num const *);
int64_t int96_extract_neg_int64(const struct int96_num *num) {
  assert(int96_is_neg_int64(num));
  return (int64_t)int96_get_low64bit(num);
}


x86 assembly (clang, -O0):
<int96_extract_neg_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <int96_is_neg_int64@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <int96_get_low64bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int96_extract_neg_int64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <int96_is_neg_int64@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <int96_get_low64bit@plt>

LLVM IR (-O0):
%struct.int96_num = type { i32 }
define i32 @int96_extract_neg_int64(%struct.int96_num* %0) {
%2 = alloca %struct.int96_num*
store %struct.int96_num* %0, %struct.int96_num** %2
%3 = load %struct.int96_num*, %struct.int96_num** %2
%4 = call i32 @int96_is_neg_int64(%struct.int96_num* %3)
%5 = call i32 @assert(i32 %4)
%6 = load %struct.int96_num*, %struct.int96_num** %2
%7 = call i32 @int96_get_low64bit(%struct.int96_num* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.int96_num = type { i32 }
define i32 @int96_extract_neg_int64(%struct.int96_num* %0) {
%2 = tail call i32 @int96_is_neg_int64(%struct.int96_num* %0)
%3 = tail call i32 @assert(i32 %2)
%4 = tail call i32 @int96_get_low64bit(%struct.int96_num* %0)
ret i32 %4
}
int reset_control_status(struct reset_control *rstc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_control = type opaque
define i32 @reset_control_status(%struct.reset_control* nocapture readnone %0) {
ret i32 0
}
void EEPROMIntDisable(unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(0x400FD010))) &= ~0x00000004;
  (*((volatile unsigned long *)(0x400AF040))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<EEPROMIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fd010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    $0x400fd010,%eax
mov    %rcx,(%rax)
mov    $0x400af040,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x400af040,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMIntDisable>:
andq   $0xfffffffffffffffb,0x400fd010
40 fb
andq   $0xfffffffffffffffe,0x400af040
40 fe
ret

LLVM IR (-O0):
define void @EEPROMIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%4 = and i64 %3, -5
store volatile i64 %4, i64* inttoptr (i64 1074778128 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%6 = and i64 %5, -2
store volatile i64 %6, i64* inttoptr (i64 1074458688 to i64*)
ret void
}

LLVM IR (-O2):
define void @EEPROMIntDisable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%3 = and i64 %2, -5
store volatile i64 %3, i64* inttoptr (i64 1074778128 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%5 = and i64 %4, -2
store volatile i64 %5, i64* inttoptr (i64 1074458688 to i64*)
ret void
}
int incr(int a) { return a + 1; }


x86 assembly (clang, -O0):
<incr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incr>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void test79_PrintImpl_printReal__E(float f) { printf("%f", (float)f); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @test79_PrintImpl_printReal__E(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fill_table(int, int **);
int /*<<< orphan*/ print_table(int, int **);
int read_input();
int main() {
  int width = read_input();
  int table[width][width];
  fill_table(width, table);
  print_table(width, table);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1050 <read_input@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rsi
sub    %rdx,%rsi
mov    %rsi,-0x28(%rbp)
mov    %rsi,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fill_table@plt>
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1030 <print_table@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <read_input@plt>
mov    %eax,%r14d
mov    %eax,%eax
imul   %rax,%rax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <fill_table@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1030 <print_table@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 (...) @read_input()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = mul nuw i64 %8, %10
%13 = alloca i32, i64 %12
store i64 %8, i64* %4
store i64 %10, i64* %5
%14 = load i32, i32* %2
%15 = bitcast i32* %13 to i32**
%16 = call i32 @fill_table(i32 %14, i32** %15)
%17 = load i32, i32* %2
%18 = bitcast i32* %13 to i32**
%19 = call i32 @print_table(i32 %17, i32** %18)
%20 = load i32, i32* @EXIT_SUCCESS
store i32 %20, i32* %1
%21 = load i8*, i8** %3
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @read_input()
%2 = zext i32 %1 to i64
%3 = mul nuw i64 %2, %2
%4 = alloca i32, i64 %3
%5 = bitcast i32* %4 to i32**
%6 = call i32 @fill_table(i32 %1, i32** %5)
%7 = call i32 @print_table(i32 %1, i32** %5)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Warning: You are not using glibc.\n");
  printf("This architecture is not officially supported.\n");
  printf("Consider yourself lucky if it works for you.\n");
  printf("Please do not complain if it does not.\n");
  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>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%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>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Warning: You are not using glibc.\0A\00"
@.str.1 = [48 x i8] c"This architecture is not officially supported.\0A\00"
@.str.2 = [46 x i8] c"Consider yourself lucky if it works for you.\0A\00"
@.str.3 = [40 x i8] c"Please do not complain if it does not.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Warning: You are not using glibc.\00"
@str.4 = [47 x i8] c"This architecture is not officially supported.\00"
@str.5 = [45 x i8] c"Consider yourself lucky if it works for you.\00"
@str.6 = [39 x i8] c"Please do not complain if it does not.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_screen_refresh();
int /*<<< orphan*/ roadmap_trip_set_focus(char *);
void roadmap_start_show_location(void) {
  roadmap_trip_set_focus("Address");
  roadmap_screen_refresh();
}


x86 assembly (clang, -O0):
<roadmap_start_show_location>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <roadmap_trip_set_focus@plt>
mov    $0x0,%al
call   1040 <roadmap_screen_refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_start_show_location>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <roadmap_trip_set_focus@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <roadmap_screen_refresh@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Address\00"
define void @roadmap_start_show_location() {
%1 = call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @roadmap_screen_refresh()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Address\00"
define void @roadmap_start_show_location() {
%1 = tail call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @roadmap_screen_refresh()
ret void
}
char *my_strcpy(char *s1, char *s2) {
  int i;
  i = 0;
  while (s2[i] != 0) {
    s1[i] = s2[i];
    i++;
  }
  s1[i] = 0;
  return (s1);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <my_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char line[80];
  fgets(line, 80, stdin);
  printf("Your quote was: %s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x60(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [19 x i8] c"Your quote was: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 80, i32 %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [19 x i8] c"Your quote was: %s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 80, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int test_imm_A5uint8_reg(unsigned char val) {
  return ((val) & (0xA5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A5uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A5uint8_reg>:
test   $0xa5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A5uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GetLine(char *, int, int /*<<< orphan*/);
long atol(char *);
long GetLong(void) {
  char s[20];
  GetLine(s, 18, 0);
  return (atol(s));
}


x86 assembly (clang, -O0):
<GetLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <GetLine@plt>
lea    -0x20(%rbp),%rdi
call   1040 <atol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLong>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <GetLine@plt>
mov    %rbx,%rdi
call   1040 <atol@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @GetLong() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 18, i32 0)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i64 @atol(i8* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @GetLong() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 18, i32 0)
%4 = call i64 @atol(i8* %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ log_enterexit_func(char *, char *, char const *);
void log_exit_ocall(const char *func) {
  log_enterexit_func("exit", "ocall", func);
}


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

x86 assembly (clang, -O2):
<log_exit_ocall>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <log_enterexit_func@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
@.str.1 = [6 x i8] c"ocall\00"
define void @log_exit_ocall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_enterexit_func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
@.str.1 = [6 x i8] c"ocall\00"
define void @log_exit_ocall(i8* %0) {
%2 = tail call i32 @log_enterexit_func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int rs232_close(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @rs232_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_error(char *msg) {
  printf("libcangjie_cli: %s\n", msg);
  printf("Try 'libcangjie_cli --help' for more information\n");
}


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

x86 assembly (clang, -O2):
<print_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"libcangjie_cli: %s\0A\00"
@.str.1 = [50 x i8] c"Try 'libcangjie_cli --help' for more information\0A\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"libcangjie_cli: %s\0A\00"
@str = [49 x i8] c"Try 'libcangjie_cli --help' for more information\00"
define void @print_error(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
int lckpwdf() { return 0; }


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

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

LLVM IR (-O0):
define i32 @lckpwdf() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lckpwdf() {
ret i32 0
}
/* Variables and functions */
int Mali_RdReg(int, int /*<<< orphan*/, int);
int Mali_read_JSn_register(int JSn_reg, int n) {
  int JSn_reg_final = 0x1000 | 0x800 | JSn_reg | (n * 128);
  int value_read = Mali_RdReg(0x20, 0, JSn_reg_final);
  return value_read;
}


x86 assembly (clang, -O0):
<Mali_read_JSn_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1800,%eax
mov    -0x8(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Mali_RdReg@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_read_JSn_register>:
mov    %esi,%edx
shl    $0x7,%edx
or     %edi,%edx
or     $0x1800,%edx
mov    $0x20,%edi
xor    %esi,%esi
jmp    1030 <Mali_RdReg@plt>

LLVM IR (-O0):
define i32 @Mali_read_JSn_register(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = or i32 6144, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 128
%11 = or i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @Mali_RdReg(i32 32, i32 0, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @Mali_read_JSn_register(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 7
%4 = or i32 %3, %0
%5 = or i32 %4, 6144
%6 = tail call i32 @Mali_RdReg(i32 32, i32 0, i32 %5)
ret i32 %6
}
int hidden_function() { return 7; }


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

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

LLVM IR (-O0):
define i32 @hidden_function() {
ret i32 7
}

LLVM IR (-O2):
define i32 @hidden_function() {
ret i32 7
}
/* Variables and functions */
scalar_t__ isdigit(char const);
int digitCount(const char *str) {
  int count = 0;
  while (*str) {
    if (isdigit(*str))
      count++;
    str++;
  }
  return count;
}


x86 assembly (clang, -O0):
<digitCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <digitCount+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     114f <digitCount+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <digitCount+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitCount>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114c <digitCount+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <digitCount+0x20>
jmp    114e <digitCount+0x3e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @digitCount(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = tail call i64 @isdigit(i8 signext %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_lroundf();
scalar_t__ lroundf(float);
void test_lroundf(float f) {
  if (lroundf(f) != lroundf(f))
    link_failure_lroundf();
}


x86 assembly (clang, -O0):
<test_lroundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <lroundf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <lroundf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_lroundf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_lroundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lroundf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <lroundf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <lroundf@plt>
cmp    %rax,%rbx
jne    1149 <test_lroundf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_lroundf@plt>

LLVM IR (-O0):
define void @test_lroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @lroundf(float %3)
%5 = load float, float* %2
%6 = call i64 @lroundf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_lroundf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_lroundf(float %0) {
%2 = tail call i64 @lroundf(float %0)
%3 = tail call i64 @lroundf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_lroundf()
br label %7
7: ; preds = %5, %1
ret void
}