xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ HTS_calloc(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *HTS_strdup(const char *string) {
  char *buff = (char *)HTS_calloc(strlen(string) + 1, sizeof(char));
  strcpy(buff, string);
  return buff;
}


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

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

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

LLVM IR (-O2):
define i8* @HTS_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @HTS_calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
short lowestSample(int n) { return 0xffc0; }


x86 assembly (clang, -O0):
<lowestSample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffc0,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowestSample>:
mov    $0xffc0,%ax
ret

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

LLVM IR (-O2):
define signext i16 @lowestSample(i32 %0) {
ret i16 -64
}
/* Variables and functions */
int test_if2(void) {
  if (0) {
    return 0;
  }
  return 'b';
}


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

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

LLVM IR (-O0):
define i32 @test_if2() {
ret i32 98
}

LLVM IR (-O2):
define i32 @test_if2() {
ret i32 98
}
void sav32word(workspace, val) unsigned char *workspace;
unsigned long val;
{
  unsigned long foo;
  register unsigned char *bleh;
  foo = val;
  bleh = (unsigned char *)&foo;
  workspace[0] = bleh[3];
  workspace[1] = bleh[2];
  workspace[2] = bleh[1];
  workspace[3] = bleh[0];
}


x86 assembly (clang, -O0):
<sav32word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x20(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sav32word>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @sav32word(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = lshr i64 %1, 24
%9 = trunc i64 %8 to i8
store i8 %9, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %5, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %12
ret void
}
void test_sizeof() {
  int arr[10];
  (void)sizeof arr[0];
  (void)sizeof(arr[0]);
  (void)sizeof(arr)[0];
}


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

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

LLVM IR (-O0):
define void @test_sizeof() {
%1 = alloca [10 x i32]
ret void
}

LLVM IR (-O2):
define void @test_sizeof() {
ret void
}
int PR14634(int x) {
  double y = (double)x;
  return !y;
}


x86 assembly (clang, -O0):
<PR14634>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR14634>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @PR14634(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp une double %6, 0.000000e+00
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @PR14634(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int max() {
  int x[10];
  int i;
  int ret;
  i = 0;
  while (i < 10) {
    x[i] = (i - 7) * (i - 7);
    i = i + 1;
  }
  i = 0;
  ret = -10;
  while (i < 10) {
    if (x[i] > ret)
      ret = x[i];
    i = i + 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    113a <max+0x3a>
mov    -0x34(%rbp),%ecx
sub    $0x7,%ecx
mov    -0x34(%rbp),%eax
sub    $0x7,%eax
imul   %eax,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110b <max+0xb>
movl   $0x0,-0x34(%rbp)
movl   $0xfffffff6,-0x38(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    117c <max+0x7c>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x38(%rbp),%eax
jle    116e <max+0x6e>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1148 <max+0x48>
mov    -0x38(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 7
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 7
%12 = mul nsw i32 %9, %11
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %14
store i32 %12, i32* %15
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %4
18: ; preds = %4
store i32 0, i32* %2
store i32 -10, i32* %3
br label %19
19: ; preds = %34, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 10
br i1 %21, label %22, label %37
22: ; preds = %19
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = load i32, i32* %3
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %31
%33 = load i32, i32* %32
store i32 %33, i32* %3
br label %34
34: ; preds = %29, %22
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %19
37: ; preds = %19
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @max() {
ret i32 49
}
/* Variables and functions */
int /*<<< orphan*/ test_bin_tree();
int main(int argc, char *argv[]) { test_bin_tree(); }


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   1030 <test_bin_tree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 i32 (...) @test_bin_tree()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_bin_tree()
ret i32 0
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(int, int, int);
void display() {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1, 40, 50);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%edi
mov    $0x28,%esi
mov    $0x32,%edx
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x1,%edi
mov    $0x28,%esi
mov    $0x32,%edx
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(i32 1, i32 40, i32 50)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(i32 1, i32 40, i32 50)
%6 = tail call i32 (...) @glFlush()
ret void
}
void *work(void *ptr) {
  int a;
  while (1) {
    a = 2;
  }
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
jmp    1108 <work+0x8>

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

LLVM IR (-O0):
define i8* @work(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %4
store i32 2, i32* %3
br label %4
}

LLVM IR (-O2):
define noalias i8* @work(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x26() {
  Assert_real((isalpha(38) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              195, ("isalpha should be 0 for &"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for &\00"
define void @t_isalpha_0x26() {
%1 = tail call i64 @isalpha(i32 38)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *compare_int_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_int_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_int_context() {
ret i8* null
}
int mvpstb_get_vid_pts(unsigned long long *vpts) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mvpstb_get_vid_pts(i64* nocapture readnone %0) {
ret i32 0
}
unsigned int minu(unsigned int a, unsigned int b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<minu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1121 <minu+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minu+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minu>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @minu(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int security_inode_permission(struct inode *inode, int mask) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @security_inode_permission(%struct.inode* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 3;
  int *p = &x;
  assert(*p == 3);
  *p = 2;
  assert(x == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x3,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpl   $0x2,-0x8(%rbp)
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
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_PP_list_of_alist_f(void *, int /*<<< orphan*/);
struct Cyc_List_List *Cyc_PP_list_of_alist(void *x) {
  return ({ Cyc_PP_list_of_alist_f(x, 0); });
}


x86 assembly (clang, -O0):
<Cyc_PP_list_of_alist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <Cyc_PP_list_of_alist_f@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_PP_list_of_alist>:
push   %rax
xor    %esi,%esi
call   1030 <Cyc_PP_list_of_alist_f@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_PP_list_of_alist(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @Cyc_PP_list_of_alist_f(i8* %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.Cyc_List_List*
ret %struct.Cyc_List_List* %8
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_PP_list_of_alist(i8* %0) {
%2 = tail call i32 @Cyc_PP_list_of_alist_f(i8* %0, i32 0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.Cyc_List_List*
ret %struct.Cyc_List_List* %4
}
int test_f30(int *v) {
  *v = 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<test_f30>:
movl   $0x1,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @test_f30(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret i32 0
}
double _XcmsModulo(value, base)
double value;
double base;
{
  auto double intpart;
  value /= base;
  value = _XcmsModuloF(value, &intpart);
  value *= base;
  return (value);
}


x86 assembly (clang, -O0):
<_XcmsModulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
mov    $0x1,%al
call   1030 <_XcmsModuloF@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XcmsModulo>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
divsd  %xmm1,%xmm0
lea    0x10(%rsp),%rdi
mov    $0x1,%al
call   1030 <_XcmsModuloF@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @_XcmsModulo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %7, %6
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 (double, double*, ...) bitcast (i32 (...)* @_XcmsModuloF to i32 (double, double*, ...)*)(double %9, double* %5)
%11 = sitofp i32 %10 to double
store double %11, double* %3
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fmul double %13, %12
store double %14, double* %3
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @_XcmsModulo(double %0, double %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = fdiv double %0, %1
%6 = call i32 (double, double*, ...) bitcast (i32 (...)* @_XcmsModuloF to i32 (double, double*, ...)*)(double %5, double* %3)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %1
ret double %8
}
double M2Ft(double M) {
  double F;
  F = M * (3.2808);
  return F;
}


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

x86 assembly (clang, -O2):
<M2Ft>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @M2Ft(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 3.280800e+00
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @M2Ft(double %0) {
%2 = fmul double %0, 3.280800e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fz_free(void *, void *);
void zfree(void *opaque, void *ptr) { fz_free(opaque, ptr); }


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

x86 assembly (clang, -O2):
<zfree>:
jmp    1030 <fz_free@plt>

LLVM IR (-O0):
define void @zfree(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
%7 = call i32 @fz_free(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @zfree(i8* %0, i8* %1) {
%3 = tail call i32 @fz_free(i8* %0, i8* %1)
ret void
}
int keyring_fetch_key_text(struct onak_dbctx *dbctx, const char *search,
                           struct openpgp_publickey **publickey) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.onak_dbctx = type opaque
%struct.openpgp_publickey = type opaque
define i32 @keyring_fetch_key_text(%struct.onak_dbctx* %0, i8* %1, %struct.openpgp_publickey** %2) {
%4 = alloca %struct.onak_dbctx*
%5 = alloca i8*
%6 = alloca %struct.openpgp_publickey**
store %struct.onak_dbctx* %0, %struct.onak_dbctx** %4
store i8* %1, i8** %5
store %struct.openpgp_publickey** %2, %struct.openpgp_publickey*** %6
ret i32 0
}

LLVM IR (-O2):
%struct.onak_dbctx = type opaque
%struct.openpgp_publickey = type opaque
define i32 @keyring_fetch_key_text(%struct.onak_dbctx* nocapture readnone %0, i8* nocapture readnone %1, %struct.openpgp_publickey** nocapture readnone %2) {
ret i32 0
}
char returning_the_letter(char letter) { return letter; }


x86 assembly (clang, -O0):
<returning_the_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @returning_the_letter(i8 returned signext %0) {
ret i8 %0
}
int str_len(char *f_str) {
  int count;
  for (count = 0; *(f_str + count) != '\0'; count++)
    ;
  return (count - 1);
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <str_len+0x37>
jmp    1129 <str_len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xfffffffe,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nsw i32 %9, -1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 92;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 92, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 92)
ret i32 0
}
/* Variables and functions */
float fast_log2(float const);
float fast_log10(const float val) { return fast_log2(val) / 3.312500f; }


x86 assembly (clang, -O0):
<fast_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fast_log2@plt>
movss  0xed1(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_log10>:
push   %rax
call   1030 <fast_log2@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fast_log10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fast_log2(float %3)
%5 = fdiv float %4, 3.312500e+00
ret float %5
}

LLVM IR (-O2):
define float @fast_log10(float %0) {
%2 = tail call float @fast_log2(float %0)
%3 = fdiv float %2, 3.312500e+00
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void cpu_write_u32(unsigned char *p, uint32_t val) { *((uint32_t *)p) = val; }


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

x86 assembly (clang, -O2):
<cpu_write_u32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @cpu_write_u32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_scale(float *, float *, float);
__attribute__((always_)) struct vec2 *
psvec2_scale(struct vec2 *result, struct vec2 *a, float scalar) {
  vec2_scale((float *)result, (float *)a, scalar);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <vec2_scale@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_scale>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_scale@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_scale(%struct.vec2* %0, %struct.vec2* %1, float %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca float
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store float %2, float* %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load float, float* %6
%12 = call i32 @vec2_scale(float* %8, float* %10, float %11)
%13 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %13
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_scale(%struct.vec2* returned %0, %struct.vec2* %1, float %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = tail call i32 @vec2_scale(float* %4, float* %5, float %2)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, unsigned long);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc0(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    errx(EXIT_FAILURE, "out of memory allocation %lu bytes",
         (unsigned long)size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <xmalloc0+0x3d>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <xmalloc0+0x2c>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
call   1030 <errx@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [35 x i8] c"out of memory allocation %lu bytes\00"
define i8* @xmalloc0(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 eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i64, i64* %2
%11 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
%14 = load i64, i64* %2
%15 = call i32 @memset(i8* %13, i32 0, i64 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [35 x i8] c"out of memory allocation %lu bytes\00"
define i8* @xmalloc0(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int __pctomb_mb_ucs4() { return (-1); }


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

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

LLVM IR (-O0):
define i32 @__pctomb_mb_ucs4() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @__pctomb_mb_ucs4() {
ret i32 -1
}
int getLength(char *string) {
  char *string2 = string;
  while (*string2 != '\0') {
    string2++;
  }
  return string2 - string;
}


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <getLength+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <getLength+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <getLength+0x10>
ret

LLVM IR (-O0):
define i32 @getLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @getLength(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ sqrt(float);
float lib3ds_vector_length(float c[3]) {
  return ((float)sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]));
}


x86 assembly (clang, -O0):
<lib3ds_vector_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib3ds_vector_length>:
push   %rax
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lib3ds_vector_length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call i64 @sqrt(float %23)
%25 = sitofp i64 %24 to float
ret float %25
}

LLVM IR (-O2):
define float @lib3ds_vector_length(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call i64 @sqrt(float %9)
%11 = sitofp i64 %10 to float
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
void function_use_stack() {
  char data[64 * 1024];
  memset(data, 1, sizeof(data));
}


x86 assembly (clang, -O0):
<function_use_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10000,%rsp
lea    -0x10000(%rbp),%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
call   1030 <memset@plt>
add    $0x10000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_use_stack>:
sub    $0x10008,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
call   1030 <memset@plt>
add    $0x10008,%rsp
ret

LLVM IR (-O0):
define void @function_use_stack() {
%1 = alloca [65536 x i8]
%2 = getelementptr inbounds [65536 x i8], [65536 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 1, i32 65536)
ret void
}

LLVM IR (-O2):
define void @function_use_stack() {
%1 = alloca [65536 x i8]
%2 = getelementptr inbounds [65536 x i8], [65536 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 1, i32 65536)
ret void
}
void fc203(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
    a:
      goto a;
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc203>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc203+0x7>

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

LLVM IR (-O0):
define void @fc203(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %1
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc203(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_();
void do0x10() { _I8080_(); }


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

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

LLVM IR (-O0):
define void @do0x10() {
%1 = call i32 (...) @_I8080_()
ret void
}

LLVM IR (-O2):
define void @do0x10() {
%1 = tail call i32 (...) @_I8080_()
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double Wtime_sec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec / 1e6;
}


x86 assembly (clang, -O0):
<Wtime_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wtime_sec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @Wtime_sec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @Wtime_sec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ zmalloc_free(void *);
void zmalloc_str_free(void *ptr) { zmalloc_free(ptr); }


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

x86 assembly (clang, -O2):
<zmalloc_str_free>:
jmp    1030 <zmalloc_free@plt>

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

LLVM IR (-O2):
define void @zmalloc_str_free(i8* %0) {
%2 = tail call i32 @zmalloc_free(i8* %0)
ret void
}
/* Variables and functions */
unsigned int swap_total_ram();
unsigned swap_validate_size(unsigned size) {
  unsigned ram_size;
  if (size < (8 << 20))
    return 0;
  size &= ~((8 << 20) - 1);
  ram_size = swap_total_ram();
  if (size > ram_size)
    return ram_size;
  return size;
}


x86 assembly (clang, -O0):
<swap_validate_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x800000,-0x8(%rbp)
jae    1134 <swap_validate_size+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1166 <swap_validate_size+0x56>
mov    -0x8(%rbp),%eax
and    $0xff800000,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <swap_total_ram@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1160 <swap_validate_size+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <swap_validate_size+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_validate_size>:
xor    %eax,%eax
cmp    $0x800000,%edi
jb     1132 <swap_validate_size+0x22>
push   %rbx
mov    %edi,%ebx
and    $0xff800000,%ebx
xor    %eax,%eax
call   1030 <swap_total_ram@plt>
cmp    %eax,%ebx
cmova  %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @swap_validate_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 8388608
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, -8388608
store i32 %10, i32* %3
%11 = call i32 (...) @swap_total_ram()
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp ugt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %19
17: ; preds = %8
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %15, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @swap_validate_size(i32 %0) {
%2 = icmp ult i32 %0, 8388608
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = and i32 %0, -8388608
%5 = tail call i32 (...) @swap_total_ram()
%6 = icmp ugt i32 %4, %5
%7 = select i1 %6, i32 %5, i32 %4
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int _pb_print_bits(long long *, int);
int _pb_print_bits_ll(long long value) {
  return _pb_print_bits(&value, sizeof(long long));
}


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

x86 assembly (clang, -O2):
<_pb_print_bits_ll>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <_pb_print_bits@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_pb_print_bits_ll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_pb_print_bits_ll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @_pb_print_bits(i64* %2, i32 8)
ret i32 %3
}