xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int size;

/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *do_alloc(size_t size) {
  void *retptr = NULL;
  size_t real_size = (((size) + (8) - 1) & ~((8) - 1));
  retptr = malloc(real_size);
  if (!retptr)
    return NULL;
  memset(retptr, 0, real_size);
  return retptr;
}


x86 assembly (clang, -O0):
<do_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
sub    $0x1,%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <do_alloc+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1184 <do_alloc+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x7,%rbx
and    $0xfffffffffffffff8,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     114c <do_alloc+0x2c>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @do_alloc(i64 %0) {
%2 = add i64 %0, 7
%3 = and i64 %2, -8
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
int min(int x, int y) {
  if (x < y) {
    return x;
  }
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct rnode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ is_leaf(struct rnode *);
int /*<<< orphan*/ is_root(struct rnode *);
int is_inner_node(struct rnode *node) {
  return (!is_leaf(node) && !is_root(node));
}


x86 assembly (clang, -O0):
<is_inner_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_leaf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1159 <is_inner_node+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <is_root@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_inner_node>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_leaf@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <is_inner_node+0x13>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_root@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.rnode = type { i32 }
define i32 @is_inner_node(%struct.rnode* %0) {
%2 = alloca %struct.rnode*
store %struct.rnode* %0, %struct.rnode** %2
%3 = load %struct.rnode*, %struct.rnode** %2
%4 = call i32 @is_leaf(%struct.rnode* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.rnode*, %struct.rnode** %2
%8 = call i32 @is_root(%struct.rnode* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.rnode = type { i32 }
define i32 @is_inner_node(%struct.rnode* %0) {
%2 = tail call i32 @is_leaf(%struct.rnode* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @is_root(%struct.rnode* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 0; i < 10; i += 10) {
    printf("i: %d\n", i);
  }
  printf("i: %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"i: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void example_3(char c) {
  int ca = 0;
  int cb = 0;
  int cc = 0;
  int cC = 0;
  int cOther = 0;
  switch (c) {
  case 'a':
    ca++;
    break;
  case 'b':
    ca++;
    break;
  case 'c':
    ca++;
    break;
  case 'C':
    ca++;
    break;
  default:
    cOther++;
  }
}


x86 assembly (clang, -O0):
<example_3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x20,%eax
ja     118f <example_3+0x8f>
mov    -0x20(%rbp),%rax
lea    0xeb2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <example_3+0x98>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <example_3+0x98>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <example_3+0x98>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <example_3+0x98>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @example_3(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
switch i32 %9, label %22 [
i32 97, label %10
i32 98, label %13
i32 99, label %16
i32 67, label %19
]
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %25
13: ; preds = %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %25
16: ; preds = %1
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %25
19: ; preds = %1
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %25
22: ; preds = %1
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %25
25: ; preds = %22, %19, %16, %13, %10
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @caam_rng_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void stop() {
  (void)fprintf(stderr, "*** Stop.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<stop>:
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):
<stop>:
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 = [11 x i8] c"*** Stop.\0A\00"
define void @stop() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"*** Stop.\0A\00"
define void @stop() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
short int get_short_be(const char *cp) {
  short int ret;
  unsigned char *source = (unsigned char *)cp;
  if (NULL == cp)
    return 0;
  ret = ((*source++) << 8);
  ret += *source++;
  return ret;
}


x86 assembly (clang, -O0):
<get_short_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1127 <get_short_be+0x27>
movw   $0x0,-0x2(%rbp)
jmp    1164 <get_short_be+0x64>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%ecx
movswl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_short_be>:
test   %rdi,%rdi
je     110d <get_short_be+0xd>
movzwl (%rdi),%eax
rol    $0x8,%ax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_short_be(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %0
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = load i8, i8* %4
%9 = zext i8 %8 to i16
%10 = or i16 %7, %9
br label %11
11: ; preds = %1, %3
%12 = phi i16 [ %10, %3 ], [ 0, %1 ]
ret i16 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage_params(FILE *out) {
  fprintf(out, "  --value=NUMBER		background tone value\n");
}


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

x86 assembly (clang, -O2):
<usage_params>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x28,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [41 x i8] c" --value=NUMBER\09\09background tone value\0A\00"
define void @usage_params(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c" --value=NUMBER\09\09background tone value\0A\00"
define void @usage_params(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 40, i64 1, i32* %0)
ret void
}
/* Variables and functions */
void *realloc(void *, int);
void grow_array(void **array, int nelem, size_t elsize) {
  if (!(nelem & 31))
    *array = realloc(*array, (nelem + 32) * elsize);
}


x86 assembly (clang, -O0):
<grow_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
cmp    $0x0,%eax
jne    1157 <grow_array+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%eax
add    $0x20,%eax
cltq
imul   -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_array>:
test   $0x1f,%sil
je     1117 <grow_array+0x7>
ret
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
add    $0x20,%esi
imul   %esi,%edx
mov    %edx,%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @grow_array(i8** %0, i32 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i64
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 31
%9 = icmp ne i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %3
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 32
%15 = sext i32 %14 to i64
%16 = load i64, i64* %6
%17 = mul i64 %15, %16
%18 = trunc i64 %17 to i32
%19 = call i8* @realloc(i8* %12, i32 %18)
%20 = load i8**, i8*** %4
store i8* %19, i8** %20
br label %21
21: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @grow_array(i8** nocapture %0, i32 %1, i64 %2) {
%4 = and i32 %1, 31
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = add nsw i32 %1, 32
%9 = trunc i64 %2 to i32
%10 = mul i32 %8, %9
%11 = tail call i8* @realloc(i8* %7, i32 %10)
store i8* %11, i8** %0
br label %12
12: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummy(int, int);
int f2(int i) {
  int j;
  dummy(4, i);
  j = i;
  dummy(5, i);
  dummy(6, j);
  j = j + 1;
  dummy(7, i);
  dummy(8, j);
  j = j - i;
  dummy(9, i);
  dummy(10, j);
  return i;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1030 <dummy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%esi
mov    $0x6,%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7,%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%esi
mov    $0x8,%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x9,%edi
call   1030 <dummy@plt>
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <dummy@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x4,%edi
mov    %ebx,%esi
call   1030 <dummy@plt>
mov    $0x5,%edi
mov    %ebx,%esi
call   1030 <dummy@plt>
mov    $0x6,%edi
mov    %ebx,%esi
call   1030 <dummy@plt>
lea    0x1(%rbx),%ebp
mov    $0x7,%edi
mov    %ebx,%esi
call   1030 <dummy@plt>
mov    $0x8,%edi
mov    %ebp,%esi
call   1030 <dummy@plt>
mov    $0x9,%edi
mov    %ebx,%esi
call   1030 <dummy@plt>
mov    $0xa,%edi
mov    $0x1,%esi
call   1030 <dummy@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dummy(i32 4, i32 %4)
%6 = load i32, i32* %2
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @dummy(i32 5, i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @dummy(i32 6, i32 %9)
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = call i32 @dummy(i32 7, i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @dummy(i32 8, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = call i32 @dummy(i32 9, i32 %20)
%22 = load i32, i32* %3
%23 = call i32 @dummy(i32 10, i32 %22)
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
%2 = tail call i32 @dummy(i32 4, i32 %0)
%3 = tail call i32 @dummy(i32 5, i32 %0)
%4 = tail call i32 @dummy(i32 6, i32 %0)
%5 = add nsw i32 %0, 1
%6 = tail call i32 @dummy(i32 7, i32 %0)
%7 = tail call i32 @dummy(i32 8, i32 %5)
%8 = tail call i32 @dummy(i32 9, i32 %0)
%9 = tail call i32 @dummy(i32 10, i32 1)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x64() {
  Assert_real((isgraph(100)),
              "/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_isgraph.c",
              505, ("isgraph should be 1 for d"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x64>:
push   %rax
mov    $0x64,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1f9,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for d\00"
define void @t_isgraph_0x64() {
%1 = call i32 @isgraph(i32 100)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for d\00"
define void @t_isgraph_0x64() {
%1 = tail call i32 @isgraph(i32 100)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo_1_2_2_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_2_2_1_1() {
ret void
}
int test_imm_86uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x86 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_86uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x86,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_86uint64_midword_mem>:
testb  $0x86,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_86uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8781824
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_help() {
  printf("USE: "
         "toporobot2survex"
         " [input Toporobot file] [destination Survex folder]\n");
  printf("\n");
  printf("[input toporobot file] must be a Toporobot .Tab file\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"USE: toporobot2survex [input Toporobot file] [destination Survex folder]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [54 x i8] c"[input toporobot file] must be a Toporobot .Tab file\0A\00"
define i32 @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [73 x i8] c"USE: toporobot2survex [input Toporobot file] [destination Survex folder]\00"
@str.3 = [53 x i8] c"[input toporobot file] must be a Toporobot .Tab file\00"
define i32 @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.3, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGALRM;
int sigismember(int /*<<< orphan*/ *, int);
void test(void) {
  sigset_t signal_set;
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = sigismember(&signal_set, signal_number);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1030 <sigismember@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <sigismember@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @SIGALRM
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sigismember(i32* %1, i32 %5)
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigismember(i32* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void qr_diran(char *binary, int data, int h) {
  for (; h; h >>= 1) {
    strcat(binary, data & h ? "1" : "0");
  }
}


x86 assembly (clang, -O0):
<qr_diran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115e <qr_diran+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
lea    0xec5(%rip),%rsi
lea    0xebc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <strcat@plt>
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <qr_diran+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qr_diran>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     115b <qr_diran+0x4b>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r13
lea    0xed4(%rip),%r15
lea    0xecb(%rip),%r12
mov    %edx,%ebp
nopw   0x0(%rax,%rax,1)
test   %r14d,%ebx
mov    %r12,%rsi
cmove  %r15,%rsi
mov    %r13,%rdi
call   1030 <strcat@plt>
sar    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1140 <qr_diran+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @qr_diran(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %19, %3
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%18 = call i32 @strcat(i8* %11, i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = ashr i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @qr_diran(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ %2, %3 ]
%7 = and i32 %6, %1
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%10 = tail call i32 @strcat(i8* %0, i8* %9)
%11 = ashr i32 %6, 1
%12 = icmp ult i32 %6, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
/* Type definitions */
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ htprintf(struct html *, char *, char const *);
void print_heading(struct html *ctx, const char *title) {
  htprintf(ctx,
           "<tr style=\"padding: 0.2em; background-color:#e0e0e0\">\n"
           "<td colspan=4 align=center>%s</td>\n</tr>\n",
           title);
}


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

x86 assembly (clang, -O2):
<print_heading>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <htprintf@plt>

LLVM IR (-O0):
%struct.html = type { i32 }
@.str = [96 x i8] c"<tr style=\22padding: 0.2em; background-color:#e0e0e0\22>\0A<td colspan=4 align=center>%s</td>\0A</tr>\0A\00"
define void @print_heading(%struct.html* %0, i8* %1) {
%3 = alloca %struct.html*
%4 = alloca i8*
store %struct.html* %0, %struct.html** %3
store i8* %1, i8** %4
%5 = load %struct.html*, %struct.html** %3
%6 = load i8*, i8** %4
%7 = call i32 @htprintf(%struct.html* %5, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.html = type { i32 }
@.str = [96 x i8] c"<tr style=\22padding: 0.2em; background-color:#e0e0e0\22>\0A<td colspan=4 align=center>%s</td>\0A</tr>\0A\00"
define void @print_heading(%struct.html* %0, i8* %1) {
%3 = tail call i32 @htprintf(%struct.html* %0, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void Util_ZeroFreeString(char *str) {
  if (str != ((void *)0)) {
    Util_Zero(str, strlen(str));
    free(str);
  }
}


x86 assembly (clang, -O0):
<Util_ZeroFreeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <Util_ZeroFreeString+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1040 <Util_Zero@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_ZeroFreeString>:
test   %rdi,%rdi
je     1154 <Util_ZeroFreeString+0x24>
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <Util_Zero@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @Util_ZeroFreeString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @Util_Zero to i32 (i8*, i64, ...)*)(i8* %6, i64 %8)
%10 = load i8*, i8** %2
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Util_ZeroFreeString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @Util_Zero to i32 (i8*, i64, ...)*)(i8* %0, i64 %4)
tail call void @free(i8* %0)
br label %6
6: ; preds = %3, %1
ret void
}
void gtk_window_set_default_icon_list() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_default_icon_list() {
ret void
}
int ld_blg_mr1(long double *a1, long double a2) {
  return (__builtin_islessgreater(*a1, a2));
}


x86 assembly (clang, -O0):
<ld_blg_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setne  %al
ret

LLVM IR (-O0):
define i32 @ld_blg_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp one x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_blg_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp one x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int read(int, unsigned char *, int);
int net_getc(int fd) {
  unsigned char c[2];
  int r;
  r = read(fd, c, 1);
  if (r <= 0)
    return (-1);
  else
    return (c[0]);
}


x86 assembly (clang, -O0):
<net_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     1145 <net_getc+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <net_getc+0x3c>
movzbl -0xa(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_getc>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
movzbl 0x6(%rsp),%ecx
mov    $0xffffffff,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @net_getc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %16
12: ; preds = %1
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @net_getc(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 1)
%5 = icmp slt i32 %4, 1
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", (int)sizeof(long));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_prandom_double_range();
int /*<<< orphan*/ test_prandom_int_range();
int /*<<< orphan*/ test_prandom_seed();
int /*<<< orphan*/ test_random_char();
int /*<<< orphan*/ test_random_int();
int /*<<< orphan*/ test_random_llong();
int /*<<< orphan*/ test_random_long();
void test_run() {
  test_random_int();
  test_random_char();
  test_random_long();
  test_random_llong();
  test_prandom_seed();
  test_prandom_int_range();
  test_prandom_double_range();
}


x86 assembly (clang, -O0):
<test_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <test_random_int@plt>
mov    $0x0,%al
call   1050 <test_random_char@plt>
mov    $0x0,%al
call   1030 <test_random_long@plt>
mov    $0x0,%al
call   1070 <test_random_llong@plt>
mov    $0x0,%al
call   1060 <test_prandom_seed@plt>
mov    $0x0,%al
call   1090 <test_prandom_int_range@plt>
mov    $0x0,%al
call   1040 <test_prandom_double_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_run>:
push   %rax
xor    %eax,%eax
call   1080 <test_random_int@plt>
xor    %eax,%eax
call   1050 <test_random_char@plt>
xor    %eax,%eax
call   1030 <test_random_long@plt>
xor    %eax,%eax
call   1070 <test_random_llong@plt>
xor    %eax,%eax
call   1060 <test_prandom_seed@plt>
xor    %eax,%eax
call   1090 <test_prandom_int_range@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_prandom_double_range@plt>

LLVM IR (-O0):
define void @test_run() {
%1 = call i32 (...) @test_random_int()
%2 = call i32 (...) @test_random_char()
%3 = call i32 (...) @test_random_long()
%4 = call i32 (...) @test_random_llong()
%5 = call i32 (...) @test_prandom_seed()
%6 = call i32 (...) @test_prandom_int_range()
%7 = call i32 (...) @test_prandom_double_range()
ret void
}

LLVM IR (-O2):
define void @test_run() {
%1 = tail call i32 (...) @test_random_int()
%2 = tail call i32 (...) @test_random_char()
%3 = tail call i32 (...) @test_random_long()
%4 = tail call i32 (...) @test_random_llong()
%5 = tail call i32 (...) @test_prandom_seed()
%6 = tail call i32 (...) @test_prandom_int_range()
%7 = tail call i32 (...) @test_prandom_double_range()
ret void
}
void ScalePlaneBilinearUp_16() {}


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

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

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

LLVM IR (-O2):
define void @ScalePlaneBilinearUp_16() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t pack_get_adr(uint8_t *buffer, int byteNr) {
  return ((*((uint8_t *)(buffer + byteNr + 3))) << 24 |
          (*((uint8_t *)(buffer + byteNr + 2))) << 16 |
          (*((uint8_t *)(buffer + byteNr + 1))) << 8 |
          (*((uint8_t *)(buffer + byteNr))));
}


x86 assembly (clang, -O0):
<pack_get_adr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    0xc(%rax,%rcx,4),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    0x8(%rcx,%rdx,4),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    0x4(%rcx,%rdx,4),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
or     (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_get_adr>:
movslq %esi,%rcx
mov    0xc(%rdi,%rcx,4),%edx
shl    $0x18,%edx
mov    0x4(%rdi,%rcx,4),%eax
mov    0x8(%rdi,%rcx,4),%esi
shl    $0x10,%esi
or     %edx,%esi
shl    $0x8,%eax
or     %esi,%eax
or     (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @pack_get_adr(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = shl i32 %10, 24
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = shl i32 %17, 16
%19 = or i32 %11, %18
%20 = load i32*, i32** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = shl i32 %25, 8
%27 = or i32 %19, %26
%28 = load i32*, i32** %3
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = or i32 %27, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @pack_get_adr(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i32, i32* %4, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %10, %7
%12 = getelementptr inbounds i32, i32* %4, i64 1
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %4
%17 = or i32 %15, %16
ret i32 %17
}
main() { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
void marker_bit(char *text) {
  signed int marker;
  unsigned int return_value_Get_Bits$1;
  return_value_Get_Bits$1 = Get_Bits(1);
  marker = (signed int)return_value_Get_Bits$1;
}


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

x86 assembly (clang, -O2):
<marker_bit>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <Get_Bits@plt>

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

LLVM IR (-O2):
define void @marker_bit(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
ret void
}
int isRoot(int i) { return (i == 1); }


x86 assembly (clang, -O0):
<isRoot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRoot>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isRoot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isRoot(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int constant();
int /*<<< orphan*/ f();
void main() {
  int i1;
  int i2;
  i1 = constant();
  f();
  i2 = constant();
  assert(i1 == i2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <constant@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1050 <constant@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <constant@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1050 <constant@plt>
xor    %edi,%edi
cmp    %eax,%ebx
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @constant()
store i32 %3, i32* %1
%4 = call i32 (...) @f()
%5 = call i32 (...) @constant()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @constant()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @constant()
%4 = icmp eq i32 %1, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *scat(char *s, char *t) {
  char *z = malloc(strlen(s) + strlen(t) + 1);
  strcpy(z, s);
  strcat(z, t);
  free(s);
  free(t);
  return z;
}


x86 assembly (clang, -O0):
<scat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1050 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @scat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %3
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %4
%22 = call i32 @free(i8* %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @scat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
%10 = tail call i32 @free(i8* %0)
%11 = tail call i32 @free(i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ yasm_error_clear();
int /*<<< orphan*/ yasm_warn_clear();
void yasm_errwarn_cleanup(void) {
  yasm_error_clear();
  yasm_warn_clear();
}


x86 assembly (clang, -O0):
<yasm_errwarn_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <yasm_error_clear@plt>
mov    $0x0,%al
call   1030 <yasm_warn_clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yasm_errwarn_cleanup>:
push   %rax
xor    %eax,%eax
call   1040 <yasm_error_clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <yasm_warn_clear@plt>

LLVM IR (-O0):
define void @yasm_errwarn_cleanup() {
%1 = call i32 (...) @yasm_error_clear()
%2 = call i32 (...) @yasm_warn_clear()
ret void
}

LLVM IR (-O2):
define void @yasm_errwarn_cleanup() {
%1 = tail call i32 (...) @yasm_error_clear()
%2 = tail call i32 (...) @yasm_warn_clear()
ret void
}
int foo(int n, int a[]) { return a[n - 1]; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edi,%rax
mov    -0x4(%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
void ScaleAddRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_Any_SSE2() {
ret void
}