xunge/DecIR huggingface dataset:
unsigned char get_value(unsigned long value, unsigned long min,
                        unsigned long max) {
  unsigned long v = ((value - min) * 255) / (max - min);
  if (v > 255)
    v = 255;
  if (v < 0)
    v = 0;
  return (unsigned char)v;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
imul   $0xff,%rax,%rax
mov    -0x18(%rbp),%rcx
sub    -0x10(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x20(%rbp)
cmpq   $0xff,-0x20(%rbp)
jbe    1146 <get_value+0x46>
movq   $0xff,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1159 <get_value+0x59>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
mov    %rdx,%rcx
sub    %rsi,%rdi
mov    %rdi,%rax
shl    $0x8,%rax
sub    %rdi,%rax
sub    %rsi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1126 <get_value+0x26>
xor    %edx,%edx
div    %rcx
jmp    112a <get_value+0x2a>
xor    %edx,%edx
div    %ecx
cmp    $0xff,%rax
mov    $0xff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @get_value(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = sub i64 %8, %9
%11 = mul i64 %10, 255
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = sub i64 %12, %13
%15 = udiv i64 %11, %14
store i64 %15, i64* %7
%16 = load i64, i64* %7
%17 = icmp ugt i64 %16, 255
br i1 %17, label %18, label %19
18: ; preds = %3
store i64 255, i64* %7
br label %19
19: ; preds = %18, %3
%20 = load i64, i64* %7
%21 = icmp ult i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i64 0, i64* %7
br label %23
23: ; preds = %22, %19
%24 = load i64, i64* %7
%25 = trunc i64 %24 to i8
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @get_value(i64 %0, i64 %1, i64 %2) {
%4 = sub i64 %0, %1
%5 = mul i64 %4, 255
%6 = sub i64 %2, %1
%7 = udiv i64 %5, %6
%8 = icmp ult i64 %7, 255
%9 = select i1 %8, i64 %7, i64 255
%10 = trunc i64 %9 to i8
ret i8 %10
}
void gtk_text_buffer_get_end_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_end_iter() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rotate_fix_word(char *, int);
int strlen(char *);
int main() {
  char str[] = "I am a student.";
  int len = strlen(str);
  printf("len = %d\n", len);
  puts(str);
  rotate_fix_word(str, len);
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1060 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <rotate_fix_word@plt>
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <rotate_fix_word@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str = [16 x i8] c"I am a student.\00"
@.str = [10 x i8] c"len = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @rotate_fix_word(i8* %11, i32 %12)
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [16 x i8] c"I am a student.\00"
@.str = [10 x i8] c"len = %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @puts(i8* %2)
%6 = call i32 @rotate_fix_word(i8* %2, i32 %3)
%7 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_8x4(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                          int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 4,
                       i_weight1);
}


x86 assembly (clang, -O0):
<pixel_avg_weight_8x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x8,%r8d
mov    $0x4,%r9d
mov    %eax,(%rsp)
call   1030 <pixel_avg_weight_wxh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_weight_8x4>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x8,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @pixel_avg_weight_8x4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 8, i32 4, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int close(int);
void Close(int fd) {
  int retval;
  retval = close(fd);
  if (retval == -1)
    Sys_failure("close");
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114c <Close+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <Close+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZBUFFv06_getErrorName(size_t errorCode) {
  return ERR_getErrorName(errorCode);
}


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

x86 assembly (clang, -O2):
<ZBUFFv06_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

LLVM IR (-O0):
define i8* @ZBUFFv06_getErrorName(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @ERR_getErrorName(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @ZBUFFv06_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Variables and functions */
char *str_nreplace(char *, char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *replace(char *str, const char *delim, const char *with) {
  return str_nreplace(str, delim, with, strlen(str));
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <str_nreplace@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <str_nreplace@plt>

LLVM IR (-O0):
define i8* @replace(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call i8* @str_nreplace(i8* %7, i8* %8, i8* %9, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @replace(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @str_nreplace(i8* %0, i8* %1, i8* %2, i32 %4)
ret i8* %5
}
void grid_xpush_in(__attribute__((unused)) struct grid_sockbase *self,
                   __attribute__((unused)) struct grid_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.grid_sockbase = type opaque
%struct.grid_pipe = type opaque
define void @grid_xpush_in(%struct.grid_sockbase* %0, %struct.grid_pipe* %1) {
%3 = alloca %struct.grid_sockbase*
%4 = alloca %struct.grid_pipe*
store %struct.grid_sockbase* %0, %struct.grid_sockbase** %3
store %struct.grid_pipe* %1, %struct.grid_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.grid_sockbase = type opaque
%struct.grid_pipe = type opaque
define void @grid_xpush_in(%struct.grid_sockbase* nocapture %0, %struct.grid_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int t6() { return 3; }


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

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

LLVM IR (-O0):
define i32 @t6() {
ret i32 3
}

LLVM IR (-O2):
define i32 @t6() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_source_info_list() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_source_info_list"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_context_get_source_info_list\0A\00"
define i32 @pa_context_get_source_info_list() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_context_get_source_info_list\00"
define i32 @pa_context_get_source_info_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x80() {
  Assert_real((isalnum(128) == 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_isalnum.c",
              645, ("isalnum should be 0 for 0x80"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x80\00"
define void @t_isalnum_0x80() {
%1 = tail call i64 @isalnum(i32 128)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int g_fini(struct game *g) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.game = type opaque
define i32 @g_fini(%struct.game* nocapture readnone %0) {
ret i32 0
}
int mpc_eoi_anchor(char prev, char next) { return (next == '\0'); }


x86 assembly (clang, -O0):
<mpc_eoi_anchor>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_eoi_anchor>:
xor    %eax,%eax
test   %sil,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @mpc_eoi_anchor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @mpc_eoi_anchor(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned char SPI_MODE_1;
unsigned char spi_mode_1() { return SPI_MODE_1; }


x86 assembly (clang, -O0):
<spi_mode_1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_mode_1>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
@SPI_MODE_1 = global i8 0
define zeroext i8 @spi_mode_1() {
%1 = load i8, i8* @SPI_MODE_1
ret i8 %1
}

LLVM IR (-O2):
@SPI_MODE_1 = global i8 0
define zeroext i8 @spi_mode_1() {
%1 = load i8, i8* @SPI_MODE_1
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ rename(char *, char *);
void replace_index(char *tmp_file_name, char *index_file_name) {
  rename(tmp_file_name, index_file_name);
}


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

x86 assembly (clang, -O2):
<replace_index>:
jmp    1030 <rename@plt>

LLVM IR (-O0):
define void @replace_index(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @rename(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @replace_index(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret void
}
long leap_years_between(long year) {
  if (year > 0)
    return (year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400;
  else
    return 0;
}


x86 assembly (clang, -O0):
<leap_years_between>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    116e <leap_years_between+0x6e>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <leap_years_between+0x76>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_years_between>:
test   %rdi,%rdi
jle    1142 <leap_years_between+0x42>
add    $0xffffffffffffffff,%rdi
mov    %rdi,%rcx
shr    $0x2,%rcx
movabs $0x28f5c28f5c28f5c3,%rdx
c2 f5 28
mov    %rcx,%rax
mul    %rdx
shr    $0x2,%rdx
sub    %rdx,%rcx
shr    $0x4,%rdi
movabs $0xa3d70a3d70a3d71,%rdx
70 3d 0a
mov    %rdi,%rax
mul    %rdx
mov    %rdx,%rax
add    %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @leap_years_between(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = add nsw i64 %0, -1
%5 = lshr i64 %4, 2
%6 = udiv i64 %4, 100
%7 = sub nsw i64 %5, %6
%8 = udiv i64 %4, 400
%9 = add nsw i64 %7, %8
br label %10
10: ; preds = %1, %3
%11 = phi i64 [ %9, %3 ], [ 0, %1 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Base_copy(void *this, void *other) {
  printf("Base"
         "::copy()\n");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Base::copy()\0A\00"
define void @Base_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Base::copy()\00"
define void @Base_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_send_close_from_client() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_call_send_close_from_client>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_close_from_client() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_close_from_client() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int myfunction3(int);
int myfunction2(int arg) { return myfunction3(arg); }


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

x86 assembly (clang, -O2):
<myfunction2>:
jmp    1030 <myfunction3@plt>

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

LLVM IR (-O2):
define i32 @myfunction2(i32 %0) {
%2 = tail call i32 @myfunction3(i32 %0)
ret i32 %2
}
int main() {
  int a = 10;
  int b = 0;
  do {
    a = 1;
    do {
      a = 2;
    } while (b < 30);
  } while (b < 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jl     1120 <main+0x20>
jmp    1136 <main+0x36>
cmpl   $0x14,-0xc(%rbp)
jl     1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void strc(char a[], char b[]) {
  for (; *a++ = *b++;)
    ;
}


x86 assembly (clang, -O0):
<strc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strc+0x3b>
jmp    110c <strc+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strc>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strc+0x10>
ret

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

LLVM IR (-O2):
define void @strc(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int strlen(char const *);
char *strrchr(char const *, char);
const char *arg_extension(const char *filename) {
  const char *result = (filename ? strrchr(filename, '.') : NULL);
  if (filename && !result)
    result = filename + strlen(filename);
  return result;
}


x86 assembly (clang, -O0):
<arg_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <arg_extension+0x2e>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1159 <arg_extension+0x39>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1159 <arg_extension+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1198 <arg_extension+0x78>
cmpq   $0x0,-0x10(%rbp)
jne    1198 <arg_extension+0x78>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_extension>:
push   %rbx
test   %rdi,%rdi
je     113a <arg_extension+0x1a>
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     113e <arg_extension+0x1e>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @arg_extension(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
br label %10
10: ; preds = %1, %6, %3
%11 = phi i8* [ %4, %3 ], [ %9, %6 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a % b == 0) {
    printf("yes\n");
  } else {
    printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
test   %edx,%edx
lea    0xec3(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t get8(void *p) { return *(uint8_t *)p; }


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

x86 assembly (clang, -O2):
<get8>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  printf("#define DATA_IN0 {");
  for (i = 0; i < 64 - 1; i++) {
    printf("%d,\\\n", i);
  }
  printf("%d }", 64 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3f,-0x8(%rbp)
jge    115d <main+0x4d>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xeb5(%rip),%rdi
mov    $0x3f,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x3f,%ebp
jne    1130 <main+0x20>
lea    0xece(%rip),%rdi
mov    $0x3f,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"#define DATA_IN0 {\00"
@.str.1 = [6 x i8] c"%d,\\\0A\00"
@.str.2 = [5 x i8] c"%d }\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 63
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 63)
ret i32 0
}
int log2i(int n) {
  int l = 0;
  while (n >>= 1)
    l++;
  return l;
}


x86 assembly (clang, -O0):
<log2i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <log2i+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log2i+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2i>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <log2i+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log2i+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2i(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
long double fac(int n) {
  long double static f;
  if (n == 1)
    f = 1;
  else
    f = n * fac(n - 1);
  return f;
}


x86 assembly (clang, -O0):
<fac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1132 <fac+0x22>
fld1
fstpt  0x2f13(%rip)
jmp    1151 <fac+0x41>
mov    -0x4(%rbp),%edi
mov    %edi,-0x8(%rbp)
fildl  -0x8(%rbp)
fstpt  -0x14(%rbp)
add    $0xffffffff,%edi
call   1030 <fac@plt>
fldt   -0x14(%rbp)
fmulp  %st,%st(1)
fstpt  0x2eef(%rip)
fldt   0x2ee9(%rip)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fac>:
fld1
cmp    $0x1,%edi
je     112e <fac+0x1e>
push   %rax
fstp   %st(0)
mov    %edi,0x4(%rsp)
add    $0xffffffff,%edi
call   1030 <fac@plt>
fimull 0x4(%rsp)
add    $0x8,%rsp
ret

LLVM IR (-O0):
@fac.f = internal global x86_fp80 0xK00000000000000000000
define x86_fp80 @fac(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* @fac.f
br label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to x86_fp80
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call x86_fp80 @fac(i32 %10)
%12 = fmul x86_fp80 %8, %11
store x86_fp80 %12, x86_fp80* @fac.f
br label %13
13: ; preds = %6, %5
%14 = load x86_fp80, x86_fp80* @fac.f
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @fac(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to x86_fp80
%5 = add nsw i32 %0, -1
%6 = tail call x86_fp80 @fac(i32 %5)
%7 = fmul x86_fp80 %6, %4
br label %8
8: ; preds = %1, %3
%9 = phi x86_fp80 [ %7, %3 ], [ 0xK3FFF8000000000000000, %1 ]
ret x86_fp80 %9
}
int equal_pointer(void *k1, void *k2) { return k1 == k2; }


x86 assembly (clang, -O0):
<equal_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_pointer>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equal_pointer(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f1(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int h = 5;
  f1(&h);
  printf("Q15:\n%d\n\n", h);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <f1@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Q15:\0A%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @f1(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int mDB_update(fn, idx, key, blank, data, dst) {
  return mDBi_msg('u', fn, idx, 0, key, blank, data, dst);
}


x86 assembly (clang, -O0):
<mDB_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    -0x18(%rbp),%eax
mov    $0x75,%edi
xor    %ecx,%ecx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_update>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r11d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%edx
mov    %edi,%esi
mov    $0x75,%edi
xor    %ecx,%ecx
xor    %eax,%eax
push   %r10
push   %r11
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_update(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 117, i32 %13, i32 %14, i32 0, i32 %15, i32 %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @mDB_update(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 117, i32 %0, i32 %1, i32 0, i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strrchr(char *, char);
int is_html_packet(char *file_name) {
  char *start = strrchr(file_name, '.');
  if (start != NULL) {
    if (strcmp("html", start + 1) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_html_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <is_html_packet+0x58>
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
lea    0xea8(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1173 <is_html_packet+0x53>
movl   $0x1,-0x4(%rbp)
jmp    117f <is_html_packet+0x5f>
jmp    1178 <is_html_packet+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_html_packet>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1148 <is_html_packet+0x28>
add    $0x1,%rax
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114c <is_html_packet+0x2c>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"html\00"
define i32 @is_html_packet(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
char *strrchr(p, ch)
char *p, ch;
{ return (rindex(p, ch)); }


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <rindex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
jmp    1030 <rindex@plt>

LLVM IR (-O0):
define i8* @strrchr(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = call i8* @rindex(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i8* @rindex(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x03() {
  Assert_real((isbdigit(3) == 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_isbdigit.c",
              20, ("isbdigit should be 0 for 0x03"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x03>:
push   %rax
mov    $0x3,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x14,%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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x03\00"
define void @t_isbdigit_0x03() {
%1 = call i64 @isbdigit(i32 3)
%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 20, 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x03\00"
define void @t_isbdigit_0x03() {
%1 = tail call i64 @isbdigit(i32 3)
%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 20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
int _buffer_read_array(struct ac_buffer *, double *, int *, int);
int buffer_read_double_array(struct ac_buffer *buffer, double *value,
                             int *size) {
  return _buffer_read_array(buffer, value, size, sizeof(double));
}


x86 assembly (clang, -O0):
<buffer_read_double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <_buffer_read_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_read_double_array>:
mov    $0x8,%ecx
jmp    1030 <_buffer_read_array@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_double_array(%struct.ac_buffer* %0, double* %1, i32* %2) {
%4 = alloca %struct.ac_buffer*
%5 = alloca double*
%6 = alloca i32*
store %struct.ac_buffer* %0, %struct.ac_buffer** %4
store double* %1, double** %5
store i32* %2, i32** %6
%7 = load %struct.ac_buffer*, %struct.ac_buffer** %4
%8 = load double*, double** %5
%9 = load i32*, i32** %6
%10 = call i32 @_buffer_read_array(%struct.ac_buffer* %7, double* %8, i32* %9, i32 8)
ret i32 %10
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define i32 @buffer_read_double_array(%struct.ac_buffer* %0, double* %1, i32* %2) {
%4 = tail call i32 @_buffer_read_array(%struct.ac_buffer* %0, double* %1, i32* %2, i32 8)
ret i32 %4
}