xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thanks(void) {
  printf("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
  printf("Thank you for playing this game.\n");
  printf("It made by Habibur Rahman[shadhin]\n");
  printf("Emai:root@hrshadhin.me\n");
  printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}


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

x86 assembly (clang, -O2):
<thanks>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0A\0A>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\0A\00"
@.str.1 = [34 x i8] c"Thank you for playing this game.\0A\00"
@.str.2 = [36 x i8] c"It made by Habibur Rahman[shadhin]\0A\00"
@.str.3 = [24 x i8] c"Emai:root@hrshadhin.me\0A\00"
@.str.4 = [34 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\0A\00"
define void @thanks() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"\0A\0A>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\00"
@str.5 = [33 x i8] c"Thank you for playing this game.\00"
@str.6 = [35 x i8] c"It made by Habibur Rahman[shadhin]\00"
@str.7 = [23 x i8] c"Emai:root@hrshadhin.me\00"
@str.8 = [33 x i8] c"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\00"
define void @thanks() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print(const char *str) { printf("the value is: %s\n", str); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"the value is: %s\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"the value is: %s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int is_file_exist(char *);
int is_dir_exist(char *path) { return is_file_exist(path); }


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

x86 assembly (clang, -O2):
<is_dir_exist>:
jmp    1030 <is_file_exist@plt>

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

LLVM IR (-O2):
define i32 @is_dir_exist(i8* %0) {
%2 = tail call i32 @is_file_exist(i8* %0)
ret i32 %2
}
float mul(float left, float right) { return left * right; }


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

x86 assembly (clang, -O2):
<mul>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mul(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mul(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
unsigned sizeof_ptrdiff(void) { return (unsigned)sizeof(ptrdiff_t); }


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

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

LLVM IR (-O0):
define i32 @sizeof_ptrdiff() {
ret i32 4
}

LLVM IR (-O2):
define i32 @sizeof_ptrdiff() {
ret i32 4
}
/* Type definitions */
struct uo {
  int dummy;
};
struct ui {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uio_copy(struct ui *, struct uo *);
void testuio_copy(struct ui *is, struct uo *os) { uio_copy(is, os); }


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

x86 assembly (clang, -O2):
<testuio_copy>:
jmp    1030 <uio_copy@plt>

LLVM IR (-O0):
%struct.ui = type { i32 }
%struct.uo = type { i32 }
define void @testuio_copy(%struct.ui* %0, %struct.uo* %1) {
%3 = alloca %struct.ui*
%4 = alloca %struct.uo*
store %struct.ui* %0, %struct.ui** %3
store %struct.uo* %1, %struct.uo** %4
%5 = load %struct.ui*, %struct.ui** %3
%6 = load %struct.uo*, %struct.uo** %4
%7 = call i32 @uio_copy(%struct.ui* %5, %struct.uo* %6)
ret void
}

LLVM IR (-O2):
%struct.ui = type { i32 }
%struct.uo = type { i32 }
define void @testuio_copy(%struct.ui* %0, %struct.uo* %1) {
%3 = tail call i32 @uio_copy(%struct.ui* %0, %struct.uo* %1)
ret void
}
/* Type definitions */
struct sm_seg_hdl {
  int dummy;
};

/* Variables and functions */
int sm_seg_instance_put(struct sm_seg_hdl *);
int sm_seg_instance_delete(struct sm_seg_hdl *h) {
  return (sm_seg_instance_put(h));
}


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

x86 assembly (clang, -O2):
<sm_seg_instance_delete>:
jmp    1030 <sm_seg_instance_put@plt>

LLVM IR (-O0):
%struct.sm_seg_hdl = type { i32 }
define i32 @sm_seg_instance_delete(%struct.sm_seg_hdl* %0) {
%2 = alloca %struct.sm_seg_hdl*
store %struct.sm_seg_hdl* %0, %struct.sm_seg_hdl** %2
%3 = load %struct.sm_seg_hdl*, %struct.sm_seg_hdl** %2
%4 = call i32 @sm_seg_instance_put(%struct.sm_seg_hdl* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.sm_seg_hdl = type { i32 }
define i32 @sm_seg_instance_delete(%struct.sm_seg_hdl* %0) {
%2 = tail call i32 @sm_seg_instance_put(%struct.sm_seg_hdl* %0)
ret i32 %2
}
/* Type definitions */
struct _icmAlloc {
  int dummy;
};

/* Variables and functions */
void *realloc(void *, size_t);
void *icmAllocStd_realloc(struct _icmAlloc *pp, void *ptr, size_t size) {
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<icmAllocStd_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
%struct._icmAlloc = type { i32 }
define i8* @icmAllocStd_realloc(%struct._icmAlloc* %0, i8* %1, i64 %2) {
%4 = alloca %struct._icmAlloc*
%5 = alloca i8*
%6 = alloca i64
store %struct._icmAlloc* %0, %struct._icmAlloc** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct._icmAlloc = type { i32 }
define noalias i8* @icmAllocStd_realloc(%struct._icmAlloc* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_viewer_command(char const *);
int /*<<< orphan*/ *read_cmd_output(char *);
FILE *use_info_prog(const char viewer[]) {
  FILE *fp;
  char *cmd;
  cmd = get_viewer_command(viewer);
  fp = read_cmd_output(cmd);
  free(cmd);
  return fp;
}


x86 assembly (clang, -O0):
<use_info_prog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_viewer_command@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <read_cmd_output@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_info_prog>:
push   %r14
push   %rbx
push   %rax
call   1030 <get_viewer_command@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <read_cmd_output@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @use_info_prog(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @get_viewer_command(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @read_cmd_output(i8* %7)
store i32* %8, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define i32* @use_info_prog(i8* %0) {
%2 = tail call i8* @get_viewer_command(i8* %0)
%3 = tail call i32* @read_cmd_output(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32* %3
}
/* Variables and functions */
void *__mf_wrap_alloca_indirect(size_t);
void *__wrap_alloca(size_t c) { return __mf_wrap_alloca_indirect(c); }


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

x86 assembly (clang, -O2):
<__wrap_alloca>:
jmp    1030 <__mf_wrap_alloca_indirect@plt>

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

LLVM IR (-O2):
define i8* @__wrap_alloca(i64 %0) {
%2 = tail call i8* @__mf_wrap_alloca_indirect(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is test #2.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"This is test.\0A\00"
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
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"This is test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no, noclone, noreturn)) void noret(int x, ...) { abort(); }


x86 assembly (clang, -O0):
<noret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<noret>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @noret(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @noret(i32 %0, ...) {
%2 = tail call i32 (...) @abort()
unreachable
}
void BSEG_SetBatchStateImages(char *pcFileName, char *pcStatus) {}


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

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

LLVM IR (-O0):
define void @BSEG_SetBatchStateImages(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 @BSEG_SetBatchStateImages(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct libgfx_vertex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __builtin_mips_cache(int, struct libgfx_vertex *);
void libgfx_vertex_flush(struct libgfx_vertex *v) {
  __builtin_mips_cache(0x19, v);
}


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

x86 assembly (clang, -O2):
<libgfx_vertex_flush>:
mov    %rdi,%rsi
mov    $0x19,%edi
jmp    1030 <__builtin_mips_cache@plt>

LLVM IR (-O0):
%struct.libgfx_vertex = type { i32 }
define void @libgfx_vertex_flush(%struct.libgfx_vertex* %0) {
%2 = alloca %struct.libgfx_vertex*
store %struct.libgfx_vertex* %0, %struct.libgfx_vertex** %2
%3 = load %struct.libgfx_vertex*, %struct.libgfx_vertex** %2
%4 = call i32 @__builtin_mips_cache(i32 25, %struct.libgfx_vertex* %3)
ret void
}

LLVM IR (-O2):
%struct.libgfx_vertex = type { i32 }
define void @libgfx_vertex_flush(%struct.libgfx_vertex* %0) {
%2 = tail call i32 @__builtin_mips_cache(i32 25, %struct.libgfx_vertex* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int pthread_attr_getaffinity_np(pthread_attr_t attr, size_t cpusetsize,
                                cpu_set_t *cpuset) {
  ;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_attr_getaffinity_np>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_attr_getaffinity_np(i32 %0, i64 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ siftdown(int *, int, int);
void heapify(int *array, int arraylength) {
  if (array == NULL || arraylength <= 1)
    return;
  for (int parent = (arraylength - 2) / 2; parent >= 0; parent--) {
    siftdown(array, parent, arraylength - 1);
  }
}


x86 assembly (clang, -O0):
<heapify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <heapify+0x24>
cmpl   $0x1,-0xc(%rbp)
jg     1139 <heapify+0x29>
jmp    1174 <heapify+0x64>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1174 <heapify+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <siftdown@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <heapify+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapify>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1141 <heapify+0x31>
mov    %esi,%ebx
cmp    $0x2,%esi
jl     1141 <heapify+0x31>
mov    %rdi,%r14
lea    -0x2(%rbx),%ebp
shr    %ebp
add    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <siftdown@plt>
add    $0xffffffff,%ebp
jb     1130 <heapify+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heapify(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %2
br label %28
12: ; preds = %8
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 2
%15 = sdiv i32 %14, 2
store i32 %15, i32* %5
br label %16
16: ; preds = %25, %12
%17 = load i32, i32* %5
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32*, i32** %3
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
%24 = call i32 @siftdown(i32* %20, i32 %21, i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %5
%27 = add nsw i32 %26, -1
store i32 %27, i32* %5
br label %16
28: ; preds = %11, %16
ret void
}

LLVM IR (-O2):
define void @heapify(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
%4 = icmp slt i32 %1, 2
%5 = or i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = add nsw i32 %1, -2
%8 = lshr i32 %7, 1
%9 = add nsw i32 %1, -1
br label %10
10: ; preds = %6, %10
%11 = phi i32 [ %8, %6 ], [ %13, %10 ]
%12 = tail call i32 @siftdown(i32* %0, i32 %11, i32 %9)
%13 = add nsw i32 %11, -1
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %10
15: ; preds = %10, %2
ret void
}
/* Variables and functions */
scalar_t__ iscntrl(int);
int isprint(int c) {
  if (iscntrl(c))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
je     1139 <isprint+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1140 <isprint+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @iscntrl(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @iscntrl(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogIntEnable(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogIntEnable+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntEnable>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
orq    $0x1,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 8
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = or i64 %15, 1
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogIntEnable(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 1
store volatile i64 %9, i64* %7
ret void
}
DIV(unsigned i) { return i / 2; }


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

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

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

LLVM IR (-O2):
define i32 @DIV(i32 %0) {
%2 = lshr i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void op_exit() { exit(0); }


x86 assembly (clang, -O0):
<op_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<op_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @op_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @op_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *calloc(size_t, int);
int /*<<< orphan*/ errx(int, char *, int);
void *MALLOC(size_t n) {
  void *r = calloc(n, 1);
  if (!r)
    errx(1, "Cannot allocate %d bytes\n", (int)n);
  return r;
}


x86 assembly (clang, -O0):
<MALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <MALLOC+0x40>
mov    -0x8(%rbp),%rax
mov    %eax,%edx
mov    $0x1,%edi
lea    0xea5(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MALLOC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <MALLOC+0x2d>
lea    0xec0(%rip),%rsi
mov    $0x1,%edi
mov    %r14d,%edx
call   1030 <errx@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Cannot allocate %d bytes\0A\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* @calloc(i64 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i32
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [26 x i8] c"Cannot allocate %d bytes\0A\00"
define i8* @MALLOC(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i64 %0 to i32
%6 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void stub1();
int main(void) {
  char *shellcode = "\xb8\x01\x00\x00\x00\xbb\xe9\x00\x00\x00\xcd\x80";
  printf("strlen(shellcode)=%d\n", strlen(shellcode));
  ((void (*)(void))shellcode)();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
call   2000 <_fini+0xebc>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\B8\01\00\00\00\BB\E9\00\00\00\CD\80\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to void ()*
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"\B8\01\00\00\00\BB\E9\00\00\00\CD\80\00"
@.str.1 = [22 x i8] c"strlen(shellcode)=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %1)
tail call void bitcast ([13 x i8]* @.str to void ()*)()
ret i32 0
}
void clear_matrix_edge(double *matrix) {
  matrix[3] = 0;
  matrix[7] = 0;
  matrix[11] = 0;
  matrix[12] = 0;
  matrix[13] = 0;
  matrix[14] = 0;
  matrix[15] = 1;
}


x86 assembly (clang, -O0):
<clear_matrix_edge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x58(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x68(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x70(%rax)
mov    -0x8(%rbp),%rax
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,0x78(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_matrix_edge>:
movq   $0x0,0x18(%rdi)
movq   $0x0,0x38(%rdi)
xorps  %xmm0,%xmm0
movups %xmm0,0x58(%rdi)
movups %xmm0,0x68(%rdi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x78(%rdi)
ret

LLVM IR (-O0):
define void @clear_matrix_edge(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 3
store double 0.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 7
store double 0.000000e+00, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 11
store double 0.000000e+00, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 12
store double 0.000000e+00, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 13
store double 0.000000e+00, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 14
store double 0.000000e+00, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 15
store double 1.000000e+00, double* %16
ret void
}

LLVM IR (-O2):
define void @clear_matrix_edge(double* nocapture writeonly %0) {
%2 = getelementptr inbounds double, double* %0, i64 3
store double 0.000000e+00, double* %2
%3 = getelementptr inbounds double, double* %0, i64 7
store double 0.000000e+00, double* %3
%4 = getelementptr inbounds double, double* %0, i64 11
%5 = getelementptr inbounds double, double* %0, i64 15
%6 = bitcast double* %4 to i8*
store double 1.000000e+00, double* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned short getshort(FILE *pcl) {
  int ch1, ch2;
  ch1 = getc(pcl);
  ch2 = getc(pcl);
  return ((ch1 << 8) | ch2);
}


x86 assembly (clang, -O0):
<getshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     -0x10(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshort>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%ebp
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @getshort(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @getshort(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %2, 8
%5 = or i32 %4, %3
%6 = trunc i32 %5 to i16
ret i16 %6
}
int ceil_div(int dd, int dr) { return (dd / dr + (dd % dr > 0)); }


x86 assembly (clang, -O0):
<ceil_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_div>:
mov    %edi,%eax
cltd
idiv   %esi
xor    %ecx,%ecx
test   %edx,%edx
setg   %cl
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceil_div(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 = sdiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceil_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int check_comment(char, int);
int chek_2_char_operator(char ch, char *temp, int i) {
  switch (ch) {
  case '/':
    i = check_comment(ch, i);
    break;
  }
  return i;
}


x86 assembly (clang, -O0):
<chek_2_char_operator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x1(%rbp),%al
sub    $0x2f,%al
jne    1146 <chek_2_char_operator+0x36>
jmp    1135 <chek_2_char_operator+0x25>
mov    -0x1(%rbp),%al
mov    -0x14(%rbp),%esi
movsbl %al,%edi
call   1030 <check_comment@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chek_2_char_operator>:
cmp    $0x2f,%dil
jne    1122 <chek_2_char_operator+0x12>
mov    $0x2f,%edi
mov    %edx,%esi
jmp    1030 <check_comment@plt>
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @chek_2_char_operator(i8 signext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
switch i32 %8, label %13 [
i32 47, label %9
]
9: ; preds = %3
%10 = load i8, i8* %4
%11 = load i32, i32* %6
%12 = call i32 @check_comment(i8 signext %10, i32 %11)
store i32 %12, i32* %6
br label %13
13: ; preds = %3, %9
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @chek_2_char_operator(i8 signext %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8 %0, 47
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @check_comment(i8 signext 47, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %2, %3 ]
ret i32 %8
}
int periodic(int i, int L, int nu) { return (i + nu) % L; }


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

x86 assembly (clang, -O2):
<periodic>:
lea    (%rdi,%rdx,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @periodic(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* %6
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = srem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @periodic(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = srem i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_regexp_make() { exit(1); }


x86 assembly (clang, -O0):
<caml_regexp_make>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_regexp_make>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_regexp_make() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_regexp_make() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int asm_open(char const *, int, int /*<<< orphan*/);
int __attribute__((section("libgloss_epiphany")))
_open(const char *file, int flags, mode_t mode) {
  return asm_open(file, flags, mode);
}


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

x86 assembly (clang, -O2):
<_open>:
jmp    1030 <asm_open@plt>

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

LLVM IR (-O2):
define i32 @_open(i8* %0, i32 %1, i32 %2) section "libgloss_epiphany" {
%4 = tail call i32 @asm_open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(void) {
  int fd;
  fd = open("/dev/mgcap/lo", O_RDWR);
  if (fd < 0) {
    perror("open");
    return 1;
  }
  ioctl(fd, 10);
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1189 <main+0x49>
lea    0xe96(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    119e <main+0x5e>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     1173 <main+0x33>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0xa,%esi
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe94(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/dev/mgcap/lo\00"
@O_RDWR = global i32 0
@.str.1 = [5 x i8] c"open\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @ioctl(i32 %10, i32 10)
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"/dev/mgcap/lo\00"
@O_RDWR = global i32 0
@.str.1 = [5 x i8] c"open\00"
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %0
%7 = tail call i32 @ioctl(i32 %2, i32 10)
%8 = tail call i32 @close(i32 %2)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ isupper(char);
char tolower(char);
int csame(char a, char b) {
  if (isupper(a))
    a = tolower(a);
  if (isupper(b))
    b = tolower(b);
  return a == b;
}


x86 assembly (clang, -O0):
<csame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1153 <csame+0x33>
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1172 <csame+0x52>
movsbl -0x2(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csame>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     113d <csame+0x1d>
movsbl %bl,%edi
call   1030 <tolower@plt>
mov    %eax,%ebx
movsbl %r14b,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1157 <csame+0x37>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %eax,%r14d
xor    %eax,%eax
cmp    %r14b,%bl
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @csame(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @isupper(i8 signext %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call signext i8 @tolower(i8 signext %0)
br label %7
7: ; preds = %5, %2
%8 = phi i8 [ %6, %5 ], [ %0, %2 ]
%9 = tail call i64 @isupper(i8 signext %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call signext i8 @tolower(i8 signext %1)
br label %13
13: ; preds = %11, %7
%14 = phi i8 [ %12, %11 ], [ %1, %7 ]
%15 = icmp eq i8 %8, %14
%16 = zext i1 %15 to i32
ret i32 %16
}
unsigned int hash(char *s) {
  unsigned int hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int resize_term(int, int);
int wrap_resize_term(int nlines, int ncols) {
  return resize_term(nlines, ncols);
}


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

x86 assembly (clang, -O2):
<wrap_resize_term>:
jmp    1030 <resize_term@plt>

LLVM IR (-O0):
define i32 @wrap_resize_term(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 @resize_term(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wrap_resize_term(i32 %0, i32 %1) {
%3 = tail call i32 @resize_term(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int child_fn(void *arg) {
  puts("FAIL: in child_fn(); should not be here");
  exit(1);
}


x86 assembly (clang, -O0):
<child_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [40 x i8] c"FAIL: in child_fn(); should not be here\00"
define i32 @child_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"FAIL: in child_fn(); should not be here\00"
define i32 @child_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void dummy_function_to_avoid_bus_error() {}


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

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

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

LLVM IR (-O2):
define void @dummy_function_to_avoid_bus_error() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _insertarIdIndiceCant(unsigned int, unsigned int);
int Servicio_agregar_categoria(unsigned int id, unsigned int id_cat) {
  _insertarIdIndiceCant(id, id_cat);
  return 0;
}


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

x86 assembly (clang, -O2):
<Servicio_agregar_categoria>:
push   %rax
call   1030 <_insertarIdIndiceCant@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Servicio_agregar_categoria(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 @_insertarIdIndiceCant(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @Servicio_agregar_categoria(i32 %0, i32 %1) {
%3 = tail call i32 @_insertarIdIndiceCant(i32 %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lex_test();
int main(int argc, char **argv) { lex_test(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @lex_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lex_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_vtkFile(char const *, unsigned int, int *, float *,
                                 int *);
void writeVtkOutput(float *collideField, int *flagField, const char *filename,
                    unsigned int t, int *length) {
  write_vtkFile(filename, t, length, collideField, flagField);
}


x86 assembly (clang, -O0):
<writeVtkOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
call   1030 <write_vtkFile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeVtkOutput>:
mov    %rsi,%r9
mov    %rdi,%rax
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %r8,%rdx
mov    %rax,%rcx
mov    %r9,%r8
jmp    1030 <write_vtkFile@plt>

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

LLVM IR (-O2):
define void @writeVtkOutput(float* %0, i32* %1, i8* %2, i32 %3, i32* %4) {
%6 = tail call i32 @write_vtkFile(i8* %2, i32 %3, i32* %4, float* %0, i32* %1)
ret void
}