xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int check_pages(double d) {
  int pages = (int)d;
  if (d != (double)pages)
    error("Can't use fractional number of pages\n");
  return pages;
}


x86 assembly (clang, -O0):
<check_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1144 <check_pages+0x34>
jp     1144 <check_pages+0x34>
jmp    1150 <check_pages+0x40>
lea    0xeb5(%rip),%rdi
call   1030 <error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pages>:
push   %rbx
cvttsd2si %xmm0,%ebx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jne    1125 <check_pages+0x15>
jnp    1131 <check_pages+0x21>
lea    0xed4(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Can't use fractional number of pages\0A\00"
define i32 @check_pages(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fcmp une double %6, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [38 x i8] c"Can't use fractional number of pages\0A\00"
define i32 @check_pages(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp une double %3, %0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %2
}
void chunk_deinit(struct chunk *c) {}


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

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

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

LLVM IR (-O2):
%struct.chunk = type opaque
define void @chunk_deinit(%struct.chunk* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nl();
int /*<<< orphan*/ writei(short);
int /*<<< orphan*/ writes(char *);
void bug(short n) {
  writes("Fatal error ");
  writei(n);
  nl();
  exit(1);
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <writes@plt>
movswl -0x2(%rbp),%edi
call   1050 <writei@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<bug>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1040 <writes@plt>
mov    %ebx,%edi
call   1050 <writei@plt>
xor    %eax,%eax
call   1030 <nl@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Fatal error \00"
define void @bug(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @writes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %2
%5 = call i32 @writei(i16 signext %4)
%6 = call i32 (...) @nl()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Fatal error \00"
define void @bug(i16 signext %0) {
%2 = tail call i32 @writes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @writei(i16 signext %0)
%4 = tail call i32 (...) @nl()
%5 = tail call i32 @exit(i32 1)
unreachable
}
void av_lzo1x_decode() {}


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

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

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

LLVM IR (-O2):
define void @av_lzo1x_decode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int write(int, char const *, int);
int socket_send(int destination, const char *buffer, int size) {
  int ret;
  ret = write(destination, buffer, size);
  if (ret < 0) {
    perror("send error");
  }
  return ret;
}


x86 assembly (clang, -O0):
<socket_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <socket_send+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_send>:
push   %rbx
call   1030 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1130 <socket_send+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <socket_send+0xc>

LLVM IR (-O0):
@.str = [11 x i8] c"send error\00"
define i32 @socket_send(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c"send error\00"
define i32 @socket_send(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int jpc_floorlog2(int const arg) {
  int y;
  int x;
  assert(arg > 0);
  y = 0;
  x = arg;
  while (x > 1) {
    x >>= 1;
    ++y;
  }
  return y;
}


x86 assembly (clang, -O0):
<jpc_floorlog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115a <jpc_floorlog2+0x4a>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <jpc_floorlog2+0x29>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpc_floorlog2>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
jl     113c <jpc_floorlog2+0x2c>
xor    %eax,%eax
mov    %ebx,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <jpc_floorlog2+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @jpc_floorlog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
store i32 0, i32* %3
%9 = load i32, i32* %2
store i32 %9, i32* %4
br label %10
10: ; preds = %13, %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %4
%15 = ashr i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @jpc_floorlog2(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = phi i32 [ %10, %6 ], [ 0, %1 ]
%9 = lshr i32 %7, 1
%10 = add nuw nsw i32 %8, 1
%11 = icmp ugt i32 %7, 3
br i1 %11, label %6, label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_mult(void) {
  gen_pop();
  gen_call("ccmul");
}


x86 assembly (clang, -O0):
<gen_mult>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_mult>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccmul\00"
define void @gen_mult() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccmul\00"
define void @gen_mult() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int iterative(int);
int /*<<< orphan*/ printf(char *, int);
int recursion(int);
int main(int argc, char *argv[]) {
  printf("%d\n", recursion(14));
  printf("%d\n", iterative(14));
  return EXIT_SUCCESS;
}


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    $0xe,%edi
call   1040 <recursion@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xe,%edi
call   1050 <iterative@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe,%edi
call   1040 <recursion@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xe,%edi
call   1050 <iterative@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
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 @recursion(i32 14)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @iterative(i32 14)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @recursion(i32 14)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @iterative(i32 14)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
unsigned char apply_permutations(unsigned char S[94], unsigned char c) {
  if (c >= 127)
    return c;
  if (c < 33)
    return c;
  c -= 33;
  c = S[c];
  c += 33;
  return c;
}


x86 assembly (clang, -O0):
<apply_permutations>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x7f,%eax
jl     1126 <apply_permutations+0x26>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1166 <apply_permutations+0x66>
movzbl -0x11(%rbp),%eax
cmp    $0x21,%eax
jge    113e <apply_permutations+0x3e>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1166 <apply_permutations+0x66>
movzbl -0x11(%rbp),%eax
sub    $0x21,%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x11(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x21,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_permutations>:
mov    %esi,%eax
lea    -0x7f(%rax),%ecx
cmp    $0xa2,%cl
jb     1114 <apply_permutations+0x14>
add    $0xdf,%al
movzbl %al,%eax
mov    (%rdi,%rax,1),%al
add    $0x21,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @apply_permutations(i8* nocapture %0, i8 zeroext %1) {
%3 = add i8 %1, -127
%4 = icmp ult i8 %3, -94
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = add nsw i8 %1, -33
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = add i8 %9, 33
br label %11
11: ; preds = %2, %5
%12 = phi i8 [ %10, %5 ], [ %1, %2 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ K_release_processor();
int /*<<< orphan*/ atomic(int);
void release_processor(void) {
  atomic(1);
  K_release_processor();
  atomic(0);
}


x86 assembly (clang, -O0):
<release_processor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <atomic@plt>
mov    $0x0,%al
call   1030 <K_release_processor@plt>
xor    %edi,%edi
call   1040 <atomic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_processor>:
push   %rax
mov    $0x1,%edi
call   1040 <atomic@plt>
xor    %eax,%eax
call   1030 <K_release_processor@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <atomic@plt>

LLVM IR (-O0):
define void @release_processor() {
%1 = call i32 @atomic(i32 1)
%2 = call i32 (...) @K_release_processor()
%3 = call i32 @atomic(i32 0)
ret void
}

LLVM IR (-O2):
define void @release_processor() {
%1 = tail call i32 @atomic(i32 1)
%2 = tail call i32 (...) @K_release_processor()
%3 = tail call i32 @atomic(i32 0)
ret void
}
unsigned long long baddu1(unsigned int a, unsigned int b) {
  unsigned long long c = (unsigned char)(a + b);
  return c + 1;
}


x86 assembly (clang, -O0):
<baddu1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
movzbl %al,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baddu1>:
add    %esi,%edi
movzbl %dil,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @baddu1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = add i64 %11, 1
ret i64 %12
}

LLVM IR (-O2):
define i64 @baddu1(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = and i32 %3, 255
%5 = add nuw nsw i32 %4, 1
%6 = zext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Write_Text(char *);
void task1() { UART1_Write_Text("30 Seconds has passed\r\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"30 Seconds has passed\0D\0A\00"
define void @task1() {
%1 = call i32 @UART1_Write_Text(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"30 Seconds has passed\0D\0A\00"
define void @task1() {
%1 = tail call i32 @UART1_Write_Text(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int writeboard(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @writeboard() {
ret i32 0
}
void foo402(int p) {}


x86 assembly (clang, -O0):
<foo402>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo402(i32 %0) {
ret void
}
void or () {
  asm volatile("popq %%rax\n\t"
               "orq %%rax, 0x8(%%rsp)\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<or>:
pop    %rax
or     %rax,0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @or() {
tail call void asm sideeffect "popq %rax\0A\09orq %rax, 0x8(%rsp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void epx_generic_output(void *data, unsigned *out_width, unsigned *out_height,
                        unsigned width, unsigned height) {
  *out_width = width * 2;
  *out_height = height * 2;
}


x86 assembly (clang, -O0):
<epx_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<epx_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

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

LLVM IR (-O2):
define void @epx_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
/* Type definitions */
struct soldiers {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
struct soldiers *form_platoon(int);
int /*<<< orphan*/ free(struct soldiers *);
int /*<<< orphan*/ kill_platoon(struct soldiers *, int);
int main(void) {
  struct soldiers *platoon = form_platoon(41);
  kill_platoon(platoon, 3);
  free(platoon);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x29,%edi
call   1040 <form_platoon@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <kill_platoon@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x29,%edi
call   1040 <form_platoon@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3,%esi
call   1050 <kill_platoon@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.soldiers = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.soldiers*
store i32 0, i32* %1
%3 = call %struct.soldiers* @form_platoon(i32 41)
store %struct.soldiers* %3, %struct.soldiers** %2
%4 = load %struct.soldiers*, %struct.soldiers** %2
%5 = call i32 @kill_platoon(%struct.soldiers* %4, i32 3)
%6 = load %struct.soldiers*, %struct.soldiers** %2
%7 = call i32 @free(%struct.soldiers* %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
%struct.soldiers = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call %struct.soldiers* @form_platoon(i32 41)
%2 = tail call i32 @kill_platoon(%struct.soldiers* %1, i32 3)
%3 = tail call i32 @free(%struct.soldiers* %1)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, res;
  printf("\nEnter a number : ");
  scanf("%d", &num);
  res = fact(num);
  printf("\n%d! = %d\n\n", num, res);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"\0A%d! = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @fact(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"\0A%d! = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
int f6(int t, int v) {
  if (v == 0 || v == -1)
    __builtin_unreachable();
  int a = t - 1U;
  int b = a * v;
  return v + b;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <f6+0x1e>
cmpl   $0xffffffff,-0x8(%rbp)
jne    111e <f6+0x1e>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f6(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 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %9, %2
unreachable
13: ; preds = %9
%14 = load i32, i32* %3
%15 = sub i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @f6(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, -2
tail call void @llvm.assume(i1 %4)
%5 = mul i32 %1, %0
ret i32 %5
}
/* Type definitions */
struct pt_regs {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_GETREGS;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  struct pt_regs *);
int ptrace_getregs(pid_t pid, struct pt_regs *regs) {
  if (ptrace(PTRACE_GETREGS, pid, NULL, regs) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_getregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    114e <ptrace_getregs+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <ptrace_getregs+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_getregs>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
call   1030 <ptrace@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
@PTRACE_GETREGS = global i32 0
define i32 @ptrace_getregs(i32 %0, %struct.pt_regs* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store %struct.pt_regs* %1, %struct.pt_regs** %5
%6 = load i32, i32* @PTRACE_GETREGS
%7 = load i32, i32* %4
%8 = load %struct.pt_regs*, %struct.pt_regs** %5
%9 = call i64 @ptrace(i32 %6, i32 %7, i32* null, %struct.pt_regs* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
@PTRACE_GETREGS = global i32 0
define i32 @ptrace_getregs(i32 %0, %struct.pt_regs* %1) {
%3 = load i32, i32* @PTRACE_GETREGS
%4 = tail call i64 @ptrace(i32 %3, i32 %0, i32* null, %struct.pt_regs* %1)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
void bound_range_exceeded_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @bound_range_exceeded_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct reiserfs_key {
  int dummy;
};

/* Variables and functions */
unsigned long le_key_k_offset(int, struct reiserfs_key *);
int le_key_version(struct reiserfs_key *);
int direct_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) {
  int version = le_key_version(key);
  return ((le_key_k_offset(version, key) & (bsize - 1)) != 1);
}


x86 assembly (clang, -O0):
<direct_is_left_mergeable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <le_key_version@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <le_key_k_offset@plt>
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x1,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_is_left_mergeable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <le_key_version@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <le_key_k_offset@plt>
add    $0xffffffffffffffff,%rbx
and    %rax,%rbx
xor    %eax,%eax
cmp    $0x1,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.reiserfs_key = type { i32 }
define i32 @direct_is_left_mergeable(%struct.reiserfs_key* %0, i64 %1) {
%3 = alloca %struct.reiserfs_key*
%4 = alloca i64
%5 = alloca i32
store %struct.reiserfs_key* %0, %struct.reiserfs_key** %3
store i64 %1, i64* %4
%6 = load %struct.reiserfs_key*, %struct.reiserfs_key** %3
%7 = call i32 @le_key_version(%struct.reiserfs_key* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load %struct.reiserfs_key*, %struct.reiserfs_key** %3
%10 = call i64 @le_key_k_offset(i32 %8, %struct.reiserfs_key* %9)
%11 = load i64, i64* %4
%12 = sub i64 %11, 1
%13 = and i64 %10, %12
%14 = icmp ne i64 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.reiserfs_key = type { i32 }
define i32 @direct_is_left_mergeable(%struct.reiserfs_key* %0, i64 %1) {
%3 = tail call i32 @le_key_version(%struct.reiserfs_key* %0)
%4 = tail call i64 @le_key_k_offset(i32 %3, %struct.reiserfs_key* %0)
%5 = add i64 %1, -1
%6 = and i64 %4, %5
%7 = icmp ne i64 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
void xpc_atfork_child(void) {}


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

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

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

LLVM IR (-O2):
define void @xpc_atfork_child() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
scalar_t__ stat(char const *, struct stat *);
int is_file_exist(const char *path) {
  struct stat info;
  if (stat(path, &info) != 0) {
    if (errno == ENOENT) {
      return 0;
    }
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1165 <is_file_exist+0x55>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <is_file_exist+0x49>
movl   $0x0,-0x4(%rbp)
jmp    116c <is_file_exist+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    116c <is_file_exist+0x5c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @is_file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i64, i64* @errno
%10 = load i64, i64* @ENOENT
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %15
13: ; preds = %8
store i32 0, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @is_file_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ foo();
scalar_t__ vfork();
int f3(int x) {
  if (vfork() == 0)
    _exit(1);
  x = 0;
  foo();
  return 0;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <vfork@plt>
cmp    $0x0,%rax
jne    1156 <f3+0x26>
mov    $0x1,%edi
call   1030 <_exit@plt>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
xor    %eax,%eax
call   1050 <vfork@plt>
test   %rax,%rax
je     1148 <f3+0x18>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @vfork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @_exit(i32 1)
unreachable
7: ; preds = %1
store i32 0, i32* %2
%8 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = tail call i64 (...) @vfork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @_exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char const *);
void ws_error(const char *message) { error(-1, "ERROR", message); }


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

x86 assembly (clang, -O2):
<ws_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0xffffffff,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define void @ws_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 -1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @ws_error(i8* %0) {
%2 = tail call i32 @error(i32 -1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void gtk_file_chooser_set_uri() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_uri() {
ret void
}
main() {
  x(x);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32 (...)*, ...) bitcast (i32 (...)* @x to i32 (i32 (...)*, ...)*)(i32 (...)* @x)
ret i32 0
}
int myadd(const int x, const int y) { return x + y; }


x86 assembly (clang, -O0):
<myadd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @myadd(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @myadd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD7_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRD7_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRD7_swap(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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRD7_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
long utilIpZero(unsigned char *byIp) {
  if (byIp == (0))
    return (-1);
  *byIp++ = 0;
  *byIp++ = 0;
  *byIp++ = 0;
  *byIp = 0;
  return (0);
}


x86 assembly (clang, -O0):
<utilIpZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <utilIpZero+0x20>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1165 <utilIpZero+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilIpZero>:
test   %rdi,%rdi
je     110e <utilIpZero+0xe>
movl   $0x0,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @utilIpZero(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
store i32 0, i32* %4
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ 0, %3 ], [ -1, %1 ]
ret i64 %6
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_sk_sort(int /*<<< orphan*/ *);
void sk_OPENSSL_CSTRING_sort(struct stack_st_OPENSSL_CSTRING *sk) {
  OPENSSL_sk_sort((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_sort>:
jmp    1030 <OPENSSL_sk_sort@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define void @sk_OPENSSL_CSTRING_sort(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_sort(i32* %4)
ret void
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define void @sk_OPENSSL_CSTRING_sort(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_sort(i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    printf("%o\n", n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
je     117d <main+0x5d>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
char **GetTokenStorageAddress(void) {
  static char *tokens = NULL;
  return &tokens;
}


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

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

LLVM IR (-O0):
@GetTokenStorageAddress.tokens = internal global i8* null
define i8** @GetTokenStorageAddress() {
ret i8** @GetTokenStorageAddress.tokens
}

LLVM IR (-O2):
@GetTokenStorageAddress.tokens = internal global i8* null
define i8** @GetTokenStorageAddress() {
ret i8** @GetTokenStorageAddress.tokens
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int iop_msleep(int n) {
  usleep(n * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<iop_msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iop_msleep>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @iop_msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<yyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_sk_free(int /*<<< orphan*/ *);
void sk_OPENSSL_STRING_free(struct stack_st_OPENSSL_STRING *sk) {
  OPENSSL_sk_free((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_free>:
jmp    1030 <OPENSSL_sk_free@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define void @sk_OPENSSL_STRING_free(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_STRING*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %2
%3 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_STRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_free(i32* %4)
ret void
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define void @sk_OPENSSL_STRING_free(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_free(i32* %2)
ret void
}
/* Variables and functions */
char *last_slash(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *my_basename(char *d, int dsize, char *s) {
  s = last_slash(s);
  strncpy(d, s + 1, dsize - 1);
  d[dsize - 1] = 0;
  return d;
}


x86 assembly (clang, -O0):
<my_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <last_slash@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_basename>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <last_slash@plt>
lea    0x1(%rax),%rsi
movslq %ebp,%rbp
lea    -0x1(%rbp),%rdx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%rbp,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @my_basename(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i8* @last_slash(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = call i32 @strncpy(i8* %9, i8* %11, i32 %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @my_basename(i8* returned %0, i32 %1, i8* %2) {
%4 = tail call i8* @last_slash(i8* %2)
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = add nsw i32 %1, -1
%7 = tail call i32 @strncpy(i8* %0, i8* %5, i32 %6)
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret i8* %0
}
void STAX(char r) {}


x86 assembly (clang, -O0):
<STAX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @STAX(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @STAX(i8 signext %0) {
ret void
}