xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ game_init_land_ownership();
int /*<<< orphan*/ init_spiral_pos_pattern();
int load_state(char const *);
int /*<<< orphan*/ map_init_minimap();
int game_load_save_game(const char *path) {
  int r = load_state(path);
  if (r < 0)
    return -1;
  init_spiral_pos_pattern();
  game_init_land_ownership();
  map_init_minimap();
  return 0;
}


x86 assembly (clang, -O0):
<game_load_save_game>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <load_state@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    116e <game_load_save_game+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <game_load_save_game+0x4a>
mov    $0x0,%al
call   1040 <init_spiral_pos_pattern@plt>
mov    $0x0,%al
call   1060 <game_init_land_ownership@plt>
mov    $0x0,%al
call   1050 <map_init_minimap@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_load_save_game>:
push   %rbx
call   1030 <load_state@plt>
test   %eax,%eax
js     1163 <game_load_save_game+0x23>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <init_spiral_pos_pattern@plt>
xor    %eax,%eax
call   1060 <game_init_land_ownership@plt>
xor    %eax,%eax
call   1050 <map_init_minimap@plt>
jmp    1168 <game_load_save_game+0x28>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @game_load_save_game(i8* %0) {
%2 = tail call i32 @load_state(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 (...) @init_spiral_pos_pattern()
%6 = tail call i32 (...) @game_init_land_ownership()
%7 = tail call i32 (...) @map_init_minimap()
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int cons_getc();
int getchar(void) {
  int c;
  while ((c = cons_getc()) == 0)
    ;
  return c;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cons_getc@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1130 <getchar+0x20>
jmp    1118 <getchar+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cons_getc@plt>
test   %eax,%eax
je     1120 <getchar+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getchar() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @cons_getc()
store i32 %3, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @getchar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @cons_getc()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 %2
}
int JroundUp(int a, int b) {
  a += b - 1;
  return a - (a % b);
}


x86 assembly (clang, -O0):
<JroundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JroundUp>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @JroundUp(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @JroundUp(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bitfn_swap32(int /*<<< orphan*/);
void array_swap32(uint32_t *d, uint32_t *s, uint32_t nb) {
  while (nb--)
    *d++ = bitfn_swap32(*s++);
}


x86 assembly (clang, -O0):
<array_swap32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1165 <array_swap32+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
call   1030 <bitfn_swap32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    1123 <array_swap32+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_swap32>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <array_swap32+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <bitfn_swap32@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <array_swap32+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @array_swap32(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = phi i32* [ %10, %5 ], [ %1, %3 ]
%8 = phi i32* [ %13, %5 ], [ %0, %3 ]
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = load i32, i32* %7
%12 = tail call i32 @bitfn_swap32(i32 %11)
%13 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %12, i32* %8
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
void *copy_memory(char *dst, char *src, unsigned size) {
  for (unsigned i = 0; i < (1000 * 1000); i++) {
    dst[size % 10] = src[size % 20];
  }
}


x86 assembly (clang, -O0):
<copy_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xf4240,-0x20(%rbp)
jae    1173 <copy_memory+0x73>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x14,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x38(%rbp),%rax
mov    %edx,%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x30(%rbp),%rax
mov    %edx,%ecx
mov    -0x21(%rbp),%dl
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <copy_memory+0x16>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_memory>:
mov    %edx,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
mov    %rcx,%rax
shr    $0x24,%rax
shl    $0x2,%eax
lea    (%rax,%rax,4),%r8d
mov    %edx,%r9d
sub    %r8d,%r9d
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%edx
mov    $0xf4240,%ecx
nop
movzbl (%rsi,%r9,1),%eax
mov    %al,(%rdi,%rdx,1)
movzbl (%rsi,%r9,1),%eax
mov    %al,(%rdi,%rdx,1)
movzbl (%rsi,%r9,1),%eax
mov    %al,(%rdi,%rdx,1)
movzbl (%rsi,%r9,1),%eax
mov    %al,(%rdi,%rdx,1)
movzbl (%rsi,%r9,1),%eax
mov    %al,(%rdi,%rdx,1)
add    $0xfffffffb,%ecx
jne    1130 <copy_memory+0x30>
ret

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

LLVM IR (-O2):
define noalias i8* @copy_memory(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = urem i32 %2, 20
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = urem i32 %2, 10
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
br label %11
10: ; preds = %11
ret i8* undef
11: ; preds = %11, %3
%12 = phi i32 [ 0, %3 ], [ %18, %11 ]
%13 = load i8, i8* %6
store i8 %13, i8* %9
%14 = load i8, i8* %6
store i8 %14, i8* %9
%15 = load i8, i8* %6
store i8 %15, i8* %9
%16 = load i8, i8* %6
store i8 %16, i8* %9
%17 = load i8, i8* %6
store i8 %17, i8* %9
%18 = add nuw nsw i32 %12, 5
%19 = icmp eq i32 %18, 1000000
br i1 %19, label %10, label %11
}
int ft_isalnum(int c) {
  if (((c < 'A') || (c > 'Z')) && ((c < 'a') || (c > 'z')) &&
      ((c < '0') || (c > '9')))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <ft_isalnum+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    114f <ft_isalnum+0x4f>
cmpl   $0x61,-0x8(%rbp)
jl     112f <ft_isalnum+0x2f>
cmpl   $0x7a,-0x8(%rbp)
jle    114f <ft_isalnum+0x4f>
cmpl   $0x30,-0x8(%rbp)
jl     1143 <ft_isalnum+0x43>
cmpl   $0x39,-0x8(%rbp)
jle    114f <ft_isalnum+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1156 <ft_isalnum+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
lea    -0x5b(%rdi),%eax
cmp    $0xffffffe6,%eax
setae  %al
lea    -0x7b(%rdi),%ecx
cmp    $0xffffffe6,%ecx
setae  %cl
or     %al,%cl
add    $0xffffffc6,%edi
cmp    $0xfffffff6,%edi
setae  %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 65
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 90
br i1 %8, label %9, label %22
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 97
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 122
br i1 %14, label %15, label %22
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 48
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 57
br i1 %20, label %21, label %22
21: ; preds = %18, %15
store i32 0, i32* %2
br label %23
22: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = add i32 %0, -91
%3 = icmp ult i32 %2, -26
%4 = add i32 %0, -123
%5 = icmp ult i32 %4, -26
%6 = and i1 %3, %5
%7 = add i32 %0, -58
%8 = icmp ult i32 %7, -10
%9 = and i1 %8, %6
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}
void eglQueryContext(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglQueryContext() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setregid(gid_t effective_gid, gid_t real_gid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setregid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setregid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setregid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setregid(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  struct {
    short x, *r;
  } s1;
  s1.x = 10;
  ((unsigned char *)&s1)[3] = 1;
  printf("no undef yet\n");
  s1.x = 11;
  printf("still no undef yet\n");
  printf("will never print %d\n", ((unsigned char *)&s1)[3]);
  return 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xa,-0x18(%rbp)
movb   $0x1,-0x15(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0xb,-0x18(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x15(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { i16, i16* }
@.str = [14 x i8] c"no undef yet\0A\00"
@.str.1 = [20 x i8] c"still no undef yet\0A\00"
@.str.2 = [21 x i8] c"will never print %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i16 10, i16* %3
%4 = bitcast %struct.anon* %2 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8 1, i8* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i16 11, i16* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = bitcast %struct.anon* %2 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 10
}

LLVM IR (-O2):
@.str.2 = [21 x i8] c"will never print %d\0A\00"
@str = [13 x i8] c"no undef yet\00"
@str.3 = [19 x i8] c"still no undef yet\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret i32 10
}
/* Variables and functions */
void str_clr(char *s) {
  for (size_t i = 0; s[i] != '\0'; i++) {
    s[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<str_clr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <str_clr+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_clr+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_clr>:
cmpb   $0x0,(%rdi)
je     111d <str_clr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_clr+0x10>
ret

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

LLVM IR (-O2):
define void @str_clr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i8* [ %9, %5 ], [ %0, %1 ]
%7 = phi i64 [ %8, %5 ], [ 0, %1 ]
store i8 0, i8* %6
%8 = add i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %4, label %5
}
unsigned long Soma(int n) {
  long r = 0;
  for (int i = 1; i <= n; i++) {
    r += i;
  }
  return r;
}


x86 assembly (clang, -O0):
<Soma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <Soma+0x3c>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <Soma+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Soma>:
test   %edi,%edi
jle    111a <Soma+0x1a>
lea    -0x1(%rdi),%eax
add    $0xfffffffe,%edi
imul   %rax,%rdi
shr    %rdi
lea    (%rdi,%rax,2),%rax
add    $0x1,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @Soma(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 1
%7 = zext i32 %4 to i64
%8 = add nsw i32 %0, -2
%9 = zext i32 %8 to i64
%10 = mul nuw nsw i64 %7, %9
%11 = lshr i64 %10, 1
%12 = add nuw nsw i64 %6, %11
%13 = add nuw nsw i64 %12, 1
br label %14
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %13, %3 ]
ret i64 %15
}
long reverse(long n) {
  long reverse = 0;
  for (; n > 0; n /= 10) {
    reverse *= 10;
    reverse += n % 10;
  }
  return reverse;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1151 <reverse+0x51>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
add    -0x10(%rbp),%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <reverse+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
test   %rdi,%rdi
jle    114a <reverse+0x4a>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <reverse+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @reverse(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %14, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, 10
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = srem i64 %10, 10
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
br label %14
14: ; preds = %7
%15 = load i64, i64* %2
%16 = sdiv i64 %15, 10
store i64 %16, i64* %2
br label %4
17: ; preds = %4
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @reverse(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = urem i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = udiv i64 %5, 10
%10 = icmp ult i64 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void endDescribeFunVerbose(void) {
  fputs("\n", stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<endDescribeFunVerbose>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endDescribeFunVerbose>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @endDescribeFunVerbose() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @endDescribeFunVerbose() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
unsigned int _setr(unsigned int src2, int src1) {
  unsigned int csta = (src1 >> 5) & 0x1f;
  unsigned int cstb = src1 & 0x1f;
  if (csta > cstb)
    return src2;
  else {
    unsigned int mask = (((1 << (cstb - csta)) << 1) - 1) << csta;
    return src2 | mask;
  }
}


x86 assembly (clang, -O0):
<_setr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jbe    1136 <_setr+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <_setr+0x5a>
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setr>:
mov    %edi,%eax
mov    %esi,%edx
shr    $0x5,%edx
and    $0x1f,%edx
and    $0x1f,%esi
sub    %edx,%esi
jb     1123 <_setr+0x23>
mov    $0x2,%edi
mov    %esi,%ecx
shl    %cl,%edi
add    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_setr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%9 = load i32, i32* %5
%10 = ashr i32 %9, 5
%11 = and i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = and i32 %12, 31
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp ugt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %31
19: ; preds = %2
%20 = load i32, i32* %7
%21 = load i32, i32* %6
%22 = sub i32 %20, %21
%23 = shl i32 1, %22
%24 = shl i32 %23, 1
%25 = sub nsw i32 %24, 1
%26 = load i32, i32* %6
%27 = shl i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %4
%29 = load i32, i32* %8
%30 = or i32 %28, %29
store i32 %30, i32* %3
br label %31
31: ; preds = %19, %17
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @_setr(i32 %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 31
%5 = and i32 %1, 31
%6 = icmp ult i32 %5, %4
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = sub nsw i32 %5, %4
%9 = shl i32 2, %8
%10 = add nsw i32 %9, -1
%11 = shl i32 %10, %4
%12 = or i32 %11, %0
br label %13
13: ; preds = %2, %7
%14 = phi i32 [ %12, %7 ], [ %0, %2 ]
ret i32 %14
}
void glWaitSync(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_get_n_items() {
ret void
}
void insert_sort(void *structure, void *comparator, unsigned int elem_size,
                 unsigned int elem_count, unsigned int max_size,
                 unsigned int structure_size) {}


x86 assembly (clang, -O0):
<insert_sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @insert_sort(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret void
}
float fpconv_f32_f32(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @fpconv_f32_f32(float returned %0) {
ret float %0
}
void GetMonoPolRefProb(double mc_pol_FN, double mc_pol_FM, double mc_pol_sy,
                       double *mc_pol_prob) {
  *mc_pol_prob = mc_pol_FN * mc_pol_FN + mc_pol_FM * mc_pol_FM +
                 2 * mc_pol_FN * mc_pol_FM * mc_pol_sy;
  return;
}


x86 assembly (clang, -O0):
<GetMonoPolRefProb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMonoPolRefProb>:
movapd %xmm0,%xmm3
addsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @GetMonoPolRefProb(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %5
%11 = load double, double* %6
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
%15 = load double, double* %5
%16 = fmul double 2.000000e+00, %15
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = load double, double* %7
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double %14)
%21 = load double*, double** %8
store double %20, double* %21
ret void
}

LLVM IR (-O2):
define void @GetMonoPolRefProb(double %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = fmul double %1, %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %5)
%7 = fmul double %0, 2.000000e+00
%8 = fmul double %7, %1
%9 = tail call double @llvm.fmuladd.f64(double %8, double %2, double %6)
store double %9, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charset_tests();
int /*<<< orphan*/ input_tests();
int /*<<< orphan*/ opt_completion();
int /*<<< orphan*/ reset_tests();
int /*<<< orphan*/ set_tests();
int /*<<< orphan*/ test_quotes();
int /*<<< orphan*/ with_spaces_tests();
void all_tests(void) {
  test_quotes();
  opt_completion();
  with_spaces_tests();
  input_tests();
  set_tests();
  charset_tests();
  reset_tests();
}


x86 assembly (clang, -O0):
<all_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <test_quotes@plt>
mov    $0x0,%al
call   1060 <opt_completion@plt>
mov    $0x0,%al
call   1040 <with_spaces_tests@plt>
mov    $0x0,%al
call   1090 <input_tests@plt>
mov    $0x0,%al
call   1050 <set_tests@plt>
mov    $0x0,%al
call   1030 <charset_tests@plt>
mov    $0x0,%al
call   1070 <reset_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_tests>:
push   %rax
xor    %eax,%eax
call   1080 <test_quotes@plt>
xor    %eax,%eax
call   1060 <opt_completion@plt>
xor    %eax,%eax
call   1040 <with_spaces_tests@plt>
xor    %eax,%eax
call   1090 <input_tests@plt>
xor    %eax,%eax
call   1050 <set_tests@plt>
xor    %eax,%eax
call   1030 <charset_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <reset_tests@plt>

LLVM IR (-O0):
define void @all_tests() {
%1 = call i32 (...) @test_quotes()
%2 = call i32 (...) @opt_completion()
%3 = call i32 (...) @with_spaces_tests()
%4 = call i32 (...) @input_tests()
%5 = call i32 (...) @set_tests()
%6 = call i32 (...) @charset_tests()
%7 = call i32 (...) @reset_tests()
ret void
}

LLVM IR (-O2):
define void @all_tests() {
%1 = tail call i32 (...) @test_quotes()
%2 = tail call i32 (...) @opt_completion()
%3 = tail call i32 (...) @with_spaces_tests()
%4 = tail call i32 (...) @input_tests()
%5 = tail call i32 (...) @set_tests()
%6 = tail call i32 (...) @charset_tests()
%7 = tail call i32 (...) @reset_tests()
ret void
}
double core___core__Byte___Numeric__to_f(unsigned char self) {
  double var;
  double var1;
  var1 = (double)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Byte___Numeric__to_f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__Byte___Numeric__to_f>:
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @core___core__Byte___Numeric__to_f(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca double
%4 = alloca double
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = uitofp i8 %5 to double
store double %6, double* %4
%7 = load double, double* %4
store double %7, double* %3
br label %8
8: ; preds = %1
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @core___core__Byte___Numeric__to_f(i8 zeroext %0) {
%2 = uitofp i8 %0 to double
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
bool writeu16(FILE *fp, uint16_t val) {
  uint16_t tmp = htons(val);
  return fwrite(&tmp, sizeof(tmp), 1, fp) == 1 ? true : false;
}


x86 assembly (clang, -O0):
<writeu16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeu16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @writeu16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @htons(i32 %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %8)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @writeu16(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int errno;
int getsockopt(int, int, int, void *, int /*<<< orphan*/ *);
int os_getsockopt(int s, int level, int optname, void *optval, int *optlen) {
  int retval;
  retval = getsockopt(s, level, optname, optval, (socklen_t *)optlen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_getsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    115a <os_getsockopt+0x4a>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_getsockopt>:
push   %rax
call   1030 <getsockopt@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = select i1 %7, i32 %9, i32 %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x9f() {
  Assert_real((isodigit(159) == 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_isodigit.c",
              800, ("isodigit should be 0 for 0x9f"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x320,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9f\00"
define void @t_isodigit_0x9f() {
%1 = call i64 @isodigit(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9f\00"
define void @t_isodigit_0x9f() {
%1 = tail call i64 @isodigit(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_disconnect();
scalar_t__ strcmp(char *, char *);
int parse_disconnect(char **tokens, int n_tokens) {
  if (strcmp(tokens[0], "disconnect") == 0) {
    client_disconnect();
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<parse_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <parse_disconnect+0x3f>
mov    $0x0,%al
call   1030 <client_disconnect@plt>
movl   $0x0,-0x4(%rbp)
jmp    1166 <parse_disconnect+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_disconnect>:
push   %rbx
mov    (%rdi),%rdi
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    1143 <parse_disconnect+0x23>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <client_disconnect@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"disconnect\00"
define i32 @parse_disconnect(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @client_disconnect()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_uint8_t(int /*<<< orphan*/ *, int);
uint8_t atomic_dec_uint8_t(uint8_t *var) { return atomic_sub_uint8_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_dec_uint8_t>:
mov    $0x1,%esi
jmp    1030 <atomic_sub_uint8_t@plt>

LLVM IR (-O0):
define i32 @atomic_dec_uint8_t(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @atomic_sub_uint8_t(i32* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atomic_dec_uint8_t(i32* %0) {
%2 = tail call i32 @atomic_sub_uint8_t(i32* %0, i32 1)
ret i32 %2
}
void INT_Excep_MTU3_TCIV3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU3_TCIV3() {
ret void
}
int doSubstraction(int val1, int val2) { return val1 - val2; }


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

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

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

LLVM IR (-O2):
define i32 @doSubstraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int vga_switcheroo_process_delayed_switch(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vga_switcheroo_process_delayed_switch() {
ret i32 0
}
int WebPGetDecoderVersion(void) { return (0 << 16) | (3 << 8) | 1; }


x86 assembly (clang, -O0):
<WebPGetDecoderVersion>:
push   %rbp
mov    %rsp,%rbp
mov    $0x301,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @WebPGetDecoderVersion() {
ret i32 769
}

LLVM IR (-O2):
define i32 @WebPGetDecoderVersion() {
ret i32 769
}
unsigned int f4(unsigned int x, int y __attribute__((unused))) {
  return (x << (8 * 4 - 1)) | (x >> 1);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f4(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
char *_dlerror() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @_dlerror() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ direct();
int /*<<< orphan*/ sched();
int main(void) {
  int i = 0;
  for (i = 0; i < 100; i++) {
    sched();
    direct();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1163 <main+0x43>
mov    $0x0,%al
call   1040 <sched@plt>
mov    $0x0,%al
call   1030 <direct@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sched@plt>
xor    %eax,%eax
call   1030 <direct@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 (...) @sched()
%8 = call i32 (...) @direct()
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @sched()
%4 = tail call i32 (...) @direct()
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}