xunge/DecIR huggingface dataset:
double *getEl(double *array, int x, int y, int z, int i, int *n) {
  return array + 19 * (z * n[2] * n[1] + y * n[2] + x) + i;
}


x86 assembly (clang, -O0):
<getEl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rdx
imul   0x8(%rdx),%ecx
mov    -0x20(%rbp),%rdx
imul   0x4(%rdx),%ecx
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rsi
imul   0x8(%rsi),%edx
add    %edx,%ecx
add    -0xc(%rbp),%ecx
imul   $0x13,%ecx,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEl>:
imul   0x4(%r9),%ecx
add    %edx,%ecx
imul   0x8(%r9),%ecx
add    %esi,%ecx
lea    (%rcx,%rcx,8),%eax
lea    (%rcx,%rax,2),%eax
cltq
lea    (%rdi,%rax,8),%rax
movslq %r8d,%rcx
lea    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
define double* @getEl(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store double* %0, double** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32* %5, i32** %12
%13 = load double*, double** %7
%14 = load i32, i32* %10
%15 = load i32*, i32** %12
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = load i32*, i32** %12
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
%22 = mul nsw i32 %18, %21
%23 = load i32, i32* %9
%24 = load i32*, i32** %12
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = mul nsw i32 %23, %26
%28 = add nsw i32 %22, %27
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
%31 = mul nsw i32 19, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %13, i64 %32
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
ret double* %36
}

LLVM IR (-O2):
define double* @getEl(double* readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %5, i64 1
%10 = load i32, i32* %9
%11 = mul i32 %10, %3
%12 = add i32 %11, %2
%13 = mul i32 %12, %8
%14 = add i32 %13, %1
%15 = mul nsw i32 %14, 19
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %0, i64 %16
%18 = sext i32 %4 to i64
%19 = getelementptr inbounds double, double* %17, i64 %18
ret double* %19
}
void powermgmt_init_target(void) {}


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

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

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

LLVM IR (-O2):
define void @powermgmt_init_target() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_op_reg(int /*<<< orphan*/, int, int, int);
void emit_sub_rx(int base, int reg) { emit_op_reg(0, 0x29, base, reg); }


x86 assembly (clang, -O0):
<emit_sub_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %edi,%edi
mov    $0x29,%esi
call   1030 <emit_op_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_sub_rx>:
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
mov    $0x29,%esi
jmp    1030 <emit_op_reg@plt>

LLVM IR (-O0):
define void @emit_sub_rx(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 = call i32 @emit_op_reg(i32 0, i32 41, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @emit_sub_rx(i32 %0, i32 %1) {
%3 = tail call i32 @emit_op_reg(i32 0, i32 41, i32 %0, i32 %1)
ret void
}
float sinf_neon_hfp(float x) {}


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

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

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

LLVM IR (-O2):
define float @sinf_neon_hfp(float %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ hybris_plugin_fb_unload();
int /*<<< orphan*/ hybris_plugin_lights_unload();
int /*<<< orphan*/ hybris_plugin_sensors_unload();
void mce_hybris_quit(void) {
  hybris_plugin_fb_unload();
  hybris_plugin_lights_unload();
  hybris_plugin_sensors_unload();
}


x86 assembly (clang, -O0):
<mce_hybris_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hybris_plugin_fb_unload@plt>
mov    $0x0,%al
call   1050 <hybris_plugin_lights_unload@plt>
mov    $0x0,%al
call   1040 <hybris_plugin_sensors_unload@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mce_hybris_quit>:
push   %rax
xor    %eax,%eax
call   1030 <hybris_plugin_fb_unload@plt>
xor    %eax,%eax
call   1050 <hybris_plugin_lights_unload@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hybris_plugin_sensors_unload@plt>

LLVM IR (-O0):
define void @mce_hybris_quit() {
%1 = call i32 (...) @hybris_plugin_fb_unload()
%2 = call i32 (...) @hybris_plugin_lights_unload()
%3 = call i32 (...) @hybris_plugin_sensors_unload()
ret void
}

LLVM IR (-O2):
define void @mce_hybris_quit() {
%1 = tail call i32 (...) @hybris_plugin_fb_unload()
%2 = tail call i32 (...) @hybris_plugin_lights_unload()
%3 = tail call i32 (...) @hybris_plugin_sensors_unload()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, float *, int);
int Float_to_MINUS_bytes(float x) {
  int y;
  memcpy(&y, &x, sizeof(float));
  return y;
}


x86 assembly (clang, -O0):
<Float_to_MINUS_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_to_MINUS_bytes>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Float_to_MINUS_bytes(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, float* %2, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int main() {
  short i;
  for (i = 6; i >= 0; i--)
    foo((void *)(long)i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x6,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x0,%eax
jl     114d <main+0x3d>
movswq -0x6(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x6(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x6(%rbp)
jmp    1125 <main+0x15>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 6, i16* %2
br label %3
3: ; preds = %12, %0
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i16, i16* %2
%9 = sext i16 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @foo(i8* %10)
br label %12
12: ; preds = %7
%13 = load i16, i16* %2
%14 = add i16 %13, -1
store i16 %14, i16* %2
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i8* inttoptr (i64 6 to i8*))
%2 = tail call i32 @foo(i8* inttoptr (i64 5 to i8*))
%3 = tail call i32 @foo(i8* inttoptr (i64 4 to i8*))
%4 = tail call i32 @foo(i8* inttoptr (i64 3 to i8*))
%5 = tail call i32 @foo(i8* inttoptr (i64 2 to i8*))
%6 = tail call i32 @foo(i8* inttoptr (i64 1 to i8*))
%7 = tail call i32 @foo(i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __safeFree(void **ptr) {
  if (ptr != NULL && *ptr != NULL) {
    free(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<__safeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <__safeFree+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <__safeFree+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safeFree>:
push   %rbx
test   %rdi,%rdi
je     112d <__safeFree+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <__safeFree+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__safeFree(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 %14
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
%13 = load i8**, i8*** %2
store i8* null, i8** %13
br label %14
14: ; preds = %9, %5, %1
ret void
}

LLVM IR (-O2):
define void @__safeFree(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error_msg_and_exit(const char *msg) {
  fprintf(stderr, "%s --> %s\n", msg, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_msg_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_msg_and_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s --> %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @error_msg_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s --> %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @error_msg_and_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
const char *mz_version(void) { return "9.1.15"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"9.1.15\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Interface();
int main(const int ORDER_TOTAL, const char *ORDERs[]) {
  while (1) {
    Interface();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Interface@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Interface@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @Interface()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @Interface()
br label %3
}
/* Variables and functions */
char *memory_Malloc(scalar_t__);
char *strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *string_Conc(const char *s1, const char *s2) {
  char *dst;
  dst = memory_Malloc(strlen(s1) + strlen(s2) + 1);
  strcpy(dst, s1);
  return strcat(dst, s2);
}


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

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

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

LLVM IR (-O2):
define i8* @string_Conc(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @memory_Malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i8* @strcat(i8* dereferenceable(1) %7, i8* dereferenceable(1) %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ satislariEkranaYaz();
int /*<<< orphan*/ satislariOku();
int main() {
  satislariOku();
  satislariEkranaYaz();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <satislariOku@plt>
mov    $0x0,%al
call   1030 <satislariEkranaYaz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <satislariOku@plt>
xor    %eax,%eax
call   1030 <satislariEkranaYaz@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @satislariOku()
%2 = tail call i32 (...) @satislariEkranaYaz()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: genequs [-o hexoffset] [-e] [-s] outputfile lstfile ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Usage: genequs [-o hexoffset] [-e] [-s] outputfile lstfile ...\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [63 x i8] c"Usage: genequs [-o hexoffset] [-e] [-s] outputfile lstfile ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ store64_native(void *, int /*<<< orphan*/);
__attribute__((always_)) void store64(void *dst, uint64_t w) {
  store64_native(dst, w);
}


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

x86 assembly (clang, -O2):
<store64>:
jmp    1030 <store64_native@plt>

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

LLVM IR (-O2):
define void @store64(i8* %0, i32 %1) {
%3 = tail call i32 @store64_native(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
size_t round_up(size_t i, size_t n) { return n * ((i - 1) / n + 1); }


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    $0x1,%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <round_up+0x1a>
xor    %edx,%edx
div    %rsi
jmp    111e <round_up+0x1e>
xor    %edx,%edx
div    %esi
add    $0x1,%rax
imul   %rsi,%rax
ret

LLVM IR (-O0):
define i64 @round_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub i64 %6, 1
%8 = load i64, i64* %4
%9 = udiv i64 %7, %8
%10 = add i64 %9, 1
%11 = mul i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @round_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = udiv i64 %3, %1
%5 = add i64 %4, 1
%6 = mul i64 %5, %1
ret i64 %6
}
int oneof(target, list, cnt)
register char *target, *list[];
int cnt;
{
  register int i;
  for (i = 0; i < cnt; i++)
    if (strcmp(target, list[i]) == 0)
      return (i);
  return (-1);
}


x86 assembly (clang, -O0):
<oneof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1172 <oneof+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115f <oneof+0x4f>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <oneof+0x69>
jmp    1164 <oneof+0x54>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <oneof+0x1a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oneof>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0xffffffff,%r14d
test   %edx,%edx
jle    114e <oneof+0x3e>
mov    %rsi,%r15
mov    %rdi,%r12
mov    %edx,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114b <oneof+0x3b>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <oneof+0x20>
jmp    114e <oneof+0x3e>
mov    %ebx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @oneof(i8* nocapture %0, i8** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ 0, %5 ], [ %14, %13 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %18, label %7
16: ; preds = %7
%17 = trunc i64 %8 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ -1, %3 ], [ %17, %16 ], [ -1, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ ixp2000_is_pcimaster();
unsigned int ixdp2x00_master_npu(void) { return !!ixp2000_is_pcimaster(); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ixp2000_is_pcimaster@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <ixp2000_is_pcimaster@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ixdp2x00_master_npu() {
%1 = call i32 (...) @ixp2000_is_pcimaster()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ixdp2x00_master_npu() {
%1 = tail call i32 (...) @ixp2000_is_pcimaster()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ strchr(char const *, char);
int GIB_Regex_Translate_Runtime_Options(const char *opstr) {
  int options = 0;
  if (strchr(opstr, '<'))
    options |= 1;
  if (strchr(opstr, '>'))
    options |= (1 << 1);
  return options;
}


x86 assembly (clang, -O0):
<GIB_Regex_Translate_Runtime_Options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3c,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1144 <GIB_Regex_Translate_Runtime_Options+0x34>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1165 <GIB_Regex_Translate_Runtime_Options+0x55>
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GIB_Regex_Translate_Runtime_Options>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x3c,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %r14,%rdi
mov    $0x3e,%esi
call   1030 <strchr@plt>
lea    0x2(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @GIB_Regex_Translate_Runtime_Options(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strchr(i8* %4, i8 signext 60)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %2
%12 = call i64 @strchr(i8* %11, i8 signext 62)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = or i32 %15, 2
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @GIB_Regex_Translate_Runtime_Options(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i8 signext 60)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i64 @strchr(i8* %0, i8 signext 62)
%6 = icmp eq i64 %5, 0
%7 = or i32 %4, 2
%8 = select i1 %6, i32 %4, i32 %7
ret i32 %8
}
/* Variables and functions */
double rand_double();
double rand_uniform(double x1, double x2) {
  return rand_double() * (x2 - x1) + x1;
}


x86 assembly (clang, -O0):
<rand_uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand_double@plt>
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniform>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand_double@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_uniform(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @rand_double()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %5, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @rand_uniform(double %0, double %1) {
%3 = tail call double (...) @rand_double()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
unsigned long TimerPerscalerGet(unsigned long ulBase) {

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000028))));
}


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

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

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

LLVM IR (-O2):
define i64 @TimerPerscalerGet(i64 %0) {
%2 = add i64 %0, 40
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int pm8058_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8058_mpp_config_dtest_output(unsigned mpp, unsigned level,
                                   unsigned control) {
  return pm8058_mpp_config(mpp, 7, level, control);
}


x86 assembly (clang, -O0):
<pm8058_mpp_config_dtest_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x7,%esi
call   1030 <pm8058_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8058_mpp_config_dtest_output>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <pm8058_mpp_config@plt>

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

LLVM IR (-O2):
define i32 @pm8058_mpp_config_dtest_output(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8058_mpp_config(i32 %0, i32 7, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_contents_Good() {
  int src[3] = {5, 5, 5};
  int dst[3];
  memcpy(dst, src, sizeof(dst));
  int a[6];
  a[dst[0]] = 0;
}


x86 assembly (clang, -O0):
<memcpy_contents_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
movslq -0x18(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_contents_Good>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.memcpy_contents_Good.src = [3 x i32] [i32 5, i32 5, i32 5]
define void @memcpy_contents_Good() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [6 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 12)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
ret void
}

LLVM IR (-O2):
@__const.memcpy_contents_Good.src = [3 x i32] [i32 5, i32 5, i32 5]
define void @memcpy_contents_Good() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 12)
ret void
}
int is_alpha(char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_alpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void __DELETE_org_apache_harmony_luni_util_Util(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_apache_harmony_luni_util_Util(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_org_apache_harmony_luni_util_Util(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int get_num_bytes(int);
int get_malloc_bytes(int num_bases) {
  int num_bytes = get_num_bytes(num_bases);
  int remainder = num_bytes % sizeof(short);
  if (remainder != 0) {
    num_bytes += sizeof(short) - remainder;
  }
  return num_bytes;
}


x86 assembly (clang, -O0):
<get_malloc_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_num_bytes@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <get_malloc_bytes+0x41>
movslq -0xc(%rbp),%rax
mov    $0x2,%ecx
sub    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_malloc_bytes>:
push   %rax
call   1030 <get_num_bytes@plt>
mov    %eax,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_malloc_bytes(i32 %0) {
%2 = tail call i32 @get_num_bytes(i32 %0)
%3 = and i32 %2, 1
%4 = add i32 %3, %2
ret i32 %4
}
void ack_bad_irq(int irq) {
  extern unsigned long irq_err_count;
  irq_err_count++;
}


x86 assembly (clang, -O0):
<ack_bad_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    0x2ecc(%rip),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack_bad_irq>:
mov    0x2ee1(%rip),%rax
addq   $0x1,(%rax)
ret

LLVM IR (-O0):
@irq_err_count = external global i64
define void @ack_bad_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @irq_err_count
%4 = add i64 %3, 1
store i64 %4, i64* @irq_err_count
ret void
}

LLVM IR (-O2):
@irq_err_count = external global i64
define void @ack_bad_irq(i32 %0) {
%2 = load i64, i64* @irq_err_count
%3 = add i64 %2, 1
store i64 %3, i64* @irq_err_count
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ move(scalar_t__, scalar_t__);
int /*<<< orphan*/ ncurses_display_refresh();
void ncurses_display_hal_set_cursor(uint8_t line, uint8_t chr) {
  move(line + 1, chr + 1);
  ncurses_display_refresh();
}


x86 assembly (clang, -O0):
<ncurses_display_hal_set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1040 <move@plt>
mov    $0x0,%al
call   1030 <ncurses_display_refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncurses_display_hal_set_cursor>:
push   %rax
add    $0x1,%rdi
add    $0x1,%rsi
call   1040 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ncurses_display_refresh@plt>

LLVM IR (-O0):
define void @ncurses_display_hal_set_cursor(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add nsw i64 %5, 1
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 1
%9 = call i32 @move(i64 %6, i64 %8)
%10 = call i32 (...) @ncurses_display_refresh()
ret void
}

LLVM IR (-O2):
define void @ncurses_display_hal_set_cursor(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 1
%4 = add nsw i64 %1, 1
%5 = tail call i32 @move(i64 %3, i64 %4)
%6 = tail call i32 (...) @ncurses_display_refresh()
ret void
}
int BGBDT_MsImaAdpcm_MonoBlockSizeFromSamples(int len) {
  return (4 + ((len + 1) / 2));
}


x86 assembly (clang, -O0):
<BGBDT_MsImaAdpcm_MonoBlockSizeFromSamples>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBDT_MsImaAdpcm_MonoBlockSizeFromSamples>:
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @BGBDT_MsImaAdpcm_MonoBlockSizeFromSamples(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, 2
%6 = add nsw i32 4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @BGBDT_MsImaAdpcm_MonoBlockSizeFromSamples(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 2
%4 = add nsw i32 %3, 4
ret i32 %4
}
void INT_Excep_PERIA_INTA220(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA220() {
ret void
}
char *ae_api_name(void) { return "select"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @ae_api_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int port_byte_in(int);
int /*<<< orphan*/ port_byte_out(int, int);
int get_cursor() {
  port_byte_out(0x3D4, 14);
  int offset = port_byte_in(0x3D5) << 8;
  port_byte_out(0x3D4, 15);
  offset += port_byte_in(0x3D5);
  return offset * 2;
}


x86 assembly (clang, -O0):
<get_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cursor>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
call   1040 <port_byte_in@plt>
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_cursor() {
%1 = alloca i32
%2 = call i32 @port_byte_out(i32 980, i32 14)
%3 = call i32 @port_byte_in(i32 981)
%4 = shl i32 %3, 8
store i32 %4, i32* %1
%5 = call i32 @port_byte_out(i32 980, i32 15)
%6 = call i32 @port_byte_in(i32 981)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = mul nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_cursor() {
%1 = tail call i32 @port_byte_out(i32 980, i32 14)
%2 = tail call i32 @port_byte_in(i32 981)
%3 = shl i32 %2, 8
%4 = tail call i32 @port_byte_out(i32 980, i32 15)
%5 = tail call i32 @port_byte_in(i32 981)
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ middle_func();
void top_func(void) { middle_func(); }


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

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

LLVM IR (-O0):
define void @top_func() {
%1 = call i32 (...) @middle_func()
ret void
}

LLVM IR (-O2):
define void @top_func() {
%1 = tail call i32 (...) @middle_func()
ret void
}
long long f4(long long j, short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movswq (%rcx,%rdx,2),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
movswq (%rsi,%rdx,2),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @f4(i64 %0, i16* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i64
store i64 %0, i64* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @f4(i64 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = sext i16 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, void *, size_t);
ssize_t read_fd(int fd, void *buf, size_t size) {
  ssize_t i;
  while ((i = read(fd, buf, size)) == -1)
    if (errno != EINTR)
      return -1;
  return i;
}


x86 assembly (clang, -O0):
<read_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    116a <read_fd+0x5a>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
je     1165 <read_fd+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <read_fd+0x60>
jmp    1123 <read_fd+0x13>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fd>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    114b <read_fd+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <read_fd+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @read_fd(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ make_title(char *);
int /*<<< orphan*/ title_text(char *);
void re_title() {
  char bob[40];
  make_title(bob);
  title_text(bob);
}


x86 assembly (clang, -O0):
<re_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1040 <make_title@plt>
lea    -0x30(%rbp),%rdi
call   1030 <title_text@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_title>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <make_title@plt>
mov    %rbx,%rdi
call   1030 <title_text@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @re_title() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @make_title(i8* %2)
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%5 = call i32 @title_text(i8* %4)
ret void
}

LLVM IR (-O2):
define void @re_title() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @make_title(i8* %2)
%4 = call i32 @title_text(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_callback();
void alarm_handler() { timer_callback(); }


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

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

LLVM IR (-O0):
define void @alarm_handler() {
%1 = call i32 (...) @timer_callback()
ret void
}

LLVM IR (-O2):
define void @alarm_handler() {
%1 = tail call i32 (...) @timer_callback()
ret void
}