xunge/DecIR huggingface dataset:
/* Variables and functions */
double strtod(char *, char **);
double fixstrtod(char *string, char **endPtr) {
  double d;
  d = strtod(string, endPtr);
  if ((endPtr != NULL) && (*endPtr != string) && ((*endPtr)[-1] == 0)) {
    *endPtr -= 1;
  }
  return d;
}


x86 assembly (clang, -O0):
<fixstrtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <fixstrtod+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
je     1170 <fixstrtod+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl -0x1(%rax),%eax
cmp    $0x0,%eax
jne    1170 <fixstrtod+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixstrtod>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <strtod@plt>
test   %rbx,%rbx
je     1139 <fixstrtod+0x29>
mov    (%rbx),%rax
cmp    %r14,%rax
je     1139 <fixstrtod+0x29>
cmpb   $0x0,-0x1(%rax)
jne    1139 <fixstrtod+0x29>
add    $0xffffffffffffffff,%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define double @fixstrtod(i8* %0, i8** %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
%4 = icmp eq i8** %1, null
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = icmp eq i8* %6, %0
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8* %9, i8** %1
br label %13
13: ; preds = %12, %8, %5, %2
ret double %3
}
int be2int(unsigned char *c) {
  return c[3] | (c[2] << 8) | (c[1] << 16) | c[0] << 24;
}


x86 assembly (clang, -O0):
<be2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @be2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
float _Complex sub_float_rr(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<sub_float_rr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_float_rr>:
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @sub_float_rr(float %0, float %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fsub float %6, %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %8, float* %9
store float 0.000000e+00, float* %10
%11 = bitcast { float, float }* %3 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @sub_float_rr(float %0, float %1) {
%3 = fsub float %0, %1
%4 = insertelement <2 x float> <float poison, float 0.000000e+00>, float %3, i64 0
ret <2 x float> %4
}
void av_write_image_line2() {}


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

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

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

LLVM IR (-O2):
define void @av_write_image_line2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedYX1(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op99M0X1(void) { STA16(AbsoluteIndexedYX1(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op99M0X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedYX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op99M0X1>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedYX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op99M0X1() {
%1 = call i32 @AbsoluteIndexedYX1(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op99M0X1() {
%1 = tail call i32 @AbsoluteIndexedYX1(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
int cmp1ULL(const void *pa, const void *pb) {
  const unsigned long long *a = (const unsigned long long *)pa;
  const unsigned long long *b = (const unsigned long long *)pb;
  if (a[1] < b[1])
    return -1;
  if (a[1] > b[1])
    return +1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp1ULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    113e <cmp1ULL+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <cmp1ULL+0x67>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%rax
jbe    1160 <cmp1ULL+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmp1ULL+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp1ULL>:
mov    0x8(%rdi),%rax
xor    %ecx,%ecx
cmp    0x8(%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp1ULL(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = icmp ult i64 %5, %8
%10 = icmp ugt i64 %5, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("haha a\n");
  printf("haha a\n");
  printf("hxs test\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"haha a\0A\00"
@.str.1 = [10 x i8] c"hxs test\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 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.2 = [7 x i8] c"haha a\00"
@str.3 = [9 x i8] c"hxs test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void swap(int *first, int *second) {
  int oldValue;
  oldValue = *first;
  *first = *second;
  *second = oldValue;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int is_operator(char c) {
  switch (c) {
  case '^':
  case '*':
  case '/':
  case '+':
  case '-':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     1155 <is_operator+0x55>
jmp    1122 <is_operator+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1155 <is_operator+0x55>
jmp    1133 <is_operator+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1155 <is_operator+0x55>
jmp    1144 <is_operator+0x44>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    1161 <is_operator+0x61>
jmp    1155 <is_operator+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1168 <is_operator+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operator>:
add    $0xffffffd6,%edi
cmp    $0x34,%edi
ja     111e <is_operator+0x1e>
mov    $0x1,%eax
movabs $0x1000000000002b,%rcx
bt     %rdi,%rcx
jae    111e <is_operator+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_operator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 94, label %6
i32 42, label %6
i32 47, label %6
i32 43, label %6
i32 45, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_operator(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 94, label %4
i32 42, label %4
i32 47, label %4
i32 43, label %4
i32 45, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void printButton(char *value, int cmd) {
  printf("<input type='submit' value='%s' onclick='ButtonCmd(%d);' />\n", value,
         cmd);
}


x86 assembly (clang, -O0):
<printButton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printButton>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"<input type='submit' value='%s' onclick='ButtonCmd(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"<input type='submit' value='%s' onclick='ButtonCmd(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int *leak_pointer();
int write_after_stack_free() {
  int *x = leak_pointer();
  *x = 12;
  return 1;
}


x86 assembly (clang, -O0):
<write_after_stack_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leak_pointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_after_stack_free>:
push   %rax
xor    %eax,%eax
call   1030 <leak_pointer@plt>
movl   $0xc,(%rax)
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_after_stack_free() {
%1 = alloca i32*
%2 = call i32* (...) @leak_pointer()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 12, i32* %3
ret i32 1
}

LLVM IR (-O2):
define i32 @write_after_stack_free() {
%1 = tail call i32* (...) @leak_pointer()
store i32 12, i32* %1
ret i32 1
}
/* Variables and functions */
scalar_t__ equals_to(char const *, char *);
const char *wrap_path(const char *path) {
  if (equals_to(path, "null")) {
    return NULL;
  } else {
    return path;
  }
}


x86 assembly (clang, -O0):
<wrap_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <equals_to@plt>
cmp    $0x0,%rax
je     1143 <wrap_path+0x33>
movq   $0x0,-0x8(%rbp)
jmp    114b <wrap_path+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <equals_to@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define i8* @wrap_path(i8* %0) {
%2 = tail call i64 @equals_to(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* %0, i8* null
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int);
void err_exit(int err, const char *suffix) {
  printf("%s err %d\n", suffix, err);
  exit(1);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s err %d\0A\00"
define void @err_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s err %d\0A\00"
define void @err_exit(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int snd_info_check_reserved_words(const char *str) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @snd_info_check_reserved_words(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
unsigned int hasard(unsigned int const, unsigned int const);
unsigned int
tirerProtectionAleatoireNouveauEnnemi(const unsigned int niveauIA) {
  static const unsigned int baseProtectionEnnemi[3][2] = {
      {2, 6}, {6, 14}, {14, 24}};
  return hasard(baseProtectionEnnemi[niveauIA][0],
                baseProtectionEnnemi[niveauIA][1]);
}


x86 assembly (clang, -O0):
<tirerProtectionAleatoireNouveauEnnemi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0xed9(%rip),%rax
mov    (%rax,%rcx,8),%edi
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0xeca(%rip),%rax
mov    0x4(%rax,%rcx,8),%esi
call   1030 <hasard@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tirerProtectionAleatoireNouveauEnnemi>:
mov    %edi,%eax
lea    0xee7(%rip),%rcx
mov    (%rcx,%rax,8),%edi
mov    0x4(%rcx,%rax,8),%esi
jmp    1030 <hasard@plt>

LLVM IR (-O0):
@tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi = internal constant [3 x [2 x i32]] [[2 x i32] [i32 2, i32 6], [2 x i32] [i32 6, i32 14], [2 x i32] [i32 14, i32 24]]
define i32 @tirerProtectionAleatoireNouveauEnnemi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi, i64 0, i64 %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%7 = load i32, i32* %6
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi, i64 0, i64 %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%12 = load i32, i32* %11
%13 = call i32 @hasard(i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi = internal unnamed_addr constant [3 x [2 x i32]] [[2 x i32] [i32 2, i32 6], [2 x i32] [i32 6, i32 14], [2 x i32] [i32 14, i32 24]]
define i32 @tirerProtectionAleatoireNouveauEnnemi(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi, i64 0, i64 %2, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @tirerProtectionAleatoireNouveauEnnemi.baseProtectionEnnemi, i64 0, i64 %2, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @hasard(i32 %4, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void secd2timespec(struct timespec *ts_out, const double sec_d) {
  ts_out->tv_sec = (time_t)(sec_d);
  ts_out->tv_nsec = (long)((sec_d - (double)ts_out->tv_sec) * (1000000000));
}


x86 assembly (clang, -O0):
<secd2timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<secd2timespec>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
mov    %rax,0x8(%rdi)
cvttsd2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @secd2timespec(%struct.timespec* %0, double %1) {
%3 = alloca %struct.timespec*
%4 = alloca double
store %struct.timespec* %0, %struct.timespec** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i64
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 %6, i64* %8
%9 = load double, double* %4
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fsub double %9, %13
%15 = fmul double %14, 1.000000e+09
%16 = fptosi double %15 to i64
%17 = load %struct.timespec*, %struct.timespec** %3
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 0
store i64 %16, i64* %18
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @secd2timespec(%struct.timespec* nocapture writeonly %0, double %1) {
%3 = fptosi double %1 to i64
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 %3, i64* %4
%5 = sitofp i64 %3 to double
%6 = fsub double %1, %5
%7 = fmul double %6, 1.000000e+09
%8 = fptosi double %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %8, i64* %9
ret void
}
void psocReadMemoryBarrier() {
  __asm__ __volatile__("lock; addl $0,0(%%esp)" : : : "memory");
}


x86 assembly (clang, -O0):
<psocReadMemoryBarrier>:
push   %rbp
mov    %rsp,%rbp
lock addl $0x0,(%esp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<psocReadMemoryBarrier>:
lock addl $0x0,(%esp)
ret

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

LLVM IR (-O2):
define void @psocReadMemoryBarrier() {
tail call void asm sideeffect "lock; addl $$0,0(%esp)", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int *calloc(int, int);
int *arrayTranslate(int B[], int length) {
  int *res = calloc(length, sizeof(int));
  int i;
  for (i = 0; i < length; i++) {
    *(res + i) = B[i];
  }
  return res;
}


x86 assembly (clang, -O0):
<arrayTranslate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <arrayTranslate+0x57>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <arrayTranslate+0x27>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayTranslate>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    114d <arrayTranslate+0x2d>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i32* @arrayTranslate(i32* nocapture %0, i32 %1) {
%3 = tail call i32* @calloc(i32 %1, i32 4)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %0 to i8*
%8 = zext i32 %1 to i64
%9 = shl nuw nsw i64 %8, 2
br label %10
10: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ wind_enter_irq();
int /*<<< orphan*/ wind_exit_irq();
int /*<<< orphan*/ wind_tick_callback();
void wind_tick_isr(void) {
  wind_enter_irq();
  wind_tick_callback();
  wind_exit_irq();
}


x86 assembly (clang, -O0):
<wind_tick_isr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wind_enter_irq@plt>
mov    $0x0,%al
call   1040 <wind_tick_callback@plt>
mov    $0x0,%al
call   1050 <wind_exit_irq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_tick_isr>:
push   %rax
xor    %eax,%eax
call   1030 <wind_enter_irq@plt>
xor    %eax,%eax
call   1040 <wind_tick_callback@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <wind_exit_irq@plt>

LLVM IR (-O0):
define void @wind_tick_isr() {
%1 = call i32 (...) @wind_enter_irq()
%2 = call i32 (...) @wind_tick_callback()
%3 = call i32 (...) @wind_exit_irq()
ret void
}

LLVM IR (-O2):
define void @wind_tick_isr() {
%1 = tail call i32 (...) @wind_enter_irq()
%2 = tail call i32 (...) @wind_tick_callback()
%3 = tail call i32 (...) @wind_exit_irq()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gui();
int main(int argc, char **argv) {
  gui();
  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    $0x0,%al
call   1030 <gui@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gui@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 = call i32 (...) @gui()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @gui()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _az_fatal(char const *, char *);
void *calloc(size_t, size_t);
void *_az_alloc(const char *funcname, size_t n, size_t size) {
  if (n == 0)
    return NULL;
  void *ptr = calloc(n, size);
  if (ptr == NULL) {
    _az_fatal(funcname, "Out of memory.\n");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<_az_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <_az_alloc+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1180 <_az_alloc+0x60>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1178 <_az_alloc+0x58>
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <_az_fatal@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_az_alloc>:
push   %rbx
test   %rsi,%rsi
je     114a <_az_alloc+0x2a>
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     113b <_az_alloc+0x1b>
pop    %rbx
ret
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <_az_fatal@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @_az_alloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i8* null, i8** %4
br label %23
12: ; preds = %3
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = call i8* @calloc(i64 %13, i64 %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i8*, i8** %5
%20 = call i32 @_az_fatal(i8* %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %12
%22 = load i8*, i8** %8
store i8* %22, i8** %4
br label %23
23: ; preds = %21, %11
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @_az_alloc(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i8* @calloc(i64 %1, i64 %2)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_az_fatal(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %5, %8, %3
%11 = phi i8* [ null, %3 ], [ null, %8 ], [ %6, %5 ]
ret i8* %11
}
void gdk_event_get_time() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_get_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_block_tests();
int /*<<< orphan*/ do_children_tests();
int /*<<< orphan*/ do_locals_tests();
int /*<<< orphan*/ do_special_tests();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  do_locals_tests();
  do_block_tests();
  do_children_tests();
  do_special_tests();
  exit(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    $0x0,%al
call   1060 <do_locals_tests@plt>
mov    $0x0,%al
call   1040 <do_block_tests@plt>
mov    $0x0,%al
call   1050 <do_children_tests@plt>
mov    $0x0,%al
call   1030 <do_special_tests@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <do_locals_tests@plt>
xor    %eax,%eax
call   1040 <do_block_tests@plt>
xor    %eax,%eax
call   1050 <do_children_tests@plt>
xor    %eax,%eax
call   1030 <do_special_tests@plt>
xor    %edi,%edi
call   1070 <exit@plt>

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 = call i32 (...) @do_locals_tests()
%7 = call i32 (...) @do_block_tests()
%8 = call i32 (...) @do_children_tests()
%9 = call i32 (...) @do_special_tests()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_locals_tests()
%4 = tail call i32 (...) @do_block_tests()
%5 = tail call i32 (...) @do_children_tests()
%6 = tail call i32 (...) @do_special_tests()
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ blk_oversized_queue_1(int *);
int __attribute__((no)) get_request_1(int *q, int rw) {
  if (blk_oversized_queue_1(q)) {
    if ((rw == 1) || (rw == 0))
      return -33;
    return 0;
  }
  return -100;
}


x86 assembly (clang, -O0):
<get_request_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <blk_oversized_queue_1@plt>
cmp    $0x0,%rax
je     115e <get_request_1+0x4e>
cmpl   $0x1,-0x14(%rbp)
je     1146 <get_request_1+0x36>
cmpl   $0x0,-0x14(%rbp)
jne    1152 <get_request_1+0x42>
movl   $0xffffffdf,-0x4(%rbp)
jmp    1165 <get_request_1+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1165 <get_request_1+0x55>
movl   $0xffffff9c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_request_1>:
push   %rbx
mov    %esi,%ebx
call   1030 <blk_oversized_queue_1@plt>
xor    %ecx,%ecx
cmp    $0x2,%ebx
mov    $0xffffffdf,%edx
cmovae %ecx,%edx
test   %rax,%rax
mov    $0xffffff9c,%eax
cmovne %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_request_1(i32* %0, i32 %1) {
%3 = tail call i64 @blk_oversized_queue_1(i32* %0)
%4 = icmp eq i64 %3, 0
%5 = icmp ult i32 %1, 2
%6 = select i1 %5, i32 -33, i32 0
%7 = select i1 %4, i32 -100, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *gettext(char *);
int /*<<< orphan*/ printf(char *, char *);
void version() {
  printf(gettext("powertop version %s\n"), "1.12");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
lea    0xecb(%rip),%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <gettext@plt>
lea    0xed1(%rip),%rsi
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"powertop version %s\0A\00"
@.str.1 = [5 x i8] c"1.12\00"
define void @version() {
%1 = call i8* @gettext(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"powertop version %s\0A\00"
@.str.1 = [5 x i8] c"1.12\00"
define void @version() {
%1 = tail call i8* @gettext(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int Min32(int x, int y) { return x < y ? x : y; }


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

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

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

LLVM IR (-O2):
define i32 @Min32(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void PiComs_DisableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @PiComs_DisableRxInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void msort(int a[], int begin, int end) {
  int m;
  if (begin < end) {
    m = (begin + end) / 2;
    msort(a, begin, m);
    msort(a, m + 1, end);
    merge(a, begin, m, end);
  }
}


x86 assembly (clang, -O0):
<msort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <msort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <msort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msort>:
cmp    %edx,%esi
jge    1172 <msort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <msort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <msort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @msort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @msort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @msort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @msort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
void scanbool(char **toks, _Bool *b) {
  int i;
  scanint(toks, &i);
  *b = i;
}


x86 assembly (clang, -O0):
<scanbool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanint@plt>
cmpl   $0x0,-0x14(%rbp)
setne  %cl
mov    -0x10(%rbp),%rax
and    $0x1,%cl
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanbool>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <scanint@plt>
cmpl   $0x0,0xc(%rsp)
setne  (%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @scanbool(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = call i32 (i8**, i32*, ...) bitcast (i32 (...)* @scanint to i32 (i8**, i32*, ...)*)(i8** %6, i32* %5)
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = load i8*, i8** %4
%11 = zext i1 %9 to i8
store i8 %11, i8* %10
ret void
}

LLVM IR (-O2):
define void @scanbool(i8** %0, i8* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i8**, i32*, ...) bitcast (i32 (...)* @scanint to i32 (i8**, i32*, ...)*)(i8** %0, i32* %3)
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
store i8 %8, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(void *);
int date_get_date(void) {
  time_t t;
  struct tm *lt;
  t = time((void *)0);
  lt = localtime(&t);
  return (lt->tm_year + 1900) * 10000 + (lt->tm_mon + 1) * 100 + (lt->tm_mday);
}


x86 assembly (clang, -O0):
<date_get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x76c,%eax
imul   $0x2710,%eax,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x1,%ecx
imul   $0x64,%ecx,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_date>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
imul   $0x2710,(%rax),%ecx
imul   $0x64,0x4(%rax),%edx
add    %ecx,%edx
mov    0x8(%rax),%eax
add    %edx,%eax
add    $0x121eb24,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
define i32 @date_get_date() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i8* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1900
%9 = mul nsw i32 %8, 10000
%10 = load %struct.tm*, %struct.tm** %2
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = mul nsw i32 %13, 100
%15 = add nsw i32 %9, %14
%16 = load %struct.tm*, %struct.tm** %2
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
define i32 @date_get_date() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i8* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul i32 %6, 10000
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul i32 %9, 100
%11 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%12 = load i32, i32* %11
%13 = add i32 %7, 19000100
%14 = add i32 %13, %10
%15 = add i32 %14, %12
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello() { printf("hello "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello \00"
define void @print_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello \00"
define void @print_hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct apacheAccessLog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ badFormat(struct apacheAccessLog **, char *, char *, int,
                             char *);
void shortLine(struct apacheAccessLog **pLl, char *line, char *fileName,
               int lineIx) {
  badFormat(pLl, line, fileName, lineIx, "short line");
}


x86 assembly (clang, -O0):
<shortLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xec3(%rip),%r8
call   1030 <badFormat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortLine>:
lea    0xee9(%rip),%r8
jmp    1030 <badFormat@plt>

LLVM IR (-O0):
%struct.apacheAccessLog = type { i32 }
@.str = [11 x i8] c"short line\00"
define void @shortLine(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.apacheAccessLog**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.apacheAccessLog** %0, %struct.apacheAccessLog*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.apacheAccessLog**, %struct.apacheAccessLog*** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @badFormat(%struct.apacheAccessLog** %9, i8* %10, i8* %11, i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.apacheAccessLog = type { i32 }
@.str = [11 x i8] c"short line\00"
define void @shortLine(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @badFormat(%struct.apacheAccessLog** %0, i8* %1, i8* %2, i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}