xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: head [-n lines | -c bytes] [file ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: head [-n lines | -c bytes] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: head [-n lines | -c bytes] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int eval_uminus(int a1, int a2) { return -a1; }


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

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

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

LLVM IR (-O2):
define i32 @eval_uminus(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
ret i32 %3
}
void gx_rgb_to_rgb(float *from, float *rgb) {
  rgb[0] = from[0];
  rgb[1] = from[1];
  rgb[2] = from[2];
}


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

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

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

LLVM IR (-O2):
define void @gx_rgb_to_rgb(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
ret void
}
void use_buf_calloc(int *buf, int len) {
  for (int i = 0; i < len; i++)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<use_buf_calloc>:
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 <use_buf_calloc+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <use_buf_calloc+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @use_buf_calloc(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 0, 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 @use_buf_calloc(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 */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_fail();
void *xmalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == 0)
    xalloc_fail();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <xalloc_fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1030 <xalloc_fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @xalloc_fail()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @xalloc_fail()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t1() {
  union {
    int a;
    int b;
  } x;
  x.a = 90;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "union.c",
          8, 90, x.b);
  ;
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5a,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xed7(%rip),%rdi
mov    $0x8,%esi
mov    $0x5a,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
mov    $0x5a,%edx
mov    $0x5a,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/union.c\00"
define void @t1() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 90, i32* %2
%3 = bitcast %union.anon* %1 to i32*
%4 = load i32, i32* %3
%5 = call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 8, i32 90, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/union.c\00"
define void @t1() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 8, i32 90, i32 90)
ret void
}
int y() {
  int a = 0;
  int b = 1;
  int c = 4;
  return a + b + c;
}


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

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

LLVM IR (-O0):
define i32 @y() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 4, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @y() {
ret i32 5
}
int repeat(char input, int number, char *psBuffer) {
  for (int i = 0; i < number; i++) {
    psBuffer[i] = input;
  }
  return 1;
}


x86 assembly (clang, -O0):
<repeat>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <repeat+0x40>
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <repeat+0x18>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat>:
test   %esi,%esi
jle    112a <repeat+0x1a>
push   %rax
mov    %esi,%eax
movzbl %dil,%esi
mov    %rdx,%rdi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @repeat(i8 signext %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ generate_small_primes(int, int);
void prime_init() { generate_small_primes(16384, 3); }


x86 assembly (clang, -O0):
<prime_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000,%edi
mov    $0x3,%esi
call   1030 <generate_small_primes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime_init>:
mov    $0x4000,%edi
mov    $0x3,%esi
jmp    1030 <generate_small_primes@plt>

LLVM IR (-O0):
define void @prime_init() {
%1 = call i32 @generate_small_primes(i32 16384, i32 3)
ret void
}

LLVM IR (-O2):
define void @prime_init() {
%1 = tail call i32 @generate_small_primes(i32 16384, i32 3)
ret void
}
__attribute__((always_)) void set_kernel_text_rw(void) {}


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

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

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

LLVM IR (-O2):
define void @set_kernel_text_rw() {
ret void
}
short strLenWithoutEscapes(const char *str) {
  short i, count;
  count = 0;
  for (i = 0; str[i];) {
    if (str[i] == 25) {
      i += 4;
      continue;
    }
    count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<strLenWithoutEscapes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xc(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116a <strLenWithoutEscapes+0x6a>
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x19,%eax
jne    114d <strLenWithoutEscapes+0x4d>
movswl -0xa(%rbp),%eax
add    $0x4,%eax
mov    %ax,-0xa(%rbp)
jmp    1114 <strLenWithoutEscapes+0x14>
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    1114 <strLenWithoutEscapes+0x14>
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLenWithoutEscapes>:
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1113 <strLenWithoutEscapes+0x13>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%ecx
movswq %cx,%rdx
movzbl (%rdi,%rdx,1),%edx
cmp    $0x19,%dl
je     1110 <strLenWithoutEscapes+0x10>
test   %dl,%dl
je     112c <strLenWithoutEscapes+0x2c>
add    $0x1,%eax
add    $0x1,%ecx
jmp    1113 <strLenWithoutEscapes+0x13>
ret

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

LLVM IR (-O2):
define signext i16 @strLenWithoutEscapes(i8* nocapture %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i16 [ %14, %12 ], [ 0, %1 ]
%4 = phi i16 [ %13, %12 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %10
%6 = phi i16 [ %11, %10 ], [ %3, %2 ]
%7 = sext i16 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
switch i8 %9, label %12 [
i8 0, label %15
i8 25, label %10
]
10: ; preds = %5
%11 = add i16 %6, 4
br label %5
12: ; preds = %5
%13 = add i16 %4, 1
%14 = add i16 %6, 1
br label %2
15: ; preds = %5
ret i16 %4
}
test() {
  printf("\n%s: \n", __func__);
  printf(" test lib\n");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.test = [5 x i8] c"test\00"
@.str.1 = [11 x i8] c" test lib\0A\00"
define i32 @test() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s: \0A\00"
@__func__.test = [5 x i8] c"test\00"
@str = [10 x i8] c" test lib\00"
define i32 @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.test, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void mpool_create() {}


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

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

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

LLVM IR (-O2):
define void @mpool_create() {
ret void
}
int prost(int n) {
  int i;
  if (n == 1)
    return 1;
  for (i = 2; i < n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<prost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <prost+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <prost+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <prost+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <prost+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <prost+0x66>
jmp    1151 <prost+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <prost+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prost>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <prost+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <prost+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <prost+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @prost(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 0, %5 ], [ 1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x9d() {
  Assert_real((isascii(157) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              790, ("isascii should be 0 for 0x9d"));
}


x86 assembly (clang, -O0):
<t_isascii_0x9d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9d,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x316,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x316,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9d\00"
define void @t_isascii_0x9d() {
%1 = call i64 @isascii(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9d\00"
define void @t_isascii_0x9d() {
%1 = tail call i64 @isascii(i32 157)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(242, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<write_quaddobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf2,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quaddobl_target_system>:
mov    $0xf2,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_quaddobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 242, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 242, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ emit_readword(int, int);
void emit_readptr(int addr, int rt) { emit_readword(addr, rt); }


x86 assembly (clang, -O0):
<emit_readptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <emit_readword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_readptr>:
jmp    1030 <emit_readword@plt>

LLVM IR (-O0):
define void @emit_readptr(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 = call i32 @emit_readword(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @emit_readptr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_readword(i32 %0, i32 %1)
ret void
}
unsigned long gettasknum(void) {
  unsigned long tmptasknum;
  asm("mov $0x201,%%eax;int $0x40" : "=a"(tmptasknum));
  return tmptasknum;
}


x86 assembly (clang, -O0):
<gettasknum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x201,%eax
int    $0x40
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettasknum>:
mov    $0x201,%eax
int    $0x40
ret

LLVM IR (-O0):
define i64 @gettasknum() {
%1 = alloca i64
%2 = call i64 asm "mov $$0x201,%eax;int $$0x40", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @gettasknum() {
%1 = tail call i64 asm "mov $$0x201,%eax;int $$0x40", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void test1_ArrayAssign_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test1_ArrayAssign_pollen__run__E() {
ret void
}
/* Variables and functions */
int output_file(char *);
int main(int argc, char *argv[]) {
  int i = 0, status = 0;
  while (++i < argc && !status)
    status = output_file(argv[i]);
  return status;
}


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)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1157 <main+0x47>
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1167 <main+0x57>
jmp    1180 <main+0x70>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <output_file@plt>
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
cmp    $0x2,%edi
jl     1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
mov    -0x8(%r14,%rbx,8),%rdi
call   1030 <output_file@plt>
cmp    %r15,%rbx
jae    1147 <main+0x37>
add    $0x1,%rbx
test   %eax,%eax
je     1130 <main+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @output_file(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp ult i64 %11, %5
%13 = icmp eq i32 %10, 0
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %16
}
void sigwinch_handler(int signum) { signum = 0; }


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

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

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

LLVM IR (-O2):
define void @sigwinch_handler(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
extern const char *onig_copyright(void) {
  static char s[58];
  snprintf(s, sizeof(s),
           "Oniguruma %d.%d.%d : Copyright (C) 2002-2018 K.Kosako", 6, 9, 1);
  return s;
}


x86 assembly (clang, -O0):
<onig_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x3a,%esi
lea    0xed9(%rip),%rdx
mov    $0x6,%ecx
mov    $0x9,%r8d
mov    $0x1,%r9d
call   1030 <snprintf@plt>
lea    0x2efc(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onig_copyright>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3a,%esi
mov    $0x6,%ecx
mov    $0x9,%r8d
mov    $0x1,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2018 K.Kosako\00"
define i8* @onig_copyright() {
%1 = call i32 @snprintf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i32 58, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 6, i32 9, i32 1)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}

LLVM IR (-O2):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2018 K.Kosako\00"
define i8* @onig_copyright() {
%1 = tail call i32 @snprintf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i32 58, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 6, i32 9, i32 1)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}
/* Variables and functions */
char toupper(char);
void Uprcase(char *s) {
  char *p = s;
  while ((*p = toupper(*p)))
    p++;
}


x86 assembly (clang, -O0):
<Uprcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <Uprcase+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Uprcase+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uprcase>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <Uprcase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Uprcase(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_opts(int, char **);
int /*<<< orphan*/ wdt_test();
int main(int argc, char *argv[]) {
  parse_opts(argc, argv);
  wdt_test();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_opts(i32 %6, i8** %7)
%9 = call i32 (...) @wdt_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_opts(i32 %0, i8** %1)
%4 = tail call i32 (...) @wdt_test()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vsnprintf(char *, int, char const *const,
                             int /*<<< orphan*/);
void vprint_message(const char *const format, va_list args) {
  char buffer[1024];
  vsnprintf(buffer, sizeof(buffer), format, args);
  printf(buffer);
}


x86 assembly (clang, -O0):
<vprint_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprint_message>:
push   %rbx
sub    $0x400,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vprint_message(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %7, i32 %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* %10)
ret void
}

LLVM IR (-O2):
define void @vprint_message(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = call i32 @printf(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diag(char *, unsigned int);
int exit_status();
unsigned int plan_skip_all(char *);
int main(int argc, char *argv[]) {
  unsigned int rc = 0;
  rc = plan_skip_all("No good reason");
  diag("Returned: %d", rc);
  return exit_status();
}


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)
lea    0xeac(%rip),%rdi
call   1030 <plan_skip_all@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1050 <diag@plt>
mov    $0x0,%al
call   1040 <exit_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <plan_skip_all@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1050 <diag@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <exit_status@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"No good reason\00"
@.str.1 = [13 x i8] c"Returned: %d\00"
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
%7 = call i32 @plan_skip_all(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @diag(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @exit_status()
ret i32 %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"No good reason\00"
@.str.1 = [13 x i8] c"Returned: %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @plan_skip_all(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @diag(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @exit_status()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int strcmp(char const *, char const *);
int strcmp_wrapper(const void *a, const void *b) {
  assert(a);
  assert(b);
  const char *str_a = a;
  const char *str_b = b;
  return strcmp(str_a, str_b);
}


x86 assembly (clang, -O0):
<strcmp_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_wrapper>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcmp_wrapper(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @assert(i8* %9)
%11 = load i8*, i8** %3
store i8* %11, i8** %5
%12 = load i8*, i8** %4
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strcmp_wrapper(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void cleanup_module() { printk("<1>Short is the life of a kernel module\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"<1>Short is the life of a kernel module\0A\00"
define void @cleanup_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"<1>Short is the life of a kernel module\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ otheraddr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int accept_server_socket(int sock) {
  socklen_t otheraddrlen;
  struct sockaddr_in otheraddr;
  int fd;
  if (sock != -1) {
    otheraddrlen = sizeof(otheraddr);
    fd = accept(sock, (struct sockaddr *)&otheraddr, &otheraddrlen);
  }
  return fd;
}


x86 assembly (clang, -O0):
<accept_server_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     113f <accept_server_socket+0x2f>
movl   $0x4,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_server_socket>:
cmp    $0xffffffff,%edi
je     1135 <accept_server_socket+0x25>
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
add    $0x18,%rsp
ret
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_server_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
store i32 4, i32* %3
%9 = load i32, i32* %2
%10 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%11 = call i32 @accept(i32 %9, %struct.sockaddr* %10, i32* %3)
store i32 %11, i32* %5
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @accept_server_socket(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = icmp eq i32 %0, -1
br i1 %6, label %10, label %7
7: ; preds = %1
store i32 4, i32* %2
%8 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%9 = call i32 @accept(i32 %0, %struct.sockaddr* %8, i32* %2)
br label %10
10: ; preds = %7, %1
%11 = phi i32 [ %9, %7 ], [ undef, %1 ]
ret i32 %11
}
/* Type definitions */
struct rnn_runner {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rnn_runner *);
void _delete_rnn_runner(struct rnn_runner *runner) { free(runner); }


x86 assembly (clang, -O0):
<_delete_rnn_runner>:
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):
<_delete_rnn_runner>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rnn_runner = type { i32 }
define void @_delete_rnn_runner(%struct.rnn_runner* %0) {
%2 = alloca %struct.rnn_runner*
store %struct.rnn_runner* %0, %struct.rnn_runner** %2
%3 = load %struct.rnn_runner*, %struct.rnn_runner** %2
%4 = call i32 @free(%struct.rnn_runner* %3)
ret void
}

LLVM IR (-O2):
%struct.rnn_runner = type { i32 }
define void @_delete_rnn_runner(%struct.rnn_runner* nocapture %0) {
%2 = tail call i32 @free(%struct.rnn_runner* %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
long long Nife_time(struct timeval);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putLong(long long);
void IF_time(void) {
  struct timeval tv;
  long long v;
  gettimeofday(&tv, NULL);
  v = Nife_time(tv);
  putLong(v);
}


x86 assembly (clang, -O0):
<IF_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1050 <Nife_time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <putLong@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%edi
call   1050 <Nife_time@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <putLong@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @IF_time() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @Nife_time(i32 %5)
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @putLong(i64 %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @IF_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i64 @Nife_time(i32 %5)
%7 = tail call i32 @putLong(i64 %6)
ret void
}
/* Variables and functions */
short *malloc(int);
int main() {
  volatile short *arr = malloc(10 * sizeof(short));
  arr[5] = 212;
  arr[4] = 43;
  return arr[5] + arr[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0xd4,0xa(%rax)
mov    -0x10(%rbp),%rax
movw   $0x2b,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0xa(%rax),%ax
cwtl
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%cx
movswl %cx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <malloc@plt>
movw   $0xd4,0xa(%rax)
movw   $0x2b,0x8(%rax)
movswl 0xa(%rax),%ecx
movswl 0x8(%rax),%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16*
store i32 0, i32* %1
%3 = call i16* @malloc(i32 20)
store i16* %3, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 5
store volatile i16 212, i16* %5
%6 = load i16*, i16** %2
%7 = getelementptr inbounds i16, i16* %6, i64 4
store volatile i16 43, i16* %7
%8 = load i16*, i16** %2
%9 = getelementptr inbounds i16, i16* %8, i64 5
%10 = load volatile i16, i16* %9
%11 = sext i16 %10 to i32
%12 = load i16*, i16** %2
%13 = getelementptr inbounds i16, i16* %12, i64 4
%14 = load volatile i16, i16* %13
%15 = sext i16 %14 to i32
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i16* @malloc(i32 20)
%2 = getelementptr inbounds i16, i16* %1, i64 5
store volatile i16 212, i16* %2
%3 = getelementptr inbounds i16, i16* %1, i64 4
store volatile i16 43, i16* %3
%4 = load volatile i16, i16* %2
%5 = sext i16 %4 to i32
%6 = load volatile i16, i16* %3
%7 = sext i16 %6 to i32
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[100];
  itob(3, s, 16);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
mov    $0x3,%edi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 3, i8* %2, i32 16)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 3, i8* %2, i32 16)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int test_imm_89int32_reg(int val) { return ((val) & (0x89 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_89int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89int32_reg>:
test   $0x89,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_89int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 137
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_89int32_reg(i32 %0) {
%2 = and i32 %0, 137
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}