xunge/DecIR huggingface dataset:
int main(void) {
  volatile int i;
  i = 1;
  i = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1,-0x4(%rsp)
movl   $0x2,-0x4(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
store volatile i32 2, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int out_put_in_string(char *string, unsigned int sz, char c, int pos) {
  putchar(c);
  return 1;
}


x86 assembly (clang, -O0):
<out_put_in_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %ecx,-0x14(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_put_in_string>:
push   %rax
mov    %edx,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @out_put_in_string(i8* %0, i32 %1, i8 signext %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i32 %3, i32* %8
%9 = load i8, i8* %7
%10 = call i32 @putchar(i8 signext %9)
ret i32 1
}

LLVM IR (-O2):
define i32 @out_put_in_string(i8* nocapture readnone %0, i32 %1, i8 signext %2, i32 %3) {
%5 = tail call i32 @putchar(i8 signext %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  printf("%d\n", ((n * m) & ~1) / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
and    $0xfffffffe,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   (%rsp),%esi
sar    %esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %6
%9 = and i32 %8, -2
%10 = sdiv i32 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
char *num_to_str(unsigned long num, char *buf, int len) {
  unsigned int digit;
  buf += len - 1;
  *buf = 0;
  do {
    digit = num % 10;
    *(--buf) = digit + '0';
    num /= 10;
  } while (num > 0);
  return buf;
}


x86 assembly (clang, -O0):
<num_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
ja     112a <num_to_str+0x2a>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_str>:
movslq %edx,%rax
lea    (%rax,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
movb   $0x0,-0x1(%rax,%rsi,1)
movabs $0xcccccccccccccccd,%r8
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%esi
sub    %eax,%esi
or     $0x30,%sil
mov    %sil,-0x1(%rcx)
add    $0xffffffffffffffff,%rcx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <num_to_str+0x20>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @num_to_str(i64 %0, i8* writeonly %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %6
br label %7
7: ; preds = %7, %3
%8 = phi i8* [ %6, %3 ], [ %13, %7 ]
%9 = phi i64 [ %0, %3 ], [ %14, %7 ]
%10 = urem i64 %9, 10
%11 = trunc i64 %10 to i8
%12 = or i8 %11, 48
%13 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 %12, i8* %13
%14 = udiv i64 %9, 10
%15 = icmp ult i64 %9, 10
br i1 %15, label %16, label %7
16: ; preds = %7
ret i8* %13
}
/* Variables and functions */
int sum(float, float, float);
float average(float a, float b, float c) { return sum(a, b, c) / 3; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <sum@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
push   %rax
call   1030 <sum@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @average(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* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @sum(float %7, float %8, float %9)
%11 = sdiv i32 %10, 3
%12 = sitofp i32 %11 to float
ret float %12
}

LLVM IR (-O2):
define float @average(float %0, float %1, float %2) {
%4 = tail call i32 @sum(float %0, float %1, float %2)
%5 = sdiv i32 %4, 3
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ mergeFiles(char *);
void reduce(char *reduceTask) { mergeFiles(reduceTask); }


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

x86 assembly (clang, -O2):
<reduce>:
jmp    1030 <mergeFiles@plt>

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

LLVM IR (-O2):
define void @reduce(i8* %0) {
%2 = tail call i32 @mergeFiles(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ fork();
int getpid();
int getppid();
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  if (fork() == 0) {
    printf("myid=%d, my parent:%d", getpid(), getppid());
    return 0;
  }
  pause();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
cmp    $0x0,%rax
jne    119e <main+0x4e>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <main+0x55>
mov    $0x0,%al
call   1050 <pause@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1070 <fork@plt>
test   %rax,%rax
je     1166 <main+0x16>
xor    %eax,%eax
call   1050 <pause@plt>
jmp    1186 <main+0x36>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <getppid@plt>
lea    0xe83(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"myid=%d, my parent:%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 (...) @getpid()
%6 = call i32 (...) @getppid()
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
store i32 0, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 (...) @pause()
br label %10
10: ; preds = %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"myid=%d, my parent:%d\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (...) @getppid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
br label %9
7: ; preds = %0
%8 = tail call i32 (...) @pause()
br label %9
9: ; preds = %7, %3
ret i32 0
}
int main(void) {
  int i = 42;
  return !i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void BTIC4B_BC7_EncodeBlock_VecSwapA(int *clra, int *clrb) {
  int t;
  t = clra[3];
  clra[3] = clrb[3];
  clrb[3] = t;
}


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

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

LLVM IR (-O0):
define void @BTIC4B_BC7_EncodeBlock_VecSwapA(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 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 3
%11 = load i32, i32* %10
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %11, i32* %13
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 3
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @BTIC4B_BC7_EncodeBlock_VecSwapA(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = load i32, i32* %5
store i32 %6, i32* %3
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char *, int, int);
void print_params(const char *output, int *p, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf(output, "p[%d]: %d\n", i, p[i]);
  }
}


x86 assembly (clang, -O0):
<print_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <print_params+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb1(%rip),%rsi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <print_params+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_params>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    114a <print_params+0x3a>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r12
nop
mov    (%r14,%rbx,4),%ecx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <print_params+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"p[%d]: %d\0A\00"
define void @print_params(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"p[%d]: %d\0A\00"
define void @print_params(i8* %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
void *defaultDeepCopyFunc(void *data, void *param) { return data; }


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

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

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

LLVM IR (-O2):
define i8* @defaultDeepCopyFunc(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
void ERR_clear_error(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_clear_error() {
ret void
}
unsigned int f81(unsigned int x, unsigned int y) {
  return (x << (8 * 4 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f81>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f81>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f81(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 = sub i32 32, %6
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
%12 = add i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f81(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = add i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ up_and_down(int);
int main(void) {
  up_and_down(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <up_and_down@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @up_and_down(i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <die+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@errno = global i64 0
@.str = [10 x i8] c"ERROR %s\0A\00"
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, char *argv[]) {
  for (int i = 0; i < 5; i++) {
    foo(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    114d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1030 <foo@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @foo(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 0)
%4 = tail call i32 @foo(i32 1)
%5 = tail call i32 @foo(i32 2)
%6 = tail call i32 @foo(i32 3)
%7 = tail call i32 @foo(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a_func(int);
main() { a_func(15); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <a_func@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1030 <a_func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @a_func(i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a_func(i32 15)
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_119(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_119() {
ret i32 0
}
/* Variables and functions */
char *skipwhite(char *);
char *skipdelim_comma(char *cp, int *comma) {
  cp = skipwhite(cp);
  if ((*comma = (*cp == ','))) {
    cp = skipwhite(cp + 1);
  }
  return cp;
}


x86 assembly (clang, -O0):
<skipdelim_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skipwhite@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%edx
mov    -0x10(%rbp),%rcx
mov    %edx,(%rcx)
test   $0x1,%al
jne    1155 <skipdelim_comma+0x45>
jmp    1166 <skipdelim_comma+0x56>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <skipwhite@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipdelim_comma>:
push   %rbx
mov    %rsi,%rbx
call   1030 <skipwhite@plt>
xor    %ecx,%ecx
cmpb   $0x2c,(%rax)
sete   %cl
mov    %ecx,(%rbx)
jne    1132 <skipdelim_comma+0x22>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1030 <skipwhite@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipdelim_comma(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 = call i8* @skipwhite(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 44
%11 = zext i1 %10 to i32
%12 = load i32*, i32** %4
store i32 %11, i32* %12
br i1 %10, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = call i8* @skipwhite(i8* %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @skipdelim_comma(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i8* @skipwhite(i8* %0)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 44
%6 = zext i1 %5 to i32
store i32 %6, i32* %1
br i1 %5, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i8* @skipwhite(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = phi i8* [ %9, %7 ], [ %3, %2 ]
ret i8* %11
}
void rotateWord(unsigned char *const word) {
  unsigned char temp;
  temp = word[0];
  word[0] = word[1];
  word[1] = word[2];
  word[2] = word[3];
  word[3] = temp;
}


x86 assembly (clang, -O0):
<rotateWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateWord>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
movzwl 0x2(%rdi),%ecx
mov    %cx,0x1(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @rotateWord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %2, i8* %7
ret void
}
void initialiser_tableau_visites(int *visites, int nb_sommet) {
  int indice;
  for (indice = 0; indice < nb_sommet; indice++) {
    visites[indice] = -1;
  }
}


x86 assembly (clang, -O0):
<initialiser_tableau_visites>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initialiser_tableau_visites+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initialiser_tableau_visites+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiser_tableau_visites>:
test   %esi,%esi
jle    1129 <initialiser_tableau_visites+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initialiser_tableau_visites(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void erralloc() {
  printf("Error: insufficient memory.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<erralloc>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<erralloc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error: insufficient memory.\0A\00"
@EXIT_FAILURE = global i32 0
define void @erralloc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [28 x i8] c"Error: insufficient memory.\00"
define void @erralloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ initTextMode();
int /*<<< orphan*/ print(char *, int, int);
int main() {
  initTextMode();
  print("HELLO WORLD", 9, 9);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initTextMode@plt>
lea    0xec3(%rip),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1040 <print@plt>
jmp    1149 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initTextMode@plt>
lea    0xed1(%rip),%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1040 <print@plt>
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"HELLO WORLD\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initTextMode()
%3 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 9, i32 9)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"HELLO WORLD\00"
define i32 @main() {
%1 = tail call i32 (...) @initTextMode()
%2 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 9, i32 9)
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int cola(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    printf("%d\n", cola(n + 1) + n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1179 <main+0x49>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1050 <cola@plt>
mov    %eax,%esi
add    -0x8(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    119a <main+0x6a>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
add    $0x1,%edi
call   1050 <cola@plt>
add    0xc(%rsp),%eax
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %14
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
%8 = call i32 @cola(i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%13 = icmp eq i32 %12, 1
br i1 %13, label %5, label %14
14: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ chk(char *);
int main(int argc, char *argv[]) {
  int r;
  for (r = 0; *++argv != NULL;)
    if (chk(*argv))
      r = 1;
  return (r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1169 <main+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <chk@plt>
cmp    $0x0,%rax
je     1164 <main+0x54>
movl   $0x1,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     114a <main+0x3a>
mov    %rsi,%rbx
add    $0x10,%rbx
xor    %ebp,%ebp
mov    $0x1,%r14d
nopl   0x0(%rax)
call   1030 <chk@plt>
test   %rax,%rax
cmovne %r14d,%ebp
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <main+0x20>
jmp    114c <main+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %14, %6 ], [ %4, %2 ]
%8 = phi i8** [ %13, %6 ], [ %3, %2 ]
%9 = phi i32 [ %12, %6 ], [ 0, %2 ]
%10 = tail call i64 @chk(i8* %7)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 %9, i32 1
%13 = getelementptr inbounds i8*, i8** %8, i64 1
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ delay(float);
void b(int ba, int bb, int bc) {
  float tempo = ba * 461.5;
  tempo += bb * 230.75;
  tempo += bc * 115.375;
  delay(tempo);
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
cvtsi2sd %edi,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtsi2sd %esi,%xmm1
mulsd  0xedc(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
mulsd  0xec6(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @b(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 4.615000e+02
%11 = fptrunc double %10 to float
store float %11, float* %7
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double %13, double 2.307500e+02, double %15)
%17 = fptrunc double %16 to float
store float %17, float* %7
%18 = load i32, i32* %6
%19 = sitofp i32 %18 to double
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = call double @llvm.fmuladd.f64(double %19, double 1.153750e+02, double %21)
%23 = fptrunc double %22 to float
store float %23, float* %7
%24 = load float, float* %7
%25 = call i32 @delay(float %24)
ret void
}

LLVM IR (-O2):
define void @b(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = fmul double %4, 4.615000e+02
%6 = fptrunc double %5 to float
%7 = sitofp i32 %1 to double
%8 = fpext float %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 2.307500e+02, double %8)
%10 = fptrunc double %9 to float
%11 = sitofp i32 %2 to double
%12 = fpext float %10 to double
%13 = tail call double @llvm.fmuladd.f64(double %11, double 1.153750e+02, double %12)
%14 = fptrunc double %13 to float
%15 = tail call i32 @delay(float %14)
ret void
}
/* Variables and functions */
int RB_numValues(int);
int win_handle(int);
int g_count_viewports_in_window(int win_id) {
  int handle = win_handle(win_id);
  if (handle == -1)
    return 0;
  return RB_numValues(handle);
}


x86 assembly (clang, -O0):
<g_count_viewports_in_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <win_handle@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    114c <g_count_viewports_in_window+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <g_count_viewports_in_window+0x37>
mov    -0xc(%rbp),%edi
call   1040 <RB_numValues@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_count_viewports_in_window>:
push   %rax
call   1030 <win_handle@plt>
cmp    $0xffffffff,%eax
je     1133 <g_count_viewports_in_window+0x13>
mov    %eax,%edi
pop    %rax
jmp    1040 <RB_numValues@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g_count_viewports_in_window(i32 %0) {
%2 = tail call i32 @win_handle(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @RB_numValues(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
int PyMPELog_Initialized(void) {
  int status = 1;
  status = 1;
  return status;
}


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

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

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

LLVM IR (-O2):
define i32 @PyMPELog_Initialized() {
ret i32 1
}
const char *filter_filename(const char *filename) {
  const char *p = filename;
  const char *last = filename;
  int ch;
  while ((ch = *p++) != '\0' && ch != ':')
    if (ch == '/')
      last = p;
  return last;
}


x86 assembly (clang, -O0):
<filter_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
je     1145 <filter_filename+0x45>
cmpl   $0x3a,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1155 <filter_filename+0x55>
jmp    116c <filter_filename+0x6c>
cmpl   $0x2f,-0x1c(%rbp)
jne    1167 <filter_filename+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <filter_filename+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_filename>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
movzbl (%rcx),%edx
cmp    $0x3a,%dl
je     112c <filter_filename+0x2c>
add    $0x1,%rcx
cmp    $0x2f,%dl
je     1127 <filter_filename+0x27>
test   %dl,%dl
jne    1110 <filter_filename+0x10>
jmp    112c <filter_filename+0x2c>
mov    %rcx,%rax
jmp    1110 <filter_filename+0x10>
ret

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

LLVM IR (-O2):
define i8* @filter_filename(i8* %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i8* [ %0, %1 ], [ %6, %4 ]
br label %4
4: ; preds = %2, %4
%5 = phi i8* [ %6, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
switch i8 %7, label %4 [
i8 58, label %8
i8 0, label %8
i8 47, label %2
]
8: ; preds = %4, %4
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void gs_exit(int x) { exit(x); }


x86 assembly (clang, -O0):
<gs_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<gs_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @gs_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @gs_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bswap32(uint8_t *buf) { (void)buf; }


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

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

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

LLVM IR (-O2):
define void @bswap32(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void df_exit(char *message, int i) {
  fprintf(stderr, "%s", message);
  exit(i);
}


x86 assembly (clang, -O0):
<df_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<df_exit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @df_exit(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
void dsc_section_join(unsigned long begin, unsigned long *pend,
                      unsigned long **pplast) {
  if (begin)
    **pplast = begin;
  if (*pend > begin)
    *pplast = pend;
}


x86 assembly (clang, -O0):
<dsc_section_join>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <dsc_section_join+0x29>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
jbe    1145 <dsc_section_join+0x45>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsc_section_join>:
test   %rdi,%rdi
je     110b <dsc_section_join+0xb>
mov    (%rdx),%rax
mov    %rdi,(%rax)
cmp    %rdi,(%rsi)
jbe    1113 <dsc_section_join+0x13>
mov    %rsi,(%rdx)
ret

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

LLVM IR (-O2):
define void @dsc_section_join(i64 %0, i64* %1, i64** nocapture %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = load i64*, i64** %2
store i64 %0, i64* %6
br label %7
7: ; preds = %5, %3
%8 = load i64, i64* %1
%9 = icmp ugt i64 %8, %0
br i1 %9, label %10, label %11
10: ; preds = %7
store i64* %1, i64** %2
br label %11
11: ; preds = %10, %7
ret void
}