xunge/DecIR huggingface dataset:
/* Variables and functions */
int stricmp(char *, char *);
int SectSorter(const void *p1, const void *p2) {
  char **s1 = (char **)p1;
  char **s2 = (char **)p2;
  return stricmp(*s1, *s2);
}


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

x86 assembly (clang, -O2):
<SectSorter>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <stricmp@plt>

LLVM IR (-O0):
define i32 @SectSorter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @stricmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @SectSorter(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @stricmp(i8* %5, i8* %6)
ret i32 %7
}
/* Variables and functions */
float logf(float);
float nv_rand();
float sinf(float);
float sqrtf(float);
float nv_gaussian_rand(float average, float variance) {
  float a = nv_rand();
  float b = nv_rand();
  return sqrtf(-2.0f * logf(a)) * sinf(2.0f * 3.1415926f * b) * variance +
         average;
}


x86 assembly (clang, -O0):
<nv_gaussian_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1050 <nv_rand@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <nv_rand@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <logf@plt>
movaps %xmm0,%xmm1
movss  0xe85(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1060 <sqrtf@plt>
movss  %xmm0,-0x14(%rbp)
movss  0xe6b(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nv_gaussian_rand>:
sub    $0x18,%rsp
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
xor    %eax,%eax
call   1050 <nv_rand@plt>
movss  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <nv_rand@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <logf@plt>
mulss  0xe83(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     118b <nv_gaussian_rand+0x4b>
sqrtss %xmm0,%xmm0
jmp    1190 <nv_gaussian_rand+0x50>
call   1060 <sqrtf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
mulss  0xe60(%rip),%xmm0
call   1030 <sinf@plt>
mulss  0x8(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @nv_gaussian_rand(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = call float (...) @nv_rand()
store float %7, float* %5
%8 = call float (...) @nv_rand()
store float %8, float* %6
%9 = load float, float* %5
%10 = call float @logf(float %9)
%11 = fmul float -2.000000e+00, %10
%12 = call float @sqrtf(float %11)
%13 = load float, float* %6
%14 = fmul float 0x401921FB40000000, %13
%15 = call float @sinf(float %14)
%16 = fmul float %12, %15
%17 = load float, float* %4
%18 = load float, float* %3
%19 = call float @llvm.fmuladd.f32(float %16, float %17, float %18)
ret float %19
}

LLVM IR (-O2):
define float @nv_gaussian_rand(float %0, float %1) {
%3 = tail call float (...) @nv_rand()
%4 = tail call float (...) @nv_rand()
%5 = tail call float @logf(float %3)
%6 = fmul float %5, -2.000000e+00
%7 = tail call float @sqrtf(float %6)
%8 = fmul float %4, 0x401921FB40000000
%9 = tail call float @sinf(float %8)
%10 = fmul float %7, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %1, float %0)
ret float %11
}
unsigned long XDisplayMotionBufferSize() {}


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

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

LLVM IR (-O0):
define i64 @XDisplayMotionBufferSize() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @XDisplayMotionBufferSize() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ paint_it(char const *, char *);
void cyan(const char *string) { paint_it(string, "\x1b[0;36m"); }


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

x86 assembly (clang, -O2):
<cyan>:
lea    0xee9(%rip),%rsi
jmp    1030 <paint_it@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;36m\00"
define void @cyan(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @paint_it(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;36m\00"
define void @cyan(i8* %0) {
%2 = tail call i32 @paint_it(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int pm8901_mpp_config(unsigned mpp, unsigned type, unsigned level,
                      unsigned control) {
  return -22;
}


x86 assembly (clang, -O0):
<pm8901_mpp_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0xffffffea,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pm8901_mpp_config(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 -22
}

LLVM IR (-O2):
define i32 @pm8901_mpp_config(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 -22
}
int computefn2(int n) {
  int k = n, a = 1, b = 0;
  while (k > 0) {
    if (k & 1)
      b += a;
    else
      a += b;
    k /= 2;
  }
  return b;
}


x86 assembly (clang, -O0):
<computefn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115e <computefn2+0x5e>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1142 <computefn2+0x42>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114b <computefn2+0x4b>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    111b <computefn2+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<computefn2>:
test   %edi,%edi
jle    1129 <computefn2+0x29>
mov    $0x1,%ecx
xor    %esi,%esi
mov    %edi,%edx
nopl   (%rax)
lea    (%rsi,%rcx,1),%eax
test   $0x1,%dil
cmove  %eax,%ecx
cmove  %esi,%eax
shr    %edx
mov    %eax,%esi
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <computefn2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @computefn2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 1, %1 ]
%6 = phi i32 [ %12, %3 ], [ %0, %1 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %4, %5
%10 = select i1 %8, i32 %9, i32 %5
%11 = select i1 %8, i32 %4, i32 %9
%12 = lshr i32 %6, 1
%13 = icmp ult i32 %6, 2
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ isDecimalDigit(char);
bool isNotDecimalDigit(char ch) { return !(isDecimalDigit(ch)); }


x86 assembly (clang, -O0):
<isNotDecimalDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isDecimalDigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotDecimalDigit>:
push   %rax
call   1030 <isDecimalDigit@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isNotDecimalDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isDecimalDigit(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isNotDecimalDigit(i8 signext %0) {
%2 = tail call i32 @isDecimalDigit(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t read32le(const uint32_t *p) { return *p; }


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

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

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

LLVM IR (-O2):
define i32 @read32le(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int inner_float(float);
float outer_float(float value) {
  float outer_value = 2 * inner_float(value);
  return outer_value;
}


x86 assembly (clang, -O0):
<outer_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <inner_float@plt>
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer_float>:
push   %rax
call   1030 <inner_float@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @outer_float(float %0) {
%2 = tail call i32 @inner_float(float %0)
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to float
ret float %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int getchar();
int /*<<< orphan*/ gps_proc_byte(int);
int main(int argc, char **argv) {
  uint8_t c;
  c = getchar();
  while (c > 0 && c < 128) {
    gps_proc_byte(c);
    c = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    115c <main+0x3c>
cmpl   $0x80,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    116c <main+0x4c>
jmp    1183 <main+0x63>
mov    -0x14(%rbp),%edi
call   1030 <gps_proc_byte@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x1(%rax),%ecx
cmp    $0x7e,%ecx
ja     1148 <main+0x28>
mov    %eax,%edi
call   1030 <gps_proc_byte@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
cmp    $0x7f,%ecx
jb     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getchar()
store i32 %7, i32* %6
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 128
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = load i32, i32* %6
%18 = call i32 @gps_proc_byte(i32 %17)
%19 = call i32 (...) @getchar()
store i32 %19, i32* %6
br label %8
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 127
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @gps_proc_byte(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = add i32 %9, -1
%11 = icmp ult i32 %10, 127
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MAXPATHLEN;
char *getcwd(char *, int /*<<< orphan*/);
char *getenv(char *);
char *string_copy(char *);
char *get_cwd(void) {
  char *cwd = getcwd((char *)NULL, MAXPATHLEN);
  if (cwd == NULL) {
    cwd = getenv("PWD");
    if (cwd == NULL) {
      cwd = ".";
    }
  }
  return string_copy(cwd);
}


x86 assembly (clang, -O0):
<get_cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <getcwd@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1184 <get_cwd+0x54>
lea    0xea0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117f <get_cwd+0x4f>
lea    0xe89(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <get_cwd+0x54>
mov    -0x8(%rbp),%rdi
call   1050 <string_copy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cwd>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <getcwd@plt>
test   %rax,%rax
jne    1163 <get_cwd+0x33>
lea    0xeb3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
test   %rax,%rax
lea    0xea5(%rip),%rax
cmovne %rcx,%rax
mov    %rax,%rdi
pop    %rax
jmp    1050 <string_copy@plt>

LLVM IR (-O0):
@MAXPATHLEN = global i32 0
@.str = [4 x i8] c"PWD\00"
@.str.1 = [2 x i8] c".\00"
define i8* @get_cwd() {
%1 = alloca i8*
%2 = load i32, i32* @MAXPATHLEN
%3 = call i8* @getcwd(i8* null, i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %11
11: ; preds = %10, %6
br label %12
12: ; preds = %11, %0
%13 = load i8*, i8** %1
%14 = call i8* @string_copy(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@MAXPATHLEN = global i32 0
@.str = [4 x i8] c"PWD\00"
@.str.1 = [2 x i8] c".\00"
define i8* @get_cwd() {
%1 = load i32, i32* @MAXPATHLEN
%2 = tail call i8* @getcwd(i8* null, i32 %1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %5
br label %8
8: ; preds = %4, %0
%9 = phi i8* [ %7, %4 ], [ %2, %0 ]
%10 = tail call i8* @string_copy(i8* %9)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ testenviron();
int /*<<< orphan*/ testfork();
int main(void) {
  testfork();
  testenviron();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testfork()
%2 = tail call i32 (...) @testenviron()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ portctl(char, int, char *);
int aux5on() {
  int pin = 1;
  char mask = 0x40;
  portctl(mask, pin, "aux5on");
  return 1;
}


x86 assembly (clang, -O0):
<aux5on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movb   $0x40,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdx
movsbl %al,%edi
call   1030 <portctl@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux5on>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x40,%edi
mov    $0x1,%esi
call   1030 <portctl@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"aux5on\00"
define i32 @aux5on() {
%1 = alloca i32
%2 = alloca i8
store i32 1, i32* %1
store i8 64, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* %1
%5 = call i32 @portctl(i8 signext %3, i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"aux5on\00"
define i32 @aux5on() {
%1 = tail call i32 @portctl(i8 signext 64, i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exp2(double);
int /*<<< orphan*/ exp2f(float);
int /*<<< orphan*/ exp2l(long double);
void uninitvar_exp2(void) {
  float f;
  (void)exp2f(f);
  double d;
  (void)exp2(d);
  long double ld;
  (void)exp2l(ld);
}


x86 assembly (clang, -O0):
<uninitvar_exp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <exp2f@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp2@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <exp2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_exp2>:
sub    $0x18,%rsp
call   1040 <exp2f@plt>
call   1030 <exp2@plt>
call   1050 <exp2l@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_exp2() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @exp2f(float %4)
%6 = load double, double* %2
%7 = call i32 @exp2(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @exp2l(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_exp2() {
%1 = tail call i32 @exp2f(float undef)
%2 = tail call i32 @exp2(double undef)
%3 = tail call i32 @exp2l(x86_fp80 undef)
ret void
}
/* Type definitions */
struct ebmb_node {
  int dummy;
};
struct eb_root {
  int dummy;
};

/* Variables and functions */
struct ebmb_node *__ebst_lookup(struct eb_root *, char const *);
struct ebmb_node *ebst_lookup(struct eb_root *root, const char *x) {
  return __ebst_lookup(root, x);
}


x86 assembly (clang, -O0):
<ebst_lookup>:
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 <__ebst_lookup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebst_lookup>:
jmp    1030 <__ebst_lookup@plt>

LLVM IR (-O0):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebst_lookup(%struct.eb_root* %0, i8* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca i8*
store %struct.eb_root* %0, %struct.eb_root** %3
store i8* %1, i8** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load i8*, i8** %4
%7 = call %struct.ebmb_node* @__ebst_lookup(%struct.eb_root* %5, i8* %6)
ret %struct.ebmb_node* %7
}

LLVM IR (-O2):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebst_lookup(%struct.eb_root* %0, i8* %1) {
%3 = tail call %struct.ebmb_node* @__ebst_lookup(%struct.eb_root* %0, i8* %1)
ret %struct.ebmb_node* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int, int, int);
void bar(void) {
  if (foo(1, 2, 3, 4) != 10)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <foo@plt>
cmp    $0xa,%eax
je     114d <bar+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <foo@plt>
cmp    $0xa,%eax
jne    1141 <bar+0x21>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = icmp ne i32 %1, 10
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i32 1, i32 2, i32 3, i32 4)
%2 = icmp eq i32 %1, 10
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanmean(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 0.0 / 0.0, 3.0, 0.0 / 0.0, 4.0,
               5.0, 6.0, 0.0 / 0.0, 7.0, 8.0,       0.0 / 0.0};
  int64_t N = 6;
  int64_t stride = 2;
  float v = stdlib_strided_snanmean(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x6,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snanmean@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snanmean@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [12 x float]* %1 to i8*
store i32 6, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanmean(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanmean(i32 6, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int b_white() { return fputs("[47m", stdout); }


x86 assembly (clang, -O0):
<b_white>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_white>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[47m\00"
@stdout = global i32 0
define i32 @b_white() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[47m\00"
@stdout = global i32 0
define i32 @b_white() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
int of_n_addr_cells(struct device_node *np) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_n_addr_cells(%struct.device_node* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void masterconn_delete_packet(void *packet) { free(packet); }


x86 assembly (clang, -O0):
<masterconn_delete_packet>:
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):
<masterconn_delete_packet>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @masterconn_delete_packet(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char ch = 'A';
  void *v;
  v = &ch;
  char p = *((char *)v);
  printf("%c", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
lea    0xec5(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void crash_fgets() {
  FILE *f;
  char str[60];
  f = fopen("this_file_doesnt_exist", "r");
  fgets(str, 60, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3c,%esi
call   1040 <fgets@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fgets>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x3c,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fgets() {
%1 = alloca i32*
%2 = alloca [60 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%5 = load i32*, i32** %1
%6 = call i32 @fgets(i8* %4, i32 60, i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fgets() {
%1 = alloca [60 x i8]
%2 = getelementptr inbounds [60 x i8], [60 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fgets(i8* %2, i32 60, i32* %3)
%5 = call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int f();
main() { return f(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
int f(int x) {
  int unused;
  int unused2;
  return x * 2;
}


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
unsigned long long int
unsignedlonglongint_ignoring_signedlonglong(unsigned long long int x,
                                            signed long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
void ima_counts_put(struct path *path, int mask) { return; }


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

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

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

LLVM IR (-O2):
%struct.path = type opaque
define void @ima_counts_put(%struct.path* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct game_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_left(struct game_t *);
int /*<<< orphan*/ rotate_clockwise(struct game_t *);
void move_down(struct game_t *game) {
  rotate_clockwise(game);
  move_left(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
}


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

x86 assembly (clang, -O2):
<move_down>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1030 <move_left@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rotate_clockwise@plt>

LLVM IR (-O0):
%struct.game_t = type { i32 }
define void @move_down(%struct.game_t* %0) {
%2 = alloca %struct.game_t*
store %struct.game_t* %0, %struct.game_t** %2
%3 = load %struct.game_t*, %struct.game_t** %2
%4 = call i32 @rotate_clockwise(%struct.game_t* %3)
%5 = load %struct.game_t*, %struct.game_t** %2
%6 = call i32 @move_left(%struct.game_t* %5)
%7 = load %struct.game_t*, %struct.game_t** %2
%8 = call i32 @rotate_clockwise(%struct.game_t* %7)
%9 = load %struct.game_t*, %struct.game_t** %2
%10 = call i32 @rotate_clockwise(%struct.game_t* %9)
%11 = load %struct.game_t*, %struct.game_t** %2
%12 = call i32 @rotate_clockwise(%struct.game_t* %11)
ret void
}

LLVM IR (-O2):
%struct.game_t = type { i32 }
define void @move_down(%struct.game_t* %0) {
%2 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%3 = tail call i32 @move_left(%struct.game_t* %0)
%4 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%5 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%6 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
ret void
}
int dwc3_otg_work(struct dwc3_otg *dwc_otg, int evt) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dwc3_otg = type opaque
define i32 @dwc3_otg_work(%struct.dwc3_otg* nocapture readnone %0, i32 %1) {
ret i32 0
}
void RTTestSkipAndDestroyV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestSkipAndDestroyV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int have_excpuid(void) {
  int eax, ebx, ecx, edx;
  cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
  return eax & 0xffff;
}


x86 assembly (clang, -O0):
<have_excpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80000000,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_excpuid>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x80000000,%edi
call   1030 <cpuid@plt>
movzwl 0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @have_excpuid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @cpuid(i32 -2147483648, i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %1
%7 = and i32 %6, 65535
ret i32 %7
}

LLVM IR (-O2):
define i32 @have_excpuid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 -2147483648, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = and i32 %10, 65535
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
int file_putchar(void *fd, size_t count, void *c) {
  return !(write(*(int *)fd, c, count));
}


x86 assembly (clang, -O0):
<file_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <write@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_putchar>:
push   %rax
mov    %rsi,%rax
mov    (%rdi),%edi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <write@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @file_putchar(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %6
%11 = load i64, i64* %5
%12 = call i32 @write(i32 %9, i8* %10, i64 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @file_putchar(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write(i32 %5, i8* %2, i64 %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int SetBase(int c) { return c % 9; }


x86 assembly (clang, -O0):
<SetBase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBase>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @SetBase(i32 %0) {
%2 = srem i32 %0, 9
ret i32 %2
}
seek(fd, of, typ) int fd, of, typ;
{
  long i;
  i = of;
  if (typ > 2) {
    typ = typ - 3;
    i = i * 512;
  }
  return ((int)lseek(fd, i, typ));
}


x86 assembly (clang, -O0):
<seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1148 <seek+0x38>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x9,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <lseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek>:
movslq %esi,%rax
lea    -0x3(%rdx),%ecx
mov    %rax,%rsi
shl    $0x9,%rsi
cmp    $0x3,%edx
cmovge %ecx,%edx
cmovl  %rax,%rsi
xor    %eax,%eax
jmp    1030 <lseek@plt>

LLVM IR (-O0):
define i32 @seek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
store i64 %9, i64* %7
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 2
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 3
store i32 %14, i32* %6
%15 = load i64, i64* %7
%16 = mul nsw i64 %15, 512
store i64 %16, i64* %7
br label %17
17: ; preds = %12, %3
%18 = load i32, i32* %4
%19 = load i64, i64* %7
%20 = load i32, i32* %6
%21 = call i32 (i32, i64, i32, ...) bitcast (i32 (...)* @lseek to i32 (i32, i64, i32, ...)*)(i32 %18, i64 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @seek(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = icmp sgt i32 %2, 2
%6 = add nsw i32 %2, -3
%7 = shl nsw i64 %4, 9
%8 = select i1 %5, i32 %6, i32 %2
%9 = select i1 %5, i64 %7, i64 %4
%10 = tail call i32 (i32, i64, i32, ...) bitcast (i32 (...)* @lseek to i32 (i32, i64, i32, ...)*)(i32 %0, i64 %9, i32 %8)
ret i32 %10
}
void btext(void) {}


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

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

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

LLVM IR (-O2):
define void @btext() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ karma_add_name(char const *);
int /*<<< orphan*/ karma_check(char const *, int /*<<< orphan*/, char const *);
void karma_msg(const char *chan, const char *name, const char *msg) {
  karma_check(chan, karma_add_name(name), msg);
}


x86 assembly (clang, -O0):
<karma_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <karma_add_name@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1040 <karma_check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<karma_msg>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <karma_add_name@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <karma_check@plt>

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

LLVM IR (-O2):
define void @karma_msg(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @karma_add_name(i8* %1)
%5 = tail call i32 @karma_check(i8* %0, i32 %4, i8* %2)
ret void
}
float findvifrom_va_vf(float va, float vf) { return (2 * va) - vf; }


x86 assembly (clang, -O0):
<findvifrom_va_vf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findvifrom_va_vf>:
addss  %xmm0,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @findvifrom_va_vf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fneg float %6
%8 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %5, float %7)
ret float %8
}

LLVM IR (-O2):
define float @findvifrom_va_vf(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float %3)
ret float %4
}
void __free_pages(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__free_pages>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__free_pages>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__free_pages = [13 x i8] c"__free_pages\00"
define void @__free_pages() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.__free_pages, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__free_pages = [13 x i8] c"__free_pages\00"
define void @__free_pages() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.__free_pages, i64 0, i64 0))
ret void
}
void VecSubtract3iv(int v[3], const int a[3], const int b[3]) {
  v[0] = a[0] - b[0];
  v[1] = a[1] - b[1];
  v[2] = a[2] - b[2];
}


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

x86 assembly (clang, -O2):
<VecSubtract3iv>:
mov    (%rsi),%eax
sub    (%rdx),%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
sub    0x4(%rdx),%eax
mov    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
sub    0x8(%rdx),%eax
mov    %eax,0x8(%rdi)
ret

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

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


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

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

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

LLVM IR (-O2):
define void @gofast_maybe_init_libfuncs() {
ret void
}