xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *parent(void *arg) {
  printf("\n\tParent starting");
  printf("\n\tParent finishing");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0A\09Parent starting\00"
@.str.1 = [19 x i8] c"\0A\09Parent finishing\00"
define i8* @parent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A\09Parent starting\00"
@.str.1 = [19 x i8] c"\0A\09Parent finishing\00"
define noalias i8* @parent(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
void fons__tmpfree(void *ptr, void *up) {
  (void)ptr;
  (void)up;
}


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

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

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

LLVM IR (-O2):
define void @fons__tmpfree(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int main() {
  int d;
  scanf("%d", &d), printf("%.2lf\n", sqrt(d / 3.14));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
divsd  0xeae(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1162 <main+0x32>
sqrtsd %xmm0,%xmm0
jmp    1167 <main+0x37>
call   1050 <sqrt@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 3.140000e+00
%6 = call double @sqrt(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 3.140000e+00
%7 = call double @sqrt(double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display_wholelog();
int /*<<< orphan*/ fb_close();
scalar_t__ is_fb_available();
void do_cleanup(void) {
  if (is_fb_available())
    fb_close();
  display_wholelog();
}


x86 assembly (clang, -O0):
<do_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <is_fb_available@plt>
cmp    $0x0,%rax
je     114c <do_cleanup+0x1c>
mov    $0x0,%al
call   1030 <fb_close@plt>
mov    $0x0,%al
call   1040 <display_wholelog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cleanup>:
push   %rax
xor    %eax,%eax
call   1050 <is_fb_available@plt>
test   %rax,%rax
je     1144 <do_cleanup+0x14>
xor    %eax,%eax
call   1030 <fb_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <display_wholelog@plt>

LLVM IR (-O0):
define void @do_cleanup() {
%1 = call i64 (...) @is_fb_available()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @fb_close()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @display_wholelog()
ret void
}

LLVM IR (-O2):
define void @do_cleanup() {
%1 = tail call i64 (...) @is_fb_available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @fb_close()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @display_wholelog()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int endian(void) {
  union {
    uint32_t l;
    unsigned char c[sizeof(uint32_t)];
  } u;
  u.l = 0x12345678;
  return ((u.c[0] == 0x12) ? 1 : 0);
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x12345678,-0x8(%rbp)
movzbl -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x12,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 305419896, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 18
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian() {
ret i32 0
}
/* Variables and functions */
char *gnu_get_libc_version();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("The glibc is: %s", gnu_get_libc_version());
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"The glibc is: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* (...) @gnu_get_libc_version()
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"The glibc is: %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @gnu_get_libc_version()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void dump_fh(const char *data, int len) {
  (void)data;
  (void)len;
}


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

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

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

LLVM IR (-O2):
define void @dump_fh(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct bi_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bi_tree *);
void bi_tree_destroy(struct bi_tree *bi) { free(bi); }


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

x86 assembly (clang, -O2):
<bi_tree_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bi_tree = type { i32 }
define void @bi_tree_destroy(%struct.bi_tree* %0) {
%2 = alloca %struct.bi_tree*
store %struct.bi_tree* %0, %struct.bi_tree** %2
%3 = load %struct.bi_tree*, %struct.bi_tree** %2
%4 = call i32 @free(%struct.bi_tree* %3)
ret void
}

LLVM IR (-O2):
%struct.bi_tree = type { i32 }
define void @bi_tree_destroy(%struct.bi_tree* nocapture %0) {
%2 = tail call i32 @free(%struct.bi_tree* %0)
ret void
}
/* Variables and functions */
scalar_t__ scu_dsp_dma_busy();
void scu_dsp_dma_wait(void) {
  while ((scu_dsp_dma_busy()))
    ;
}


x86 assembly (clang, -O0):
<scu_dsp_dma_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <scu_dsp_dma_wait+0x9>
mov    $0x0,%al
call   1030 <scu_dsp_dma_busy@plt>
cmp    $0x0,%rax
je     112f <scu_dsp_dma_wait+0x1f>
jmp    1119 <scu_dsp_dma_wait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scu_dsp_dma_wait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <scu_dsp_dma_busy@plt>
test   %rax,%rax
jne    1120 <scu_dsp_dma_wait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @scu_dsp_dma_wait() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @scu_dsp_dma_busy()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @scu_dsp_dma_wait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @scu_dsp_dma_busy()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESSetDataLength(uint32_t length) {
  (*((volatile unsigned long *)(0x40024000 + 0x00000554))) = length;
  (*((volatile unsigned long *)(0x40024000 + 0x00000558))) = 0;
}


x86 assembly (clang, -O0):
<AESSetDataLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x40024554,%eax
mov    %rcx,(%rax)
mov    $0x40024558,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESSetDataLength>:
mov    %rdi,0x40024554
40
movq   $0x0,0x40024558
ret

LLVM IR (-O0):
define void @AESSetDataLength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073890644 to i64*)
store volatile i64 0, i64* inttoptr (i64 1073890648 to i64*)
ret void
}

LLVM IR (-O2):
define void @AESSetDataLength(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073890644 to i64*)
store volatile i64 0, i64* inttoptr (i64 1073890648 to i64*)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *xstrdup(char *s) {
  char *t;
  if (!s)
    return NULL;
  t = malloc(strlen(s) + 1);
  if (t) {
    strcpy(t, s);
  }
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118d <xstrdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1185 <xstrdup+0x55>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <xstrdup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <xstrdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <xstrdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %3, %8, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
long double asin(double);
__attribute__((weak)) long double asinl(long double x) {
  return asin((double)x);
}


x86 assembly (clang, -O0):
<asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <asin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <asin@plt>

LLVM IR (-O0):
define weak x86_fp80 @asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @asin(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @asinl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @asin(double %2)
ret x86_fp80 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash32_fmix(uint32_t x) {
  x = 0x85ebca6b * (x ^ (x >> 16));
  x = 0xc2b2ae35 * (x ^ (x >> 13));
  return x ^ (x >> 16);
}


x86 assembly (clang, -O0):
<hash32_fmix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xd,%ecx
xor    %ecx,%eax
imul   $0xc2b2ae35,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash32_fmix>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash32_fmix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 16
%6 = xor i32 %3, %5
%7 = mul i32 -2048144789, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = xor i32 %8, %10
%12 = mul i32 -1028477387, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 16
%16 = xor i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @hash32_fmix(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
size_t ntohl(int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int /*<<< orphan*/ *, int);
size_t ifo_get_len(int fd, int offset) {
  u_int ptr_len;
  size_t len;
  lseek(fd, offset, SEEK_SET);
  read(fd, &ptr_len, 4);
  len = ntohl(ptr_len);
  return len;
}


x86 assembly (clang, -O0):
<ifo_get_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0xc(%rbp),%edi
call   1050 <ntohl@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifo_get_len>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0xc(%rsp),%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <ntohl@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i64 @ifo_get_len(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @lseek(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @read(i32 %11, i32* %5, i32 4)
%13 = load i32, i32* %5
%14 = call i64 @ntohl(i32 %13)
store i64 %14, i64* %6
%15 = load i64, i64* %6
ret i64 %15
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i64 @ifo_get_len(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i32 %1, i32 %5)
%7 = call i32 @read(i32 %0, i32* %3, i32 4)
%8 = load i32, i32* %3
%9 = tail call i64 @ntohl(i32 %8)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ addToPref(char *, char *);
int /*<<< orphan*/ removeFromPref(char *);
void updatePrefs(char *flag, char *stringToAdd) {
  removeFromPref(flag);
  addToPref(flag, stringToAdd);
}


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

x86 assembly (clang, -O2):
<updatePrefs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <removeFromPref@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <addToPref@plt>

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

LLVM IR (-O2):
define void @updatePrefs(i8* %0, i8* %1) {
%3 = tail call i32 @removeFromPref(i8* %0)
%4 = tail call i32 @addToPref(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int chpri(int value) { return syscall(3, value, 0); }


x86 assembly (clang, -O0):
<chpri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chpri>:
mov    %edi,%esi
mov    $0x3,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chpri(i32 %0) {
%2 = tail call i32 @syscall(i32 3, i32 %0, i32 0)
ret i32 %2
}
int matrix_initialize_vector(double *output, double min_val, double max_val) {
  double i;
  int k = 0;
  for (i = min_val; i <= max_val; i++) {
    output[k] = (double)i;
    k++;
  }
}


x86 assembly (clang, -O0):
<matrix_initialize_vector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1169 <matrix_initialize_vector+0x69>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  0xea6(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1123 <matrix_initialize_vector+0x23>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_initialize_vector>:
ucomisd %xmm0,%xmm1
jb     1122 <matrix_initialize_vector+0x22>
movsd  0xef2(%rip),%xmm2
xchg   %ax,%ax
movsd  %xmm0,(%rdi)
addsd  %xmm2,%xmm0
add    $0x8,%rdi
ucomisd %xmm0,%xmm1
jae    1110 <matrix_initialize_vector+0x10>
ret

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

LLVM IR (-O2):
define i32 @matrix_initialize_vector(double* nocapture writeonly %0, double %1, double %2) {
%4 = fcmp ugt double %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ 0, %3 ]
%7 = phi double [ %10, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds double, double* %0, i64 %6
store double %7, double* %8
%9 = add nuw i64 %6, 1
%10 = fadd double %7, 1.000000e+00
%11 = fcmp ugt double %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret i32 undef
}
/* Variables and functions */
double ms20_filter_shape_gain(double);
double ms20_filter_shape(double clip_level, double x) {
  return x * ms20_filter_shape_gain(x / clip_level);
}


x86 assembly (clang, -O0):
<ms20_filter_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <ms20_filter_shape_gain@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms20_filter_shape>:
push   %rax
movapd %xmm1,%xmm2
movsd  %xmm1,(%rsp)
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <ms20_filter_shape_gain@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ms20_filter_shape(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = call double @ms20_filter_shape_gain(double %8)
%10 = fmul double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @ms20_filter_shape(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = tail call double @ms20_filter_shape_gain(double %3)
%5 = fmul double %4, %1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
usage() {
  fprintf(stderr, "Usage: pmf [ -dnsX2 ] [ -f startfile ] [ HOST [ PORT ] ]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: pmf [ -dnsX2 ] [ -f startfile ] [ HOST [ PORT ] ]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: pmf [ -dnsX2 ] [ -f startfile ] [ HOST [ PORT ] ]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ Elf32_Ehdr;

/* Variables and functions */
int is_image_valid(Elf32_Ehdr *hdr) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_image_valid(i32* nocapture readnone %0) {
ret i32 1
}
const char *td_jpeg_version(void) { return "none"; }


x86 assembly (clang, -O0):
<td_jpeg_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_jpeg_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
define i8* @td_jpeg_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @td_jpeg_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main() {
  unsigned int c = 0;
  for (; c <= 255; c++)
    printf("%d:%c\n", c, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
ja     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ule i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mem_init();
int /*<<< orphan*/ proc_init();
int /*<<< orphan*/ tlb_init();
void sim_init(void) {
  mem_init();
  proc_init();
  tlb_init();
}


x86 assembly (clang, -O0):
<sim_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mem_init@plt>
mov    $0x0,%al
call   1050 <proc_init@plt>
mov    $0x0,%al
call   1030 <tlb_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_init>:
push   %rax
xor    %eax,%eax
call   1040 <mem_init@plt>
xor    %eax,%eax
call   1050 <proc_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tlb_init@plt>

LLVM IR (-O0):
define void @sim_init() {
%1 = call i32 (...) @mem_init()
%2 = call i32 (...) @proc_init()
%3 = call i32 (...) @tlb_init()
ret void
}

LLVM IR (-O2):
define void @sim_init() {
%1 = tail call i32 (...) @mem_init()
%2 = tail call i32 (...) @proc_init()
%3 = tail call i32 (...) @tlb_init()
ret void
}
/* Variables and functions */
long double lgamma(double);
__attribute__((weak)) long double lgammal(long double x) {
  return lgamma((double)x);
}


x86 assembly (clang, -O0):
<lgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <lgamma@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammal>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <lgamma@plt>

LLVM IR (-O0):
define weak x86_fp80 @lgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @lgamma(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @lgammal(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @lgamma(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void inputArray(int len, int arr[len]) {
  for (int i = 0; i < len; ++i)
    scanf("%d", &arr[i]);
}


x86 assembly (clang, -O0):
<inputArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <inputArray+0x4b>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <inputArray+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputArray>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <inputArray+0x35>
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <inputArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @inputArray(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 = zext i32 %6 to i64
store i32 0, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @inputArray(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ LPI2C2_DriverIRQHandler();
__attribute__((weak)) void LPI2C2_IRQHandler(void) {
  LPI2C2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPI2C2_IRQHandler() {
%1 = call i32 (...) @LPI2C2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPI2C2_IRQHandler() {
%1 = tail call i32 (...) @LPI2C2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_standard_drop_variable_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(306, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_standard_drop_variable_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x132,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_standard_drop_variable_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x132,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_standard_drop_variable_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 306, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_standard_drop_variable_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 306, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t abs64(int64_t x) { return (x >= 0) ? x : -x; }


x86 assembly (clang, -O0):
<abs64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs64+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs64+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs64>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs64(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, t, s = 0, r;
  printf("Enter the number: ");
  scanf("%d", &n);
  printf("\nFactorial of the number is: %lld", fact(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"\0AFactorial of the number is: %lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @fact(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"\0AFactorial of the number is: %lld\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int do_204() { return 204; }


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

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

LLVM IR (-O0):
define i32 @do_204() {
ret i32 204
}

LLVM IR (-O2):
define i32 @do_204() {
ret i32 204
}
/* Variables and functions */
float *malloc(int);
float *six(const int *x) {
  float *p = malloc(sizeof(float));
  *p = (float)(*x);
  return p;
}


x86 assembly (clang, -O0):
<six>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<six>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
cvtsi2ssl (%rbx),%xmm0
movss  %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define float* @six(i32* %0) {
%2 = alloca i32*
%3 = alloca float*
store i32* %0, i32** %2
%4 = call float* @malloc(i32 4)
store float* %4, float** %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = load float*, float** %3
store float %7, float* %8
%9 = load float*, float** %3
ret float* %9
}

LLVM IR (-O2):
define noalias float* @six(i32* nocapture %0) {
%2 = tail call float* @malloc(i32 4)
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
store float %4, float* %2
ret float* %2
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t len) {
  void *new = malloc(len);
  if (!new)
    die("malloc() failed\n");
  return new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"malloc() failed\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"malloc() failed\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int u8_uctomb_aux(unsigned char *, unsigned int, int);
int u8_uctomb(unsigned char *s, unsigned int uc, int n) {
  if (uc < 0x80 && n > 0) {
    s[0] = uc;
    return 1;
  } else {
    return u8_uctomb_aux(s, uc, n);
  }
}


x86 assembly (clang, -O0):
<u8_uctomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x80,-0x14(%rbp)
jae    1150 <u8_uctomb+0x40>
cmpl   $0x0,-0x18(%rbp)
jle    1150 <u8_uctomb+0x40>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1162 <u8_uctomb+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <u8_uctomb_aux@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_uctomb>:
cmp    $0x7f,%esi
ja     1122 <u8_uctomb+0x12>
test   %edx,%edx
jle    1122 <u8_uctomb+0x12>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret
jmp    1030 <u8_uctomb_aux@plt>

LLVM IR (-O0):
define i32 @u8_uctomb(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 128
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %6
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
store i32 1, i32* %4
br label %23
18: ; preds = %10, %3
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @u8_uctomb_aux(i8* %19, i32 %20, i32 %21)
store i32 %22, i32* %4
br label %23
23: ; preds = %18, %13
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @u8_uctomb(i8* %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %1, 128
%5 = icmp sgt i32 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = trunc i32 %1 to i8
store i8 %8, i8* %0
br label %11
9: ; preds = %3
%10 = tail call i32 @u8_uctomb_aux(i8* %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 1, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ random();
int randint(int n) {
  return (int)(n * (double)random() / (1.0 + (double)0x7FFFFFFF));
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  (%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call i64 (...) @random()
%6 = sitofp i64 %5 to double
%7 = fmul double %4, %6
%8 = fdiv double %7, 0x41E0000000000000
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @randint(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = fmul double %2, %4
%6 = fmul double %5, 0x3E00000000000000
%7 = fptosi double %6 to i32
ret i32 %7
}
void vadd(float const *src1, float const *src2, float *dst) {
  {
    *(dst + 0) = (float)(*(src1 + 0) + *(src2 + 0));
    *(dst + 1) = (float)(*(src1 + 1) + *(src2 + 1));
    *(dst + 2) = (float)(*(src1 + 2) + *(src2 + 2));
    return;
  }
}


x86 assembly (clang, -O0):
<vadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadd>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vadd(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vadd(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}