xunge/DecIR huggingface dataset:
/* Variables and functions */
int posix_memalign(void **, size_t, size_t);
void *ov_malloc(size_t size) {
  void *memptr;
  int ierr = posix_memalign(&memptr, (size_t)(4 * 4), size + (4 * 4));
  if (ierr)
    return NULL;
  else
    return memptr;
}


x86 assembly (clang, -O0):
<ov_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
add    $0x10,%rdx
lea    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   1030 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114c <ov_malloc+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1154 <ov_malloc+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ov_malloc>:
push   %rax
lea    0x10(%rdi),%rdx
mov    %rsp,%rdi
mov    $0x10,%esi
call   1030 <posix_memalign@plt>
test   %eax,%eax
jne    112c <ov_malloc+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @ov_malloc(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = add i64 %0, 16
%5 = call i32 @posix_memalign(i8** %2, i64 16, i64 %4)
%6 = icmp eq i32 %5, 0
%7 = load i8*, i8** %2
%8 = select i1 %6, i8* %7, i8* null
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch)) void hp2(void) { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetTitle51(char const *);
void settitle(const char *s) { SetTitle51(s); }


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

x86 assembly (clang, -O2):
<settitle>:
jmp    1030 <SetTitle51@plt>

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

LLVM IR (-O2):
define void @settitle(i8* %0) {
%2 = tail call i32 @SetTitle51(i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_estimated_distance(double *eta) {
  int fail;
  int precision = 0;
  int *b;
  fail = _ada_use_c2phc4c(887, &precision, b, eta, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_estimated_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x377,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_estimated_distance>:
push   %rax
mov    %rdi,%rcx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x377,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_standard_estimated_distance(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 0, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 887, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_standard_estimated_distance(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 887, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
int main() {
  int myvar = 10, k, p;
  switch (myvar) {
  case 10:
    k = 10;
    p = k + 1;
    return 10;
  case 20:
  case 30:
    return 20;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0xa,%eax
je     1148 <main+0x48>
jmp    1126 <main+0x26>
mov    -0x14(%rbp),%eax
sub    $0x14,%eax
je     1164 <main+0x64>
jmp    1137 <main+0x37>
mov    -0x14(%rbp),%eax
sub    $0x1e,%eax
je     1164 <main+0x64>
jmp    1170 <main+0x70>
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0xa,-0x4(%rbp)
jmp    1175 <main+0x75>
movl   $0x14,-0x4(%rbp)
jmp    1175 <main+0x75>
jmp    1175 <main+0x75>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
void XkbVirtualModsToReal() {}


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

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

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

LLVM IR (-O2):
define void @XkbVirtualModsToReal() {
ret void
}
void *pgm_read_ptr(const void *x) { return *((void **)x); }


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

x86 assembly (clang, -O2):
<pgm_read_ptr>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @pgm_read_ptr(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
ret i8* %3
}
/* Variables and functions */
int checktopology(int, double *, int, int *, int, int *, int);
int check_mesh_topology_(int *pnV, double *vertex, int *pnF, int *face,
                         int *pnT, int *tetra) {
  return checktopology(*pnV, vertex, *pnF, face, *pnT, tetra, 1);
}


x86 assembly (clang, -O0):
<check_mesh_topology_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <checktopology@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mesh_topology_>:
push   %rax
mov    (%rdi),%edi
mov    (%rdx),%edx
mov    (%r8),%r8d
movl   $0x1,(%rsp)
call   1030 <checktopology@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_mesh_topology_(i32* %0, double* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store double* %1, double** %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* %13
%15 = load double*, double** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32, i32* %19
%21 = load i32*, i32** %12
%22 = call i32 @checktopology(i32 %14, double* %15, i32 %17, i32* %18, i32 %20, i32* %21, i32 1)
ret i32 %22
}

LLVM IR (-O2):
define i32 @check_mesh_topology_(i32* nocapture %0, double* %1, i32* nocapture %2, i32* %3, i32* nocapture %4, i32* %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = tail call i32 @checktopology(i32 %7, double* %1, i32 %8, i32* %3, i32 %9, i32* %5, i32 1)
ret i32 %10
}
int test2(char x) { return x / 100 != 3; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test2(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp ne i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test2(i8 signext %0) {
ret i32 1
}
void cb_paste(struct Screen *scrn) {}


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

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

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

LLVM IR (-O2):
%struct.Screen = type opaque
define void @cb_paste(%struct.Screen* nocapture %0) {
ret void
}
void deinitialise() {}


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

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

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

LLVM IR (-O2):
define void @deinitialise() {
ret void
}
long bsf(unsigned long val) {
  long ret = -1;
  if (val != 0)
    asm("bsfq %1, %0" : "=r"(ret) : "r"(val));
  return ret;
}


x86 assembly (clang, -O0):
<bsf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0x0,-0x8(%rbp)
je     1127 <bsf+0x27>
mov    -0x8(%rbp),%rax
bsf    %rax,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsf>:
test   %rdi,%rdi
je     110a <bsf+0xa>
bsf    %rdi,%rax
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @bsf(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 -1, i64* %3
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 asm "bsfq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %7)
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @bsf(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 asm "bsfq $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ -1, %1 ]
ret i64 %6
}
int CIN_API(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @CIN_API() {
ret i32 1
}

LLVM IR (-O2):
define i32 @CIN_API() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ strcmp(char *, char *);
void strcmp_equal() {
  Assert_real((strcmp("equal", "equal") == 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/string/strcmp.c",
              12, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<strcmp_equal>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xc,%edx
lea    0xf57(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_equal>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec6(%rip),%rsi
lea    0xf62(%rip),%rcx
mov    $0xc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"equal\00"
@.str.1 = [163 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/string/strcmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @strcmp_equal() {
%1 = call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"equal\00"
@.str.1 = [163 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/string/strcmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @strcmp_equal() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void ft_putnstr_fd(int fd, char *str, size_t n) {
  int strlen;
  strlen = ft_strlen(str);
  if (strlen > n)
    write(fd, str, n);
  else
    write(fd, str, strlen);
}


x86 assembly (clang, -O0):
<ft_putnstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1164 <ft_putnstr_fd+0x44>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
jmp    1173 <ft_putnstr_fd+0x53>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnstr_fd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <ft_strlen@plt>
movslq %eax,%rdx
cmp    %rbx,%rdx
cmova  %ebx,%edx
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putnstr_fd(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @ft_strlen(i8* %1)
%5 = sext i32 %4 to i64
%6 = icmp ugt i64 %5, %2
%7 = trunc i64 %2 to i32
%8 = select i1 %6, i32 %7, i32 %4
%9 = tail call i32 @write(i32 %0, i8* %1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200] = {0};
  scanf("%s", word);
  printf("%li\n", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
lea    0xe6b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe54(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = bitcast [200 x i8]* %2 to i8*
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%li\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_can_send(void *bus,
                                                           char type) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_can_send>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
xor    %eax,%eax
mov    0x2ec9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_can_send>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_can_send(i8* nocapture readnone %0, i8 signext %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int tuncompressible_file() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tuncompressible_file() {
ret i32 0
}
double getCylinderVolumn(double r, double h) {
  double area = 3.1416 * r * r;
  double volume = area * h;
  return volume;
}


x86 assembly (clang, -O0):
<getCylinderVolumn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCylinderVolumn>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getCylinderVolumn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = fmul double 3.141600e+00, %7
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %4
%13 = fmul double %11, %12
store double %13, double* %6
%14 = load double, double* %6
ret double %14
}

LLVM IR (-O2):
define double @getCylinderVolumn(double %0, double %1) {
%3 = fmul double %0, 3.141600e+00
%4 = fmul double %3, %0
%5 = fmul double %4, %1
ret double %5
}
/* Type definitions */
struct ext4_sblock {
  int dummy;
};
struct ext4_blockdev {
  int dummy;
};

/* Variables and functions */
int ext4_block_writebytes(struct ext4_blockdev *, int, struct ext4_sblock *,
                          int);
int ext4_sb_write(struct ext4_blockdev *bdev, struct ext4_sblock *s) {
  return ext4_block_writebytes(bdev, 1024, s, 1024);
}


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

x86 assembly (clang, -O2):
<ext4_sb_write>:
mov    %rsi,%rdx
mov    $0x400,%esi
mov    $0x400,%ecx
jmp    1030 <ext4_block_writebytes@plt>

LLVM IR (-O0):
%struct.ext4_blockdev = type { i32 }
%struct.ext4_sblock = type { i32 }
define i32 @ext4_sb_write(%struct.ext4_blockdev* %0, %struct.ext4_sblock* %1) {
%3 = alloca %struct.ext4_blockdev*
%4 = alloca %struct.ext4_sblock*
store %struct.ext4_blockdev* %0, %struct.ext4_blockdev** %3
store %struct.ext4_sblock* %1, %struct.ext4_sblock** %4
%5 = load %struct.ext4_blockdev*, %struct.ext4_blockdev** %3
%6 = load %struct.ext4_sblock*, %struct.ext4_sblock** %4
%7 = call i32 @ext4_block_writebytes(%struct.ext4_blockdev* %5, i32 1024, %struct.ext4_sblock* %6, i32 1024)
ret i32 %7
}

LLVM IR (-O2):
%struct.ext4_blockdev = type { i32 }
%struct.ext4_sblock = type { i32 }
define i32 @ext4_sb_write(%struct.ext4_blockdev* %0, %struct.ext4_sblock* %1) {
%3 = tail call i32 @ext4_block_writebytes(%struct.ext4_blockdev* %0, i32 1024, %struct.ext4_sblock* %1, i32 1024)
ret i32 %3
}
/* Variables and functions */
size_t gray_sz(unsigned width, unsigned height) { return width * height; }


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

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

LLVM IR (-O0):
define i64 @gray_sz(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul i32 %5, %6
%8 = zext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @gray_sz(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ FS_LoadedPakNames();
int /*<<< orphan*/ Sys_Gettext(char *);
void CL_OpenedPK3List_f(void) {
  Com_Printf(Sys_Gettext("Opened PK3 Names: %s\n"), FS_LoadedPakNames());
}


x86 assembly (clang, -O0):
<CL_OpenedPK3List_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <Sys_Gettext@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <FS_LoadedPakNames@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_OpenedPK3List_f>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <Sys_Gettext@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <FS_LoadedPakNames@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Opened PK3 Names: %s\0A\00"
define void @CL_OpenedPK3List_f() {
%1 = call i32 @Sys_Gettext(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @FS_LoadedPakNames()
%3 = call i32 @Com_Printf(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Opened PK3 Names: %s\0A\00"
define void @CL_OpenedPK3List_f() {
%1 = tail call i32 @Sys_Gettext(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @FS_LoadedPakNames()
%3 = tail call i32 @Com_Printf(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int sci_get_chip_id();
int soc_id_is_sc8730g2v0(void) {
  return ((sci_get_chip_id() & (0xFFFFF000)) == ((0x8730C000) & (0xFFFFF000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc8730g2v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
cmp    $0x8730c000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc8730g2v0>:
push   %rax
xor    %eax,%eax
call   1030 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
xor    %ecx,%ecx
cmp    $0x8730c000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_id_is_sc8730g2v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -4096
%3 = icmp eq i32 %2, -2026848256
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @soc_id_is_sc8730g2v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -4096
%3 = icmp eq i32 %2, -2026848256
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_MVKL(int r, int fc) { C67_asm("MVKL.", fc, r, 0); }


x86 assembly (clang, -O0):
<C67_MVKL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_MVKL>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"MVKL.\00"
define void @C67_MVKL(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"MVKL.\00"
define void @C67_MVKL(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 0)
ret void
}
const char *strempty(const char *s) { return s ?: ""; }


x86 assembly (clang, -O0):
<strempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1127 <strempty+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <strempty+0x37>
lea    0xed2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <strempty+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strempty>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i8* [ %3, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %6 ]
ret i8* %8
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strempty(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int pthread_join(int /*<<< orphan*/, void **);
void d_join(pthread_t thread, void **retval) {
  int rv = pthread_join(thread, retval);
  if (rv != 0) {
    printf("error: pthread_join == %d\n", rv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<d_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1171 <d_join+0x41>
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_join>:
push   %rax
call   1050 <pthread_join@plt>
test   %eax,%eax
jne    113c <d_join+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"error: pthread_join == %d\0A\00"
define void @d_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
int /*<<< orphan*/ logError(char *);
void *malloc(size_t);
extern void *allocMemory(size_t count, size_t size) {
  void *ptr;
  size_t cap;
  cap = count * size;
  ptr = malloc(cap);
  if (!ptr) {
    logError("Fail to allocate memory!\r\n");
    return (void *)0;
  }
  bzero(ptr, cap);
  return ptr;
}


x86 assembly (clang, -O0):
<allocMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117e <allocMemory+0x4e>
lea    0xe94(%rip),%rdi
call   1030 <logError@plt>
movq   $0x0,-0x8(%rbp)
jmp    1193 <allocMemory+0x63>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <bzero@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocMemory>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1158 <allocMemory+0x28>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <bzero@plt>
jmp    1164 <allocMemory+0x34>
lea    0xea1(%rip),%rdi
call   1030 <logError@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Fail to allocate memory!\0D\0A\00"
define i8* @allocMemory(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = mul i64 %8, %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @logError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %22
17: ; preds = %2
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i32 @bzero(i8* %18, i64 %19)
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %17, %15
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [27 x i8] c"Fail to allocate memory!\0D\0A\00"
define noalias i8* @allocMemory(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @logError(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 @bzero(i8* %4, i64 %3)
br label %10
10: ; preds = %8, %6
ret i8* %4
}
adrreg0adrx1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114b <adrreg0adrx1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <adrreg0adrx1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1>:
movzwl 0x1312d00(%r8),%edx
01
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adrreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = icmp ule i16 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void param_double_clear(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<param_double_clear>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @param_double_clear(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, int, int, int /*<<< orphan*/ *);
size_t read_bin(FILE *fp, void *array, int arrayBytes) {
  return fread(array, 1, arrayBytes, fp);
}


x86 assembly (clang, -O0):
<read_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bin>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @read_bin(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i32 %2, i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int a = 5, b = 4, c = 3;
  int result;
  result = b * b - 4 * a * c;
  printf("Result %i^2 - 4*%i*%i = %i\n", b, a, c, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"Result %i^2 - 4*%i*%i = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 4, i32* %3
store i32 3, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = mul nsw i32 4, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = sub nsw i32 %8, %12
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Result %i^2 - 4*%i*%i = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 4, i32 5, i32 3, i32 -44)
ret i32 0
}
/* Type definitions */
struct ui {
  int dummy;
};

/* Variables and functions */
scalar_t__ ui_peek_c(struct ui *, char *);
size_t peek_non_brace(struct ui *is) {
  char tmp;
  return (ui_peek_c(is, &tmp) && tmp != '{' && tmp != '}') ? 1 : 0;
}


x86 assembly (clang, -O0):
<peek_non_brace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
call   1030 <ui_peek_c@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     115a <peek_non_brace+0x4a>
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7b,%ecx
mov    %al,-0xa(%rbp)
je     115a <peek_non_brace+0x4a>
movsbl -0x9(%rbp),%eax
cmp    $0x7d,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek_non_brace>:
push   %rax
lea    0x7(%rsp),%rsi
call   1030 <ui_peek_c@plt>
test   %rax,%rax
setne  %al
mov    0x7(%rsp),%cl
cmp    $0x7b,%cl
setne  %dl
and    %al,%dl
cmp    $0x7d,%cl
setne  %al
and    %dl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ui = type { i32 }
define i64 @peek_non_brace(%struct.ui* %0) {
%2 = alloca %struct.ui*
%3 = alloca i8
store %struct.ui* %0, %struct.ui** %2
%4 = load %struct.ui*, %struct.ui** %2
%5 = call i64 @ui_peek_c(%struct.ui* %4, i8* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 123
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 125
br label %15
15: ; preds = %11, %7, %1
%16 = phi i1 [ false, %7 ], [ false, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
%struct.ui = type { i32 }
define i64 @peek_non_brace(%struct.ui* %0) {
%2 = alloca i8
%3 = call i64 @ui_peek_c(%struct.ui* %0, i8* %2)
%4 = icmp ne i64 %3, 0
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 123
%7 = select i1 %4, i1 %6, i1 false
%8 = icmp ne i8 %5, 125
%9 = select i1 %7, i1 %8, i1 false
%10 = zext i1 %9 to i64
ret i64 %10
}
float getInches(float length) { return length - ((int)(length) / 12) * 12; }


x86 assembly (clang, -O0):
<getInches>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
imul   $0xc,%eax,%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInches>:
cvttss2si %xmm0,%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x21,%rax
add    %ecx,%eax
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @getInches(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
%6 = sdiv i32 %5, 12
%7 = mul nsw i32 %6, 12
%8 = sitofp i32 %7 to float
%9 = fsub float %3, %8
ret float %9
}

LLVM IR (-O2):
define float @getInches(float %0) {
%2 = fptosi float %0 to i32
%3 = srem i32 %2, 12
%4 = sub i32 %2, %3
%5 = sitofp i32 %4 to float
%6 = fsub float %0, %5
ret float %6
}
/* Variables and functions */
long double __qhypot(long double, long double);
long double __cqabs(long double zqreal, long double zqimag) {
  return (__qhypot(zqreal, zqimag));
}


x86 assembly (clang, -O0):
<__cqabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__qhypot@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cqabs>:
jmp    1030 <__qhypot@plt>

LLVM IR (-O0):
define x86_fp80 @__cqabs(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @__qhypot(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @__cqabs(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @__qhypot(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_castsi128_pd(int /*<<< orphan*/);
__m128d test_mm_castsi128_pd(__m128i A) { return _mm_castsi128_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_castsi128_pd>:
jmp    1030 <_mm_castsi128_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_castsi128_pd(i32 %0) {
%2 = tail call i32 @_mm_castsi128_pd(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ buffer_init();
int /*<<< orphan*/ video_open();
int /*<<< orphan*/ video_set_format();
int /*<<< orphan*/ video_streamon();
void video_init() {
  video_open();
  video_set_format();
  buffer_init();
  video_streamon();
}


x86 assembly (clang, -O0):
<video_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <video_open@plt>
mov    $0x0,%al
call   1050 <video_set_format@plt>
mov    $0x0,%al
call   1030 <buffer_init@plt>
mov    $0x0,%al
call   1040 <video_streamon@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_init>:
push   %rax
xor    %eax,%eax
call   1060 <video_open@plt>
xor    %eax,%eax
call   1050 <video_set_format@plt>
xor    %eax,%eax
call   1030 <buffer_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <video_streamon@plt>

LLVM IR (-O0):
define void @video_init() {
%1 = call i32 (...) @video_open()
%2 = call i32 (...) @video_set_format()
%3 = call i32 (...) @buffer_init()
%4 = call i32 (...) @video_streamon()
ret void
}

LLVM IR (-O2):
define void @video_init() {
%1 = tail call i32 (...) @video_open()
%2 = tail call i32 (...) @video_set_format()
%3 = tail call i32 (...) @buffer_init()
%4 = tail call i32 (...) @video_streamon()
ret void
}
unsigned int ECAPPeripheralIdGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x5C)))));
}


x86 assembly (clang, -O0):
<ECAPPeripheralIdGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5c,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPPeripheralIdGet>:
add    $0x5c,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ECAPPeripheralIdGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 92
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ECAPPeripheralIdGet(i32 %0) {
%2 = add i32 %0, 92
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exits(char *);
void *malloc(long);
void *Malloc(long n) {
  void *p;
  p = malloc(n);
  if (p == 0)
    exits("malloc");
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <Malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <exits@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <exits@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exits(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}