xunge/DecIR huggingface dataset:
void escCopy(char *in, char *out, char toEscape, char escape) {
  char c;
  for (;;) {
    c = *in++;
    if (c == toEscape)
      *out++ = escape;
    *out++ = c;
    if (c == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<escCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x13(%rbp)
movsbl -0x13(%rbp),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <escCopy+0x4e>
mov    -0x12(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x13(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
movsbl -0x13(%rbp),%eax
cmp    $0x0,%eax
jne    1174 <escCopy+0x74>
jmp    1179 <escCopy+0x79>
jmp    1116 <escCopy+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<escCopy>:
jmp    111e <escCopy+0x1e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
mov    %al,(%rsi)
add    $0x1,%rsi
test   %al,%al
je     112d <escCopy+0x2d>
movzbl (%rdi),%eax
cmp    %dl,%al
jne    1110 <escCopy+0x10>
mov    %cl,(%rsi)
add    $0x1,%rsi
jmp    1110 <escCopy+0x10>
ret

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

LLVM IR (-O2):
define void @escCopy(i8* nocapture %0, i8* nocapture writeonly %1, i8 signext %2, i8 signext %3) {
br label %5
5: ; preds = %13, %4
%6 = phi i8* [ %1, %4 ], [ %15, %13 ]
%7 = phi i8* [ %0, %4 ], [ %8, %13 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, %2
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %3, i8* %6
br label %13
13: ; preds = %11, %5
%14 = phi i8* [ %12, %11 ], [ %6, %5 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %9, i8* %14
%16 = icmp eq i8 %9, 0
br i1 %16, label %17, label %5
17: ; preds = %13
ret void
}
void *scgc_extract_key(void *v, int keyPos) {
  (void)keyPos;
  return v;
}


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

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

LLVM IR (-O0):
define i8* @scgc_extract_key(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
ret i8* %6
}

LLVM IR (-O2):
define i8* @scgc_extract_key(i8* readnone returned %0, i32 %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintHelp(const char *programName) {
  printf("%s [options] <input> <output>\n", programName);
  printf("\t-d <max distance>\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"%s [options] <input> <output>\0A\00"
@.str.1 = [20 x i8] c"\09-d <max distance>\0A\00"
define void @PrintHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s [options] <input> <output>\0A\00"
@str = [19 x i8] c"\09-d <max distance>\00"
define void @PrintHelp(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
int __test_and_clear_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("btr %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
btr    %rcx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_clear_bit>:
btr    %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_clear_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_clear_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Variables and functions */
double pow(int, int);
int q6(int dt) {
  double a = 0.0003869, b = 0.1815, c = 0.01081, q6;
  q6 = 1 / (a * pow(dt + b, 2) + c);
}


x86 assembly (clang, -O0):
<q6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe7f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q6>:
cvtsi2sd %edi,%xmm0
addsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x2,%esi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @q6(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store double 3.869000e-04, double* %4
store double 1.815000e-01, double* %5
store double 1.081000e-02, double* %6
%8 = load double, double* %4
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = load double, double* %5
%12 = fadd double %10, %11
%13 = fptosi double %12 to i32
%14 = call double @pow(i32 %13, i32 2)
%15 = load double, double* %6
%16 = call double @llvm.fmuladd.f64(double %8, double %14, double %15)
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @q6(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 1.815000e-01
%4 = fptosi double %3 to i32
%5 = tail call double @pow(i32 %4, i32 2)
ret i32 undef
}
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
int /*<<< orphan*/ statfs(char *, struct statfs *);
int tst_is_cwd_v9fs(void) {
  struct statfs sf;
  statfs(".", &sf);
  return (sf.f_type == 0x01021997);
}


x86 assembly (clang, -O0):
<tst_is_cwd_v9fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <statfs@plt>
cmpl   $0x1021997,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_is_cwd_v9fs>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
xor    %eax,%eax
cmpl   $0x1021997,(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_v9fs() {
%1 = alloca %struct.statfs
%2 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%3 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 16914839
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @tst_is_cwd_v9fs() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i32 @statfs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 16914839
%7 = zext i1 %6 to i32
ret i32 %7
}
void _data_storage() { printf("Exception: %s\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<_data_storage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_data_storage>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._data_storage = [14 x i8] c"_data_storage\00"
define void @_data_storage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__._data_storage, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._data_storage = [14 x i8] c"_data_storage\00"
define void @_data_storage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__._data_storage, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *realloc(int *, int);
int main(void) {
  int *x = realloc(NULL, 800);
  int *y __attribute__((unused));
  x = realloc(x, 800);
  x = realloc(x, 400);
  x = realloc(x, 1200);
  y = realloc(x + 10, 1600);
  x = realloc(x, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4b0,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x28,%rdi
mov    $0x640,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x4b0,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
lea    0x28(%rax),%rdi
mov    $0x640,%esi
call   1030 <realloc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @realloc(i32* null, i32 800)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32* @realloc(i32* %5, i32 800)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32* @realloc(i32* %7, i32 400)
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32* @realloc(i32* %9, i32 1200)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 10
%13 = call i32* @realloc(i32* %12, i32 1600)
store i32* %13, i32** %3
%14 = load i32*, i32** %2
%15 = call i32* @realloc(i32* %14, i32 0)
store i32* %15, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @realloc(i32* null, i32 800)
%2 = tail call i32* @realloc(i32* %1, i32 800)
%3 = tail call i32* @realloc(i32* %2, i32 400)
%4 = tail call i32* @realloc(i32* %3, i32 1200)
%5 = getelementptr inbounds i32, i32* %4, i64 10
%6 = tail call i32* @realloc(i32* %5, i32 1600)
%7 = tail call i32* @realloc(i32* %4, i32 0)
ret i32 0
}
void sub3d(float *out, const float *a, const float *b) {
  out[0] = a[0] - b[0];
  out[1] = a[1] - b[1];
  out[2] = a[2] - b[2];
}


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

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

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

LLVM IR (-O2):
define void @sub3d(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
int calc_pow2(int n) {
  int x = n, p2 = 0;
  while (x) {
    x = x >> 1;
    ++p2;
  }
  return p2;
}


x86 assembly (clang, -O0):
<calc_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1135 <calc_pow2+0x35>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <calc_pow2+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_pow2>:
xor    %eax,%eax
test   %edi,%edi
je     111c <calc_pow2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <calc_pow2+0x10>
ret

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

LLVM IR (-O2):
define i32 @calc_pow2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int __ev_ofl_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ofl_changed() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
bool file_exists(char *filename) {
  FILE *file;
  bool flag;
  if (file = fopen(filename, "r")) {
    fclose(file);
    flag = true;
  } else {
    flag = false;
  }
  return flag;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <file_exists+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x14(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void pcie_aspm_exit_link_state(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_aspm_exit_link_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void irc_pong(char *server) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s", "PONG", server);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x1fd,%esi
lea    0xeba(%rip),%rdx
lea    0xeb9(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_pong>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [5 x i8] c"PONG\00"
define void @irc_pong(i8* %0) {
%2 = alloca i8*
%3 = alloca [509 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%8 = call i32 @net_send(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [5 x i8] c"PONG\00"
define void @irc_pong(i8* %0) {
%2 = alloca [509 x i8]
%3 = getelementptr inbounds [509 x i8], [509 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 509, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @net_send(i8* %3)
ret void
}
/* Variables and functions */
int creat(char *, int);
int mus_create(char *arg) {
  int fd;
  fd = creat(arg, 0666);
  return (fd);
}


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

x86 assembly (clang, -O2):
<mus_create>:
mov    $0x1b6,%esi
jmp    1030 <creat@plt>

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

LLVM IR (-O2):
define i32 @mus_create(i8* %0) {
%2 = tail call i32 @creat(i8* %0, i32 438)
ret i32 %2
}
void test_typename(void) {
  char s;
  int y;
  int x = _Generic((s), _Bool : 1, char : 2, int : 3, default : 4);
  int z = _Generic((y), _Bool : 1, char : 2, int : 3, default : 4);
}


x86 assembly (clang, -O0):
<test_typename>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_typename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Pause();
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printw(char *, int /*<<< orphan*/, char const *);
void Cannot(const char *what) {
  printw("\nThis %s terminal %s\n\n", getenv("TERM"), what);
  Pause();
}


x86 assembly (clang, -O0):
<Cannot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xeab(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1040 <Pause@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cannot>:
push   %rbx
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1050 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <Pause@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AThis %s terminal %s\0A\0A\00"
@.str.1 = [5 x i8] c"TERM\00"
define void @Cannot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = call i32 (...) @Pause()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AThis %s terminal %s\0A\0A\00"
@.str.1 = [5 x i8] c"TERM\00"
define void @Cannot(i8* %0) {
%2 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
%4 = tail call i32 (...) @Pause()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *strdup(char *);
char *substr(const char *buff, int start, int len) {
  char subbuff[len + 1];
  memcpy(subbuff, &buff[start], len);
  subbuff[len] = '\0';
  return strdup(subbuff);
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rdi
movslq -0x10(%rbp),%rax
movb   $0x0,(%rdi,%rax,1)
call   1040 <strdup@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edx,%r14d
lea    0x1(%r14),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
movslq %esi,%rsi
add    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <memcpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rax,%rbx,1)
mov    %rbx,%rdi
call   1040 <strdup@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %7
%13 = alloca i8, i64 %11
store i64 %11, i64* %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %6
%19 = call i32 @memcpy(i8* %13, i8* %17, i32 %18)
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %13, i64 %21
store i8 0, i8* %22
%23 = call i8* @strdup(i8* %13)
%24 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = zext i32 %4 to i64
%6 = alloca i8, i64 %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = call i32 @memcpy(i8* %6, i8* %8, i32 %2)
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
%12 = call i8* @strdup(i8* %6)
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ va_cmd(char *, int, int, char *, char *);
int restart_ddns(void) {
  va_cmd("/bin/updateddctrl", 2, 1, "all", "1");
  return 0;
}


x86 assembly (clang, -O0):
<restart_ddns>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xee6(%rip),%rcx
lea    0xee3(%rip),%r8
call   1030 <va_cmd@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<restart_ddns>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef3(%rip),%rcx
lea    0xef0(%rip),%r8
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <va_cmd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/bin/updateddctrl\00"
@.str.1 = [4 x i8] c"all\00"
@.str.2 = [2 x i8] c"1\00"
define i32 @restart_ddns() {
%1 = call i32 @va_cmd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/bin/updateddctrl\00"
@.str.1 = [4 x i8] c"all\00"
@.str.2 = [2 x i8] c"1\00"
define i32 @restart_ddns() {
%1 = tail call i32 @va_cmd(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_helix(int, char **);
int main(int argc, char *argv[]) {
  gmx_helix(argc, argv);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_helix@plt>
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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_helix(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_helix(i32 %0, i8** %1)
ret i32 0
}
int _in_case_lassert(int option) {
  static int is_in = 0;
  int i = is_in;
  if (option != -1)
    is_in = option;
  return i;
}


x86 assembly (clang, -O0):
<_in_case_lassert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f17(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1123 <_in_case_lassert+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f01(%rip)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_in_case_lassert>:
mov    0x2f1e(%rip),%eax
cmp    $0xffffffff,%edi
je     1111 <_in_case_lassert+0x11>
mov    %edi,0x2f13(%rip)
ret

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

LLVM IR (-O2):
@_in_case_lassert.is_in = internal unnamed_addr global i32 0
define i32 @_in_case_lassert(i32 %0) {
%2 = load i32, i32* @_in_case_lassert.is_in
%3 = icmp eq i32 %0, -1
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %0, i32* @_in_case_lassert.is_in
br label %5
5: ; preds = %4, %1
ret i32 %2
}
void free_pipe_array(int max, char **array) {
  int i;
  for (i = 0; i < max; ++i)
    free(array[i]);
  free(array);
}


x86 assembly (clang, -O0):
<free_pipe_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_pipe_array+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_pipe_array+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pipe_array>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <free_pipe_array+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_pipe_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_pipe_array(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
extern unsigned low_word(unsigned long long a) { return a & 0xffffffffl; }


x86 assembly (clang, -O0):
<low_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @low_word(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967295
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @low_word(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
bxdec() { error("Inconsistent external initialization"); }


x86 assembly (clang, -O0):
<bxdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"Inconsistent external initialization\00"
define i32 @bxdec() {
%1 = alloca i32
%2 = call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [37 x i8] c"Inconsistent external initialization\00"
define i32 @bxdec() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void ProcStop(void) {}


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

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

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

LLVM IR (-O2):
define void @ProcStop() {
ret void
}
error(s) char *s;
{ failed(s, 0); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <failed@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <failed@plt>

LLVM IR (-O0):
define i32 @error(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @failed to i32 (i8*, i32, ...)*)(i8* %4, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @error(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @failed to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(void) {
  char *t, text[] = "Going! Going! Gone";
  t = text;
  while (*t) {
    puts(t++);
  }
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x1e(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1189 <main+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %eax,%edi
call   1030 <puts@plt>
jmp    1161 <main+0x41>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x656e6f,0xf(%rsp)
lea    0x1(%rsp),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <puts@plt>
add    $0x1,%ebx
cmpb   $0x0,(%r14)
lea    0x1(%r14),%r14
jne    1150 <main+0x30>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.text = [19 x i8] c"Going! Going! Gone\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [19 x i8]
store i32 0, i32* %1
%4 = bitcast [19 x i8]* %3 to i8*
%5 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %2
br label %6
6: ; preds = %10, %0
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = ptrtoint i8* %11 to i32
%14 = call i32 @puts(i32 %13)
br label %6
15: ; preds = %6
%16 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [19 x i8] c"Going! Going! Gone\00"
define i32 @main() {
%1 = alloca [19 x i8]
%2 = getelementptr inbounds [19 x i8], [19 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i8* [ %5, %3 ], [ %2, %0 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = ptrtoint i8* %4 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 @puts(i32 %7)
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ run_server();
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "welcome to switcher!\n");
  run_server();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <run_server@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <run_server@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"welcome to switcher!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @run_server()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"welcome to switcher!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @run_server()
ret i32 0
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge10(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 10);
}


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

x86 assembly (clang, -O2):
<charge10>:
mov    $0xa,%edx
jmp    1030 <charge_generic@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @charge10(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %3
%6 = load %struct.battle_char*, %struct.battle_char** %4
%7 = call i32 @charge_generic(%struct.battle_char* %5, %struct.battle_char* %6, i32 10)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge10(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 10)
ret void
}
char const *pubnub_uname(void) {
  return "OpenSSL"
         "%2F"
         "2.1-alpha";
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"OpenSSL%2F2.1-alpha\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"OpenSSL%2F2.1-alpha\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
int Add(int x, int y) {
  while (y != 0) {
    int carry = x & y;
    x = x ^ y;
    y = carry << 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<Add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <Add+0x34>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110a <Add+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add>:
mov    %edi,%eax
test   %esi,%esi
je     111c <Add+0x1c>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
and    %esi,%ecx
xor    %esi,%eax
add    %ecx,%ecx
mov    %ecx,%esi
jne    1110 <Add+0x10>
ret

LLVM IR (-O0):
define i32 @Add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %5
%17 = shl i32 %16, 1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @Add(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = and i32 %5, %6
%8 = xor i32 %5, %6
%9 = shl i32 %7, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %8, %4 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_type(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->type = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XLeaveWindowEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

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

/* Variables and functions */
scalar_t__ genlist_head(struct genlist const *);
struct fileinfo_list_link *
fileinfo_list_head(const struct fileinfo_list *tthis) {
  return (struct fileinfo_list_link *)genlist_head(
      (const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fileinfo_list_head>:
jmp    1030 <genlist_head@plt>

LLVM IR (-O0):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_head(%struct.fileinfo_list* %0) {
%2 = alloca %struct.fileinfo_list*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %2
%3 = load %struct.fileinfo_list*, %struct.fileinfo_list** %2
%4 = bitcast %struct.fileinfo_list* %3 to %struct.genlist*
%5 = call i64 @genlist_head(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %6
}

LLVM IR (-O2):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_head(%struct.fileinfo_list* %0) {
%2 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_head(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %4
}