xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bss_clear();
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ interrupt_disable_all_IRQ();
int /*<<< orphan*/ pwm_init();
int /*<<< orphan*/ serial_begin(int);
int /*<<< orphan*/ synchronize_init();
int /*<<< orphan*/ syst_init();
int /*<<< orphan*/ timer_init(int);
void rpi_init(void) {
  bss_clear();
  interrupt_disable_all_IRQ();
  syst_init();
  gpio_init();
  serial_begin(115200);
  pwm_init();
  synchronize_init();
  timer_init(500000);
}


x86 assembly (clang, -O0):
<rpi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <bss_clear@plt>
mov    $0x0,%al
call   1050 <interrupt_disable_all_IRQ@plt>
mov    $0x0,%al
call   1030 <syst_init@plt>
mov    $0x0,%al
call   1090 <gpio_init@plt>
mov    $0x1c200,%edi
call   1070 <serial_begin@plt>
mov    $0x0,%al
call   1060 <pwm_init@plt>
mov    $0x0,%al
call   10a0 <synchronize_init@plt>
mov    $0x7a120,%edi
call   1040 <timer_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_init>:
push   %rax
xor    %eax,%eax
call   1080 <bss_clear@plt>
xor    %eax,%eax
call   1050 <interrupt_disable_all_IRQ@plt>
xor    %eax,%eax
call   1030 <syst_init@plt>
xor    %eax,%eax
call   1090 <gpio_init@plt>
mov    $0x1c200,%edi
call   1070 <serial_begin@plt>
xor    %eax,%eax
call   1060 <pwm_init@plt>
xor    %eax,%eax
call   10a0 <synchronize_init@plt>
mov    $0x7a120,%edi
pop    %rax
jmp    1040 <timer_init@plt>

LLVM IR (-O0):
define void @rpi_init() {
%1 = call i32 (...) @bss_clear()
%2 = call i32 (...) @interrupt_disable_all_IRQ()
%3 = call i32 (...) @syst_init()
%4 = call i32 (...) @gpio_init()
%5 = call i32 @serial_begin(i32 115200)
%6 = call i32 (...) @pwm_init()
%7 = call i32 (...) @synchronize_init()
%8 = call i32 @timer_init(i32 500000)
ret void
}

LLVM IR (-O2):
define void @rpi_init() {
%1 = tail call i32 (...) @bss_clear()
%2 = tail call i32 (...) @interrupt_disable_all_IRQ()
%3 = tail call i32 (...) @syst_init()
%4 = tail call i32 (...) @gpio_init()
%5 = tail call i32 @serial_begin(i32 115200)
%6 = tail call i32 (...) @pwm_init()
%7 = tail call i32 (...) @synchronize_init()
%8 = tail call i32 @timer_init(i32 500000)
ret void
}
void ambe_decode_fini(struct ambe_decoder *dec) {}


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

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

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

LLVM IR (-O2):
%struct.ambe_decoder = type opaque
define void @ambe_decode_fini(%struct.ambe_decoder* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ const_error();
int /*<<< orphan*/ error(char *);
scalar_t__ ferror(int /*<<< orphan*/);
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int do_getc(void) {
  int c = getc(stdin);
  if (c == EOF) {
    if (ferror(stdin))
      (error("error while reading standard input"), const_error());
  }
  return c;
}


x86 assembly (clang, -O0):
<do_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1060 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
jne    119b <do_getc+0x5b>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     1196 <do_getc+0x56>
lea    0xe76(%rip),%rdi
call   1050 <error@plt>
mov    $0x0,%al
call   1040 <const_error@plt>
jmp    119b <do_getc+0x5b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_getc>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
call   1060 <getc@plt>
mov    %eax,%ebx
mov    0x2e84(%rip),%rax
cmp    (%rax),%ebx
jne    1180 <do_getc+0x40>
mov    (%r14),%edi
call   1030 <ferror@plt>
test   %rax,%rax
je     1180 <do_getc+0x40>
lea    0xe8c(%rip),%rdi
call   1050 <error@plt>
xor    %eax,%eax
call   1040 <const_error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
@.str = [35 x i8] c"error while reading standard input\00"
define i32 @do_getc() {
%1 = alloca i32
%2 = load i32, i32* @stdin
%3 = call i32 @getc(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* @stdin
%9 = call i64 @ferror(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @const_error()
br label %14
14: ; preds = %11, %7
br label %15
15: ; preds = %14, %0
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@.str = [35 x i8] c"error while reading standard input\00"
define i32 @do_getc() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i32, i32* @stdin
%7 = tail call i64 @ferror(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = tail call i32 @error(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @const_error()
br label %12
12: ; preds = %5, %9, %0
ret i32 %2
}
/* Variables and functions */
int system(char *);
int run_srim(char *sr_module_path) {
  int result;
  result = system(sr_module_path);
  if (result == -1 || result == 127)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<run_srim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     113c <run_srim+0x2c>
cmpl   $0x7f,-0x14(%rbp)
jne    1148 <run_srim+0x38>
movl   $0x0,-0x4(%rbp)
jmp    114f <run_srim+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_srim>:
push   %rax
call   1030 <system@plt>
cmp    $0xffffffff,%eax
setne  %cl
cmp    $0x7f,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @run_srim(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = icmp ne i32 %2, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *test_hello(char *);
int main() {
  char *str = test_hello("#Code of C#");
  printf("%s\n", str);
  free(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <test_hello@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <test_hello@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"#Code of C#\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @test_hello(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"#Code of C#\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @test_hello(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int CPOpenFile(const char *fullFilePath, int readOrWrite, FILE **fileRefPtr) {
  *fileRefPtr = fopen(fullFilePath, readOrWrite ? "wb" : "rb");
  if (*fileRefPtr == NULL)
    return 10000;
  return 0;
}


x86 assembly (clang, -O0):
<CPOpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xed2(%rip),%rsi
lea    0xec8(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1168 <CPOpenFile+0x58>
movl   $0x2710,-0x4(%rbp)
jmp    116f <CPOpenFile+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPOpenFile>:
push   %rbx
mov    %rdx,%rbx
test   %esi,%esi
lea    0xee6(%rip),%rax
lea    0xedc(%rip),%rsi
cmove  %rax,%rsi
call   1030 <fopen@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x2710,%eax
cmovne %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @CPOpenFile(i8* nocapture %0, i32 %1, i32** nocapture writeonly %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32* @fopen(i8* %0, i8* %5)
store i32* %6, i32** %2
%7 = icmp eq i32* %6, null
%8 = select i1 %7, i32 10000, i32 0
ret i32 %8
}
unsigned scanline2x_generic_input_fmts(void) { return (1 << 1) | (1 << 0); }


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

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

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

LLVM IR (-O2):
define i32 @scanline2x_generic_input_fmts() {
ret i32 3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int _swap32(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
scalar_t__ fwrite(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void putppmpixel(uint32_t pixel) {
  pixel = _swap32(pixel << 8);
  if (fwrite(&pixel, 3, 1, stdout) < 0)
    error(1, errno, "writing pixels");
}


x86 assembly (clang, -O0):
<putppmpixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
call   1030 <_swap32@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%ecx
lea    -0x4(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x0,%rax
jge    1189 <putppmpixel+0x59>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    0xe7c(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putppmpixel>:
push   %rax
shl    $0x8,%edi
call   1030 <_swap32@plt>
mov    %eax,0x4(%rsp)
mov    0x2e94(%rip),%rax
mov    (%rax),%ecx
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
test   %rax,%rax
js     1161 <putppmpixel+0x31>
pop    %rax
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
lea    0xe8f(%rip),%rdx
mov    $0x1,%edi
call   1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"writing pixels\00"
define void @putppmpixel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = call i32 @_swap32(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* @stdout
%7 = call i64 @fwrite(i32* %2, i32 3, i32 1, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = call i32 @error(i32 1, i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@errno = global i32 0
@.str = [15 x i8] c"writing pixels\00"
define void @putppmpixel(i32 %0) {
%2 = alloca i32
%3 = shl i32 %0, 8
%4 = tail call i32 @_swap32(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* @stdout
%6 = call i64 @fwrite(i32* %2, i32 3, i32 1, i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @error(i32 1, i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
ret void
}
/* Variables and functions */
int powx(int, int);
int main() {
  int a = powx(2, 8);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <powx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @powx(i32 2, i32 8)
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @powx(i32 2, i32 8)
ret i32 0
}
char *driver_get_last_error() { return "UNIMPLEMENTED"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_last_error() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"UNIMPLEMENTED\00"
define i8* @driver_get_last_error() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void SplitUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SplitUVRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void move_single_disk(char start, char finish) {
  printf("%c---->%c\n", start, finish);
}


x86 assembly (clang, -O0):
<move_single_disk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_single_disk>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%c---->%c\0A\00"
define void @move_single_disk(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* %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c---->%c\0A\00"
define void @move_single_disk(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *alloc_mem(size_t num, size_t size) {
  if (num == 0 || size == 0) {
    return NULL;
  }
  void *value = calloc(num, size);
  memset(value, 0, size);
  return value;
}


x86 assembly (clang, -O0):
<alloc_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <alloc_mem+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <alloc_mem+0x33>
movq   $0x0,-0x8(%rbp)
jmp    117b <alloc_mem+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_mem>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
test   %rdi,%rdi
je     114b <alloc_mem+0x2b>
mov    %rsi,%r14
test   %rsi,%rsi
je     114b <alloc_mem+0x2b>
mov    %r14,%rsi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @alloc_mem(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = tail call i32 @memset(i8* %7, i32 0, i64 %1)
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %10
}
float DotProduct(float *x, float *y) {
  return (x[0] * y[0] + x[1] * y[1] + x[2] * y[2]);
}


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

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

LLVM IR (-O0):
define float @DotProduct(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @DotProduct(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
__attribute__((always_)) void clear_bit(int nr, volatile unsigned long *addr) {
  __asm__ __volatile__("lock ; "
                       "btrl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btr %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
lock btr %edi,(%rsi)
ret

LLVM IR (-O0):
define void @clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "lock ; btrl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ STDIN_FILENO;
int lseek(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1)
    printf("cannot seek\n");
  else
    printf("seek OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
jne    1162 <main+0x42>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
cmp    $0xffffffff,%eax
lea    0xec4(%rip),%rax
lea    0xeb5(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@SEEK_CUR = global i32 0
@str = [8 x i8] c"seek OK\00"
@str.2 = [12 x i8] c"cannot seek\00"
define i32 @main() {
%1 = load i32, i32* @STDIN_FILENO
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @lseek(i32 %1, i32 0, i32 %2)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
scalar_t__ readboard();
int show_visitors(int);
int show_winners();
void showallscores(void) {
  int i, j;
  if (readboard() < 0) {
    return;
  }
  i = show_winners();
  j = show_visitors(1);
  if ((i + j) == 0) {
    Print("The scoreboard is empty.");
  } else {
    Print("");
  }
}


x86 assembly (clang, -O0):
<showallscores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <readboard@plt>
cmp    $0x0,%rax
jge    115e <showallscores+0x1e>
jmp    11a1 <showallscores+0x61>
mov    $0x0,%al
call   1050 <show_winners@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <show_visitors@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1195 <showallscores+0x55>
lea    0xe75(%rip),%rdi
call   1040 <Print@plt>
jmp    11a1 <showallscores+0x61>
lea    0xe7c(%rip),%rdi
call   1040 <Print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showallscores>:
push   %rbx
xor    %eax,%eax
call   1030 <readboard@plt>
test   %rax,%rax
js     117a <showallscores+0x3a>
xor    %eax,%eax
call   1050 <show_winners@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1060 <show_visitors@plt>
add    %ebx,%eax
lea    0xe97(%rip),%rax
lea    0xea8(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1040 <Print@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The scoreboard is empty.\00"
@.str.1 = [1 x i8] zeroinitializer
define void @showallscores() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @readboard()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %17
6: ; preds = %0
%7 = call i32 (...) @show_winners()
store i32 %7, i32* %1
%8 = call i32 @show_visitors(i32 1)
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %6
%14 = call i32 @Print(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %6
%16 = call i32 @Print(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %5, %15, %13
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"The scoreboard is empty.\00"
@.str.1 = [1 x i8] zeroinitializer
define void @showallscores() {
%1 = tail call i64 (...) @readboard()
%2 = icmp slt i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @show_winners()
%5 = tail call i32 @show_visitors(i32 1)
%6 = sub i32 0, %5
%7 = icmp eq i32 %4, %6
%8 = select i1 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @Print(i8* %8)
br label %10
10: ; preds = %3, %0
ret void
}
/* Variables and functions */
int M_PI;
float normalize_euler_0_2pi(float a) {
  while (a < 0)
    a += (float)(2 * M_PI);
  return a;
}


x86 assembly (clang, -O0):
<normalize_euler_0_2pi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1135 <normalize_euler_0_2pi+0x35>
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1109 <normalize_euler_0_2pi+0x9>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_euler_0_2pi>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <normalize_euler_0_2pi+0x29>
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm2
nopw   0x0(%rax,%rax,1)
addss  %xmm2,%xmm0
ucomiss %xmm0,%xmm1
ja     1120 <normalize_euler_0_2pi+0x20>
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @normalize_euler_0_2pi(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %6, %1
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* @M_PI
%8 = mul nsw i32 2, %7
%9 = sitofp i32 %8 to float
%10 = load float, float* %2
%11 = fadd float %10, %9
store float %11, float* %2
br label %3
12: ; preds = %3
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @normalize_euler_0_2pi(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = load i32, i32* @M_PI
%5 = shl nsw i32 %4, 1
%6 = sitofp i32 %5 to float
br label %7
7: ; preds = %3, %7
%8 = phi float [ %0, %3 ], [ %9, %7 ]
%9 = fadd float %8, %6
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %7, label %11
11: ; preds = %7, %1
%12 = phi float [ %0, %1 ], [ %9, %7 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uxmi_upgrade() { printf("\nUpgrade\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"\0AUpgrade\0A\00"
define void @uxmi_upgrade() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"\0AUpgrade\00"
define void @uxmi_upgrade() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void alsa_mmap_UnLockAudioBuffer(void) {}


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

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

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

LLVM IR (-O2):
define void @alsa_mmap_UnLockAudioBuffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int is_digit(char *str) {
  while (*str) {
    if (!isdigit(*str++))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <is_digit+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <is_digit+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_digit+0x51>
jmp    111c <is_digit+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1116 <is_digit+0x16>
add    $0x1,%rdi
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1100 <is_digit>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_digit(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %2, label %11
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
void glShaderSource(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glShaderSource() {
ret void
}
unsigned xrop3_55_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_55_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_55_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
shl    $0x8,%esi
lea    0xff(%rsi),%eax
and    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_55_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_55_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %8, -1
ret i32 %9
}
int Izquierda(int x) {
  if (x > 0) {
    return (x - 1);
  } else {
    return (5 - 1);
  }
}


x86 assembly (clang, -O0):
<Izquierda>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111f <Izquierda+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <Izquierda+0x26>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Izquierda>:
lea    -0x1(%rdi),%ecx
test   %edi,%edi
mov    $0x4,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Izquierda(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = select i1 %2, i32 %3, i32 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ XGclose();
int /*<<< orphan*/ XGputstring(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ freelinks();
void quit() {
  int i;
  XGputstring("^D\n");
  XGclose();
  freelinks();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <XGputstring@plt>
mov    $0x0,%al
call   1030 <XGclose@plt>
mov    $0x0,%al
call   1040 <freelinks@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <XGputstring@plt>
xor    %eax,%eax
call   1030 <XGclose@plt>
xor    %eax,%eax
call   1040 <freelinks@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"^D\0A\00"
define void @quit() {
%1 = alloca i32
%2 = call i32 @XGputstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @XGclose()
%4 = call i32 (...) @freelinks()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"^D\0A\00"
define void @quit() {
%1 = tail call i32 @XGputstring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @XGclose()
%3 = tail call i32 (...) @freelinks()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void defaultTorchErrorHandlerFunction(const char *msg) {
  printf("$ Error: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<defaultTorchErrorHandlerFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<defaultTorchErrorHandlerFunction>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"$ Error: %s\0A\00"
define void @defaultTorchErrorHandlerFunction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"$ Error: %s\0A\00"
define void @defaultTorchErrorHandlerFunction(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFContextRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFContextRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFContextRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x84() {
  Assert_real((isxdigit(132) == 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_isxdigit.c",
              665, ("isxdigit should be 0 for 0x84"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x84>:
push   %rax
mov    $0x84,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x299,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x84\00"
define void @t_isxdigit_0x84() {
%1 = call i64 @isxdigit(i32 132)
%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 665, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x84\00"
define void @t_isxdigit_0x84() {
%1 = tail call i64 @isxdigit(i32 132)
%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 665, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test_snprintf() {}


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

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

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

LLVM IR (-O2):
define void @test_snprintf() {
ret void
}
int twist_b_on_sliceedge(sliceedge)
int sliceedge;
{
  int temp_arr[12];
  sliceedge_unpack(sliceedge, temp_arr);
  four_cycle(temp_arr, 10, 6, 11, 2);
  return sliceedge_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_b_on_sliceedge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <sliceedge_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
mov    $0x2,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <sliceedge_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_b_on_sliceedge>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <sliceedge_unpack@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sliceedge_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_b_on_sliceedge(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 10, i32 6, i32 11, i32 2)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_b_on_sliceedge(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 10, i32 6, i32 11, i32 2)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
int unzip_main(argc, argv)
int argc;
char **argv;
{
  int r;
  globalsCtor();
  r = unzip(argc, argv);
  ;
  return (r);
}


x86 assembly (clang, -O0):
<unzip_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <globalsCtor@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <unzip@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unzip_main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <globalsCtor@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unzip@plt>

LLVM IR (-O0):
define i32 @unzip_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @globalsCtor()
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @unzip to i32 (i32, i8**, ...)*)(i32 %7, i8** %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @unzip_main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @globalsCtor()
%4 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @unzip to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 %4
}
/* Variables and functions */
int vars_init();
int module_vars_init(void) { return vars_init(); }


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

x86 assembly (clang, -O2):
<module_vars_init>:
xor    %eax,%eax
jmp    1030 <vars_init@plt>

LLVM IR (-O0):
define i32 @module_vars_init() {
%1 = call i32 (...) @vars_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_vars_init() {
%1 = tail call i32 (...) @vars_init()
ret i32 %1
}
int xClampI(int val, int min, int max) {
  if (val < min)
    return min;
  else if (val > max)
    return max;
  else
    return val;
}


x86 assembly (clang, -O0):
<xClampI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <xClampI+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <xClampI+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <xClampI+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <xClampI+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xClampI(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}