xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Flash_LED();
int /*<<< orphan*/ InitApp();
void main(void) {
  InitApp();
  Flash_LED();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @InitApp()
%2 = call i32 (...) @Flash_LED()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @InitApp()
%2 = tail call i32 (...) @Flash_LED()
ret void
}
void divvv(float *result, const float *s1) {
  result[0] /= s1[0];
  result[1] /= s1[1];
  result[2] /= s1[2];
}


x86 assembly (clang, -O0):
<divvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divvv>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
divss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
divss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
divss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @divvv(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fdiv float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fdiv float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fdiv float %14, %12
store float %15, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
void logon() { write("Welcome to Lil.\n> "); }


x86 assembly (clang, -O0):
<logon>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Welcome to Lil.\0A> \00"
define void @logon() {
%1 = call i32 @write(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Welcome to Lil.\0A> \00"
define void @logon() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
void store(char *p, int k) {
  *(int *)(p + 17) = k;
  *(int *)(p + 21) = k;
  *(int *)(p + 25) = k;
  *(int *)(p + 29) = k;
}


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

x86 assembly (clang, -O2):
<store>:
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,0x11(%rdi)
ret

LLVM IR (-O0):
define void @store(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 = getelementptr inbounds i8, i8* %6, i64 17
%8 = bitcast i8* %7 to i32*
store i32 %5, i32* %8
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 21
%12 = bitcast i8* %11 to i32*
store i32 %9, i32* %12
%13 = load i32, i32* %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 25
%16 = bitcast i8* %15 to i32*
store i32 %13, i32* %16
%17 = load i32, i32* %4
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 29
%20 = bitcast i8* %19 to i32*
store i32 %17, i32* %20
ret void
}

LLVM IR (-O2):
define void @store(i8* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 17
%4 = insertelement <4 x i32> poison, i32 %1, i64 0
%5 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> zeroinitializer
%6 = bitcast i8* %3 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
/* Variables and functions */
int IFF_RUNNING;
int IFF_UP;
int /*<<< orphan*/ LOG_INFO;
int modify_flags(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int ifup(char *dev) {
  syslog(LOG_INFO, "Starting device %s", dev);
  return (modify_flags(dev, IFF_UP | IFF_RUNNING, 0));
}


x86 assembly (clang, -O0):
<ifup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <syslog@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1030 <modify_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifup>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
mov    0x2e9d(%rip),%rax
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1030 <modify_flags@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [19 x i8] c"Starting device %s\00"
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @ifup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = load i32, i32* @IFF_UP
%8 = load i32, i32* @IFF_RUNNING
%9 = or i32 %7, %8
%10 = call i32 @modify_flags(i8* %6, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [19 x i8] c"Starting device %s\00"
@IFF_UP = global i32 0
@IFF_RUNNING = global i32 0
define i32 @ifup(i8* %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @IFF_UP
%5 = load i32, i32* @IFF_RUNNING
%6 = or i32 %5, %4
%7 = tail call i32 @modify_flags(i8* %0, i32 %6, i32 0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fh_cli_write(char *, char *, char *);
void fh_cli_print(char *cmd, char *help) {
  fh_cli_write("  %-15s - %s\n", cmd, help);
}


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

x86 assembly (clang, -O2):
<fh_cli_print>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <fh_cli_write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c" %-15s - %s\0A\00"
define void @fh_cli_print(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 @fh_cli_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c" %-15s - %s\0A\00"
define void @fh_cli_print(i8* %0, i8* %1) {
%3 = tail call i32 @fh_cli_write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int *greatest(int a, int b, int c) {
  int *g;
  if (a > b && a > c)
    g = &a;
  else if (b > a && b > c)
    g = &b;
  else
    g = &c;
  return (g);
}


x86 assembly (clang, -O0):
<greatest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1132 <greatest+0x32>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1132 <greatest+0x32>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1164 <greatest+0x64>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1157 <greatest+0x57>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1157 <greatest+0x57>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115f <greatest+0x5f>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1164 <greatest+0x64>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatest>:
cmp    %edx,%esi
lea    -0x8(%rsp),%rcx
lea    -0xc(%rsp),%rax
cmovle %rax,%rcx
cmp    %edi,%esi
cmovle %rax,%rcx
cmp    %edx,%edi
lea    -0x4(%rsp),%rax
cmovle %rcx,%rax
cmp    %esi,%edi
cmovle %rcx,%rax
ret

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

LLVM IR (-O2):
define noalias i32* @greatest(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = icmp sgt i32 %0, %1
%8 = icmp sgt i32 %0, %2
%9 = and i1 %7, %8
%10 = icmp sgt i32 %1, %0
%11 = icmp sgt i32 %1, %2
%12 = and i1 %10, %11
%13 = select i1 %12, i32* %5, i32* %6
%14 = select i1 %9, i32* %4, i32* %13
ret i32* %14
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColor3DRenderer();
struct YsGLSL3DRenderer *YsGLSLCreateFlat3DRenderer(void) {
  return YsGLSLCreateVariColor3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateFlat3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColor3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateFlat3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColor3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
int console_unlock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_unlock() {
ret i32 0
}
__attribute__((no)) unsigned long andc_pv(unsigned long *a, unsigned long b) {
  return ~b & *a;
}


x86 assembly (clang, -O0):
<andc_pv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    -0x8(%rbp),%rcx
and    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<andc_pv>:
mov    %rsi,%rax
not    %rax
and    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @andc_pv(i64* nocapture %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = load i64, i64* %0
%5 = and i64 %4, %3
ret i64 %5
}
void ResAddPath(char *a, int b) {}


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

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

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

LLVM IR (-O2):
define void @ResAddPath(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ randfrac();
double randexp(double mu) { return -mu * log(randfrac()); }


x86 assembly (clang, -O0):
<randexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <randfrac@plt>
mov    %eax,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randexp>:
sub    $0x18,%rsp
xorpd  0xed4(%rip),%xmm0
movapd %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <randfrac@plt>
mov    %eax,%edi
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @randexp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 (...) @randfrac()
%6 = call double @log(i32 %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @randexp(double %0) {
%2 = fneg double %0
%3 = tail call i32 (...) @randfrac()
%4 = tail call double @log(i32 %3)
%5 = fmul double %4, %2
ret double %5
}
/* Variables and functions */
char *get_word();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  while (1) {
    char *word = get_word();
    if (!strcmp(word, "quit"))
      break;
    printf("%s\n", word);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_word@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1168 <main+0x38>
jmp    117d <main+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <get_word@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1184 <main+0x54>
lea    0xeac(%rip),%r14
lea    0xea0(%rip),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <get_word@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"quit\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @get_word()
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8* [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i8* (...) @get_word()
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int f(int, int);
int main() { return f(4, 5); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%edi
mov    $0x5,%esi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 4, i32 5)
ret i32 %1
}
/* Variables and functions */
int mus_read_any_1(int, int, int, int, int **, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int mus_file_read_file(int tfd, int beg, int chans, int nints, int **bufs) {
  return (mus_read_any_1(tfd, beg, chans, nints, bufs, NULL, NULL));
}


x86 assembly (clang, -O0):
<mus_file_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x0,(%rsp)
call   1030 <mus_read_any_1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_read_file>:
push   %rax
movq   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <mus_read_any_1@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mus_file_read_file(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32**
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32** %4, i32*** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32**, i32*** %10
%16 = call i32 @mus_read_any_1(i32 %11, i32 %12, i32 %13, i32 %14, i32** %15, i32* null, i32* null)
ret i32 %16
}

LLVM IR (-O2):
define i32 @mus_file_read_file(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = tail call i32 @mus_read_any_1(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
double __ieee754_j0(double);
double j0(double x) { return __ieee754_j0(x); }


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

x86 assembly (clang, -O2):
<j0>:
jmp    1030 <__ieee754_j0@plt>

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

LLVM IR (-O2):
define double @j0(double %0) {
%2 = tail call double @__ieee754_j0(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_copytagmethods(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void copytagmethods(void) {
  lua_pushnumber(
      lua_copytagmethods(luaL_check_number(1), luaL_check_number(2)));
}


x86 assembly (clang, -O0):
<copytagmethods>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <luaL_check_number@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1050 <lua_copytagmethods@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copytagmethods>:
push   %rbx
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <luaL_check_number@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <lua_copytagmethods@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @copytagmethods() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @luaL_check_number(i32 2)
%3 = call i32 @lua_copytagmethods(i32 %1, i32 %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @copytagmethods() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @luaL_check_number(i32 2)
%3 = tail call i32 @lua_copytagmethods(i32 %1, i32 %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
void main() {
  int x;
  int y;
  if (x) {
    x = 8;
  } else {
    x = 10;
  }
  y = x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,-0x4(%rbp)
je     111a <main+0x1a>
movl   $0x8,-0x4(%rbp)
jmp    1121 <main+0x21>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_default_colormap() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32(uint32_t x) {
  return ((x >> 24) & 0x000000ff) | ((x >> 8) & 0x0000ff00) |
         ((x << 8) & 0x00ff0000) | ((x << 24) & 0xff000000);
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 8
%12 = and i32 %11, 16711680
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 24
%16 = and i32 %15, -16777216
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
unsigned long unmask(unsigned long field, unsigned long mask) {
  return field & mask;
}


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

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

LLVM IR (-O0):
define i64 @unmask(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
%6 = load i64, i64* %4
%7 = and i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @unmask(i64 %0, i64 %1) {
%3 = and i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scale_dimensions(int *, int *);
int main() {
  int height, width;
  height = 4;
  width = 5;
  scale_dimensions(&height, &width);
  printf("Scaled height = %d\n", height);
  printf("Scaled width = %d\n", width);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scale_dimensions@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <scale_dimensions@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Scaled height = %d\0A\00"
@.str.1 = [19 x i8] c"Scaled width = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 4, i32* %1
store i32 5, i32* %2
%5 = call i32 @scale_dimensions(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pls_stop();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("If you do not get back to your research now, we will have to "
         "implement corrective solutions.\n");
  pls_stop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pls_stop@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [94 x i8] c"If you do not get back to your research now, we will have to implement corrective solutions.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @pls_stop()
ret i32 0
}

LLVM IR (-O2):
@str = [93 x i8] c"If you do not get back to your research now, we will have to implement corrective solutions.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @pls_stop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo2(unsigned int a) {
  if (a & 1)
    if (a & 4)
      goto heaven;
  return;
heaven:
  bar();
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1143 <foo2+0x33>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     113e <foo2+0x2e>
jmp    1148 <foo2+0x38>
jmp    1143 <foo2+0x33>
jmp    114f <foo2+0x3f>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
not    %edi
test   $0x5,%dil
jne    111f <foo2+0xf>
xor    %eax,%eax
jmp    1030 <bar@plt>
ret

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

LLVM IR (-O2):
define void @foo2(i32 %0) {
%2 = and i32 %0, 5
%3 = icmp eq i32 %2, 5
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @bar()
br label %6
6: ; preds = %1, %4
ret void
}
void view_changeValue(void) {}


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

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

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

LLVM IR (-O2):
define void @view_changeValue() {
ret void
}
/* Variables and functions */
void *memalign(int, size_t);
void *ntfs_align(size_t size) { return memalign(32, size); }


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

x86 assembly (clang, -O2):
<ntfs_align>:
mov    %rdi,%rsi
mov    $0x20,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @ntfs_align(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @memalign(i32 32, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @ntfs_align(i64 %0) {
%2 = tail call align 32 i8* @memalign(i32 32, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int /*<<< orphan*/ dlock_unlock(int /*<<< orphan*/ *, int);
int o_pthread_spin_unlock(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
int ___pthread_spin_unlock(pthread_spinlock_t *spin, char *lname, char *fn,
                           int ln) {
  ;
  dlock_unlock(spin, (int)pthread_self());
  return o_pthread_spin_unlock(spin);
}


x86 assembly (clang, -O0):
<___pthread_spin_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <dlock_unlock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <o_pthread_spin_unlock@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___pthread_spin_unlock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <dlock_unlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <o_pthread_spin_unlock@plt>

LLVM IR (-O0):
define i32 @___pthread_spin_unlock(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i64 (...) @pthread_self()
%11 = trunc i64 %10 to i32
%12 = call i32 @dlock_unlock(i32* %9, i32 %11)
%13 = load i32*, i32** %5
%14 = call i32 @o_pthread_spin_unlock(i32* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @___pthread_spin_unlock(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i64 (...) @pthread_self()
%6 = trunc i64 %5 to i32
%7 = tail call i32 @dlock_unlock(i32* %0, i32 %6)
%8 = tail call i32 @o_pthread_spin_unlock(i32* %0)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void shelld_reap(int sig) {
  pid_t pid;
  while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<shelld_reap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1143 <shelld_reap+0x33>
jmp    111b <shelld_reap+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shelld_reap>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %eax,%eax
jg     1120 <shelld_reap+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @shelld_reap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* null, i32 %5)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @shelld_reap(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
size_t int_len(int nb) {
  int count;
  unsigned int n;
  n = nb < 0 ? -nb : nb;
  count = nb < 0 ? 1 : 0;
  while (n >= 10) {
    n /= 10;
    count++;
  }
  return (count + 1);
}


x86 assembly (clang, -O0):
<int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <int_len+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <int_len+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0xc(%rbp)
jb     1164 <int_len+0x64>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <int_len+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_len>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
cmp    $0xa,%ecx
jb     1134 <int_len+0x34>
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <int_len+0x20>
add    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @int_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
store i32 %17, i32* %3
br label %18
18: ; preds = %21, %12
%19 = load i32, i32* %4
%20 = icmp uge i32 %19, 10
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %4
%23 = udiv i32 %22, 10
store i32 %23, i32* %4
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %18
26: ; preds = %18
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @int_len(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = lshr i32 %0, 31
%4 = icmp ugt i32 %2, 9
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %2, %1 ]
%7 = phi i32 [ %9, %5 ], [ %3, %1 ]
%8 = udiv i32 %6, 10
%9 = add nuw nsw i32 %7, 1
%10 = icmp ugt i32 %6, 99
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i32 [ %3, %1 ], [ %9, %5 ]
%13 = add nuw nsw i32 %12, 1
%14 = zext i32 %13 to i64
ret i64 %14
}
double point_product(double *vec_1, double *vec_2) {
  double point;
  int i;
  point = 0.0;
  for (i = 0; i < 3; i++) {
    point += vec_1[i] * vec_2[i];
  }
  return point;
}


x86 assembly (clang, -O0):
<point_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <point_product+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <point_product+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_product>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @point_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint64_t load_u64(uint8_t *buf) {
  uint64_t ret;
  memcpy(&ret, buf, sizeof(ret));
  return ret;
}


x86 assembly (clang, -O0):
<load_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load_u64(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_double(double f) { printf("%.2f", f); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @print_double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void polToKartez(double pruvodic, double fiRad, double *px, double *py) {
  *px = pruvodic * cos(fiRad);
  *py = pruvodic * sin(fiRad);
}


x86 assembly (clang, -O0):
<polToKartez>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polToKartez>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @polToKartez(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = tail call double @cos(double %1)
%6 = fmul double %5, %0
store double %6, double* %2
%7 = tail call double @sin(double %1)
%8 = fmul double %7, %0
store double %8, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eq(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sub3(int const *);
main() {
  int i;
  for (i = 0; i < 4; i++) {
    const int j = i;
    int k;
    sub3(&j);
    k = j;
    eq(k, k);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    117e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <sub3@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <eq@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1050 <eq@plt>
movl   $0x1,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1050 <eq@plt>
movl   $0x2,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1050 <eq@plt>
movl   $0x3,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <sub3@plt>
mov    0xc(%rsp),%edi
mov    %edi,%esi
call   1050 <eq@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = call i32 @sub3(i32* %3)
%11 = load i32, i32* %3
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @eq(i32 %12, i32 %13)
br label %15
15: ; preds = %8
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %5
18: ; preds = %5
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @sub3(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @eq(i32 %4, i32 %4)
store i32 1, i32* %1
%6 = call i32 @sub3(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @eq(i32 %7, i32 %7)
store i32 2, i32* %1
%9 = call i32 @sub3(i32* %1)
%10 = load i32, i32* %1
%11 = call i32 @eq(i32 %10, i32 %10)
store i32 3, i32* %1
%12 = call i32 @sub3(i32* %1)
%13 = load i32, i32* %1
%14 = call i32 @eq(i32 %13, i32 %13)
%15 = call i32 @exit(i32 0)
unreachable
}
int C(double dx, double dy, double dz) {
  return (dx + dy) + dz == dx + (dy + dz);
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cmpeqsd %xmm3,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @C(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fadd double %13, %14
%16 = fadd double %12, %15
%17 = fcmp oeq double %11, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @C(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
%6 = fadd double %1, %2
%7 = fadd double %6, %0
%8 = fcmp oeq double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}