xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
int read(int, int *, int);
unsigned int sleep(int);
int main() {
  int c, d;
  unsigned int e;
  c = read(1, &c, 1);
  d = rand();
  e = sleep(3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edx
lea    -0x8(%rbp),%rsi
mov    %edx,%edi
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <read@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @read(i32 1, i32* %2, i32 1)
store i32 %5, i32* %2
%6 = call i32 (...) @rand()
store i32 %6, i32* %3
%7 = call i32 @sleep(i32 3)
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read(i32 1, i32* %1, i32 1)
%4 = tail call i32 (...) @rand()
%5 = tail call i32 @sleep(i32 3)
ret i32 0
}
int my_cmp(char *s1, char *s2) {
  while (*s1) {
    if (!*s2)
      return 0;
    if (*s1++ != *s2++)
      return 0;
  }
  if (*s2)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<my_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <my_cmp+0x6f>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1132 <my_cmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    118f <my_cmp+0x8f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116a <my_cmp+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    118f <my_cmp+0x8f>
jmp    110c <my_cmp+0xc>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1188 <my_cmp+0x88>
movl   $0x0,-0x4(%rbp)
jmp    118f <my_cmp+0x8f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
movzbl (%rsi,%rcx,1),%r8d
test   %dl,%dl
je     112c <my_cmp+0x2c>
test   %r8b,%r8b
je     112b <my_cmp+0x2b>
add    $0x1,%rcx
cmp    %r8b,%dl
je     1110 <my_cmp+0x10>
ret
xor    %eax,%eax
test   %r8b,%r8b
sete   %al
ret

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

LLVM IR (-O2):
define i32 @my_cmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %12, %9 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
%8 = load i8, i8* %5
br i1 %7, label %15, label %9
9: ; preds = %3
%10 = icmp ne i8 %8, 0
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = icmp eq i8 %6, %8
%14 = select i1 %10, i1 %13, i1 false
br i1 %14, label %3, label %18
15: ; preds = %3
%16 = icmp eq i8 %8, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %9, %15
%19 = phi i32 [ %17, %15 ], [ 0, %9 ]
ret i32 %19
}
void ff_hevc_put_hevc_bi_epel_v48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v48_10_sse4() {
ret void
}
int b_midperm_pack(array_in)
int array_in[4];
{ return perm_n_pack(4, array_in); }


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

x86 assembly (clang, -O2):
<b_midperm_pack>:
mov    %rdi,%rsi
mov    $0x4,%edi
xor    %eax,%eax
jmp    1030 <perm_n_pack@plt>

LLVM IR (-O0):
define i32 @b_midperm_pack(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @perm_n_pack to i32 (i32, i32*, ...)*)(i32 4, i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @b_midperm_pack(i32* %0) {
%2 = tail call i32 (i32, i32*, ...) bitcast (i32 (...)* @perm_n_pack to i32 (i32, i32*, ...)*)(i32 4, i32* %0)
ret i32 %2
}
unsigned long htonl(unsigned long num) {
  return (num << 24) | ((num & 0xFF00) << 8) | ((num & 0xFF0000) >> 8) |
         (num >> 24);
}


x86 assembly (clang, -O0):
<htonl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonl>:
mov    %rdi,%rax
shl    $0x18,%rax
mov    %edi,%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %rax,%rcx
mov    %rdi,%rax
shr    $0x8,%rax
and    $0xff00,%eax
or     %rcx,%rax
shr    $0x18,%rdi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @htonl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 24
%5 = load i64, i64* %2
%6 = and i64 %5, 65280
%7 = shl i64 %6, 8
%8 = or i64 %4, %7
%9 = load i64, i64* %2
%10 = and i64 %9, 16711680
%11 = lshr i64 %10, 8
%12 = or i64 %8, %11
%13 = load i64, i64* %2
%14 = lshr i64 %13, 24
%15 = or i64 %12, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @htonl(i64 %0) {
%2 = shl i64 %0, 24
%3 = shl i64 %0, 8
%4 = and i64 %3, 16711680
%5 = or i64 %4, %2
%6 = lshr i64 %0, 8
%7 = and i64 %6, 65280
%8 = or i64 %5, %7
%9 = lshr i64 %0, 24
%10 = or i64 %8, %9
ret i64 %10
}
unsigned int Get_Bits1(void) {
  unsigned int return_value_Get_Bits$1;
  return_value_Get_Bits$1 = Get_Bits(1);
  return return_value_Get_Bits$1;
}


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

x86 assembly (clang, -O2):
<Get_Bits1>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <Get_Bits@plt>

LLVM IR (-O0):
define i32 @Get_Bits1() {
%1 = alloca i32
%2 = call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Get_Bits1() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ vec3f(float, float, float);
float vec3f_dot(int /*<<< orphan*/, int /*<<< orphan*/);
float call_dot3(float x1, float y1, float z1, float x2, float y2, float z2) {
  return vec3f_dot(vec3f(x1, y1, z1), vec3f(x2, y2, z2));
}


x86 assembly (clang, -O0):
<call_dot3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <vec3f@plt>
mov    %eax,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1040 <vec3f@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <vec3f_dot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_dot3>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm5,0xc(%rsp)
movss  %xmm4,0x8(%rsp)
movss  %xmm3,0x4(%rsp)
call   1040 <vec3f@plt>
mov    %eax,%ebx
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1040 <vec3f@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <vec3f_dot@plt>

LLVM IR (-O0):
define float @call_dot3(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = call i32 @vec3f(float %13, float %14, float %15)
%17 = load float, float* %10
%18 = load float, float* %11
%19 = load float, float* %12
%20 = call i32 @vec3f(float %17, float %18, float %19)
%21 = call float @vec3f_dot(i32 %16, i32 %20)
ret float %21
}

LLVM IR (-O2):
define float @call_dot3(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call i32 @vec3f(float %0, float %1, float %2)
%8 = tail call i32 @vec3f(float %3, float %4, float %5)
%9 = tail call float @vec3f_dot(i32 %7, i32 %8)
ret float %9
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ err(char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ stdin;
int read(void) {
  int c;
  if ((c = getchar()) != EOF)
    return c;
  if (!feof(stdin))
    err("getchar()");
  return -1;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
je     115c <read+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <read+0x56>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
jne    117f <read+0x4f>
lea    0xe86(%rip),%rdi
call   1050 <err@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
mov    0x2e9f(%rip),%rax
cmp    (%rax),%ebx
jne    1168 <read+0x38>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
jne    1168 <read+0x38>
lea    0xe9d(%rip),%rdi
call   1050 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
@.str = [10 x i8] c"getchar()\00"
define i32 @read() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i32, i32* @stdin
%6 = tail call i32 @feof(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %0
%11 = phi i32 [ %1, %0 ], [ -1, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int strlen(char *);
void bp_sw_chop_newline(char *str) {
  str += strlen(str) - 1;
  if (*str == '\n') {
    *str = '\0';
  }
}


x86 assembly (clang, -O0):
<bp_sw_chop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114f <bp_sw_chop_newline+0x3f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_chop_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <bp_sw_chop_newline+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @bp_sw_chop_newline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = sub nsw i32 %4, 1
%6 = load i8*, i8** %2
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i8*, i8** %2
store i8 0, i8* %14
br label %15
15: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
define void @bp_sw_chop_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
void gtk_text_view_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_new() {
ret void
}
int f1(int a, int b) { return ((a) < (b) ? a : b); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <f1+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <f1+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned calc_mp(unsigned mod) {
  unsigned a, b, c;
  c = -1;
  a = c / mod;
  b = 0 - a * mod;
  if (b > mod) {
    a += 1;
    b -= mod;
  }
  return b;
}


x86 assembly (clang, -O0):
<calc_mp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
imul   -0x4(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    1147 <calc_mp+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_mp>:
mov    $0xffffffff,%eax
xor    %edx,%edx
div    %edi
lea    0x1(%rdx),%eax
ret

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

LLVM IR (-O2):
define i32 @calc_mp(i32 %0) {
%2 = urem i32 -1, %0
%3 = add nuw i32 %2, 1
ret i32 %3
}
in_swapus(s) unsigned short *s;
{
  union SWAPS {
    unsigned short *s;
    unsigned char c[2];
  } * u;
  unsigned char t;
  u = (union SWAPS *)s;
  t = u->c[0];
  u->c[0] = u->c[1];
  u->c[1] = t;
}


x86 assembly (clang, -O0):
<in_swapus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_swapus>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
%union.SWAPS = type { i16* }
define i32 @in_swapus(i16* %0) {
%2 = alloca i32
%3 = alloca i16*
%4 = alloca %union.SWAPS*
%5 = alloca i8
store i16* %0, i16** %3
%6 = load i16*, i16** %3
%7 = bitcast i16* %6 to %union.SWAPS*
store %union.SWAPS* %7, %union.SWAPS** %4
%8 = load %union.SWAPS*, %union.SWAPS** %4
%9 = bitcast %union.SWAPS* %8 to [2 x i8]*
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load %union.SWAPS*, %union.SWAPS** %4
%13 = bitcast %union.SWAPS* %12 to [2 x i8]*
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %13, i64 0, i64 1
%15 = load i8, i8* %14
%16 = load %union.SWAPS*, %union.SWAPS** %4
%17 = bitcast %union.SWAPS* %16 to [2 x i8]*
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 0
store i8 %15, i8* %18
%19 = load i8, i8* %5
%20 = load %union.SWAPS*, %union.SWAPS** %4
%21 = bitcast %union.SWAPS* %20 to [2 x i8]*
%22 = getelementptr inbounds [2 x i8], [2 x i8]* %21, i64 0, i64 1
store i8 %19, i8* %22
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @in_swapus(i16* nocapture %0) {
%2 = bitcast i16* %0 to [2 x i8]*
%3 = bitcast i16* %0 to i8*
%4 = load i8, i8* %3
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %3
store i8 %4, i8* %5
ret i32 undef
}
int lhs(int n) {
  int sum = 0;
  while (n > 0) {
    sum += n;
    n -= 1;
  }
  return sum;
}


x86 assembly (clang, -O0):
<lhs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <lhs+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <lhs+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lhs>:
test   %edi,%edi
jle    1119 <lhs+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lhs(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void lprmpt(void) {
  fputs("NLSL> ", stdout);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<lprmpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lprmpt>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"NLSL> \00"
@stdout = global i32 0
define void @lprmpt() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"NLSL> \00"
@stdout = global i32 0
define void @lprmpt() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int skip_digits(const char **p) {
  int skipped = 0;
  const char *c;
  for (c = *p; *c >= '0' && *c <= '9'; ++c) {
    skipped += 1;
  }
  *p = (*p) + skipped;
  return skipped;
}


x86 assembly (clang, -O0):
<skip_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x19(%rbp)
jl     113f <skip_digits+0x3f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114f <skip_digits+0x4f>
jmp    1169 <skip_digits+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <skip_digits+0x1a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq -0xc(%rbp),%rax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_digits>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
add    $0xd0,%dl
xor    %eax,%eax
cmp    $0x9,%dl
ja     1131 <skip_digits+0x31>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rcx,%rax,1),%edx
add    $0xd0,%dl
add    $0x1,%rax
cmp    $0xa,%dl
jb     1120 <skip_digits+0x20>
mov    %eax,%edx
add    %rdx,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @skip_digits(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %14
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %2, %1 ]
%8 = phi i32 [ %9, %6 ], [ 0, %1 ]
%9 = add nuw nsw i32 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = add i8 %11, -48
%13 = icmp ult i8 %12, 10
br i1 %13, label %6, label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %9, %6 ]
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %2, i64 %16
store i8* %17, i8** %0
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void *get_XCrossingEvent_display(void *_p) {
  return (void *)((XCrossingEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XCrossingEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XCrossingEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ input();
int /*<<< orphan*/ non();
int /*<<< orphan*/ printf(char *);
main() {
  printf("\nCPU SCHEDULLING\n");
  printf("METODE SJF NON-PREEMPTIVE\n\n");
  input();
  non();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <input@plt>
mov    $0x0,%al
call   1050 <non@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0ACPU SCHEDULLING\0A\00"
@.str.1 = [28 x i8] c"METODE SJF NON-PREEMPTIVE\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @input()
%4 = call i32 (...) @non()
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\0ACPU SCHEDULLING\00"
@str.2 = [27 x i8] c"METODE SJF NON-PREEMPTIVE\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @input()
%4 = tail call i32 (...) @non()
ret i32 0
}
void format_pinpoint_message(msg, arg) const char *msg, arg[];
{
  char errmsg[2048];
  snprintf(errmsg, sizeof(errmsg), msg, arg);
  pinpoint_message(errmsg);
}


x86 assembly (clang, -O0):
<format_pinpoint_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x800,%esi
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1040 <pinpoint_message@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_pinpoint_message>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    $0x800,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <pinpoint_message@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @format_pinpoint_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 2048, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @pinpoint_message to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_pinpoint_message(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %4, i64 2048, i8* %0, i8* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @pinpoint_message to i32 (i8*, ...)*)(i8* %4)
ret void
}
void BN_FreeList(char **List, int C) {
  int i;
  for (i = 0; i < C; i++)
    free(List[i]);
  if (C != 0)
    free(List);
}


x86 assembly (clang, -O0):
<BN_FreeList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <BN_FreeList+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <BN_FreeList+0x16>
cmpl   $0x0,-0xc(%rbp)
je     1164 <BN_FreeList+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_FreeList>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
test   %esi,%esi
jle    1142 <BN_FreeList+0x32>
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <BN_FreeList+0x20>
test   %r14d,%r14d
je     1159 <BN_FreeList+0x49>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @BN_FreeList(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = icmp eq i32 %1, 0
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = bitcast i8** %0 to i8*
tail call void @free(i8* %15)
br label %16
16: ; preds = %14, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bounce_north();
void do_south(void) { bounce_north(); }


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

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

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

LLVM IR (-O2):
define void @do_south() {
%1 = tail call i32 (...) @bounce_north()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void cb(int p, int n, void *arg) {
  char c = '*';
  if (p == 0)
    c = '.';
  if (p == 1)
    c = '+';
  if (p == 2)
    c = '*';
  if (p == 3)
    c = '\n';
  printf("%c", c);
}


x86 assembly (clang, -O0):
<cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movb   $0x2a,-0x11(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <cb+0x24>
movb   $0x2e,-0x11(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1142 <cb+0x32>
movb   $0x2b,-0x11(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1150 <cb+0x40>
movb   $0x2a,-0x11(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    115e <cb+0x4e>
movb   $0xa,-0x11(%rbp)
lea    0xe9b(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb>:
test   %edi,%edi
sete   %al
shl    $0x2,%al
or     $0x2a,%al
cmp    $0x1,%edi
movzbl %al,%eax
mov    $0x2b,%ecx
cmovne %eax,%ecx
cmp    $0x2,%edi
mov    $0x2a,%eax
cmovne %ecx,%eax
cmp    $0x3,%edi
mov    $0xa,%ecx
cmovne %eax,%ecx
movzbl %cl,%esi
lea    0xeb8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @cb(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i8 42, i8* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i8 46, i8* %7
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 43, i8* %7
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 42, i8* %7
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 10, i8* %7
br label %23
23: ; preds = %22, %19
%24 = load i8, i8* %7
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %24)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @cb(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8 46, i8 42
%6 = icmp eq i32 %0, 1
%7 = select i1 %6, i8 43, i8 %5
%8 = icmp eq i32 %0, 2
%9 = select i1 %8, i8 42, i8 %7
%10 = icmp eq i32 %0, 3
%11 = select i1 %10, i8 10, i8 %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, j, c, len, num, temp, t, res;
  scanf("%d", &t);
  while (t--) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0x0,%eax
je     1148 <main+0x38>
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
double RFduino_temperature(int);
double GetTemp(int scale) { return RFduino_temperature(scale); }


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

x86 assembly (clang, -O2):
<GetTemp>:
jmp    1030 <RFduino_temperature@plt>

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

LLVM IR (-O2):
define double @GetTemp(i32 %0) {
%2 = tail call double @RFduino_temperature(i32 %0)
ret double %2
}
void foo78() {}


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

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

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

LLVM IR (-O2):
define void @foo78() {
ret void
}
/* Variables and functions */
float Activator_Sigmoid(float);
float Activator_DSigmoid(float Input) {
  return Activator_Sigmoid(Input) * (1.0f - Activator_Sigmoid(Input));
}


x86 assembly (clang, -O0):
<Activator_DSigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movaps %xmm0,%xmm2
movss  -0x8(%rbp),%xmm0
movss  0xeba(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Activator_DSigmoid>:
push   %rax
movss  %xmm0,(%rsp)
call   1030 <Activator_Sigmoid@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movss  0xecd(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Activator_DSigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @Activator_Sigmoid(float %3)
%5 = load float, float* %2
%6 = call float @Activator_Sigmoid(float %5)
%7 = fsub float 1.000000e+00, %6
%8 = fmul float %4, %7
ret float %8
}

LLVM IR (-O2):
define float @Activator_DSigmoid(float %0) {
%2 = tail call float @Activator_Sigmoid(float %0)
%3 = tail call float @Activator_Sigmoid(float %0)
%4 = fsub float 1.000000e+00, %3
%5 = fmul float %2, %4
ret float %5
}
/* Variables and functions */
size_t WSTRING_LENGTH(char *string) {
  size_t i = 0;
  while ('\0' != string[i++])
    ;
  return i;
}


x86 assembly (clang, -O0):
<WSTRING_LENGTH>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1136 <WSTRING_LENGTH+0x36>
jmp    1110 <WSTRING_LENGTH+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WSTRING_LENGTH>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <WSTRING_LENGTH+0x10>
ret

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

LLVM IR (-O2):
define i64 @WSTRING_LENGTH(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %4, %2 ]
%4 = add i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i64 %4
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ret = add(10, 20);
  printf("add returned: %d\n", ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"add returned: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int __syscall_getpriority(int, int);
int getpriority(int which, int who) {
  int r;
  r = __syscall_getpriority(which, who);
  if (r >= 0)
    r = 20 - r;
  return r;
}


x86 assembly (clang, -O0):
<getpriority>:
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 <__syscall_getpriority@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1141 <getpriority+0x31>
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
push   %rax
call   1030 <__syscall_getpriority@plt>
mov    $0x14,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getpriority(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 = load i32, i32* %4
%8 = call i32 @__syscall_getpriority(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = sub nsw i32 20, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @getpriority(i32 %0, i32 %1) {
%3 = tail call i32 @__syscall_getpriority(i32 %0, i32 %1)
%4 = icmp sgt i32 %3, -1
%5 = sub nsw i32 20, %3
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
int jep_is_symbol_char(char c) {
  switch (c) {
  case '+':
  case '-':
  case '*':
  case '/':
  case '<':
  case '>':
  case '!':
  case '=':
  case '.':
  case ',':
  case ';':
  case '(':
  case ')':
  case '{':
  case '}':
  case '[':
  case ']':
  case '&':
  case '|':
  case '^':
  case '%':
  case ':':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jep_is_symbol_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5c,%eax
ja     1140 <jep_is_symbol_char+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <jep_is_symbol_char+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jep_is_symbol_char>:
add    $0xffffffdf,%edi
cmp    $0x5c,%edi
ja     111e <jep_is_symbol_char+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jep_is_symbol_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
i32 60, label %6
i32 62, label %6
i32 33, label %6
i32 61, label %6
i32 46, label %6
i32 44, label %6
i32 59, label %6
i32 40, label %6
i32 41, label %6
i32 123, label %6
i32 125, label %6
i32 91, label %6
i32 93, label %6
i32 38, label %6
i32 124, label %6
i32 94, label %6
i32 37, label %6
i32 58, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @jep_is_symbol_char(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 43, label %4
i32 45, label %4
i32 42, label %4
i32 47, label %4
i32 60, label %4
i32 62, label %4
i32 33, label %4
i32 61, label %4
i32 46, label %4
i32 44, label %4
i32 59, label %4
i32 40, label %4
i32 41, label %4
i32 123, label %4
i32 125, label %4
i32 91, label %4
i32 93, label %4
i32 38, label %4
i32 124, label %4
i32 94, label %4
i32 37, label %4
i32 58, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int strlen(char *);
char *strDup(char *string) {
  char *newString;
  size_t len;
  assert(string != NULL);
  len = strlen(string) + 1;
  newString = (char *)malloc(len);
  memcpy(newString, string, len);
  return newString;
}


x86 assembly (clang, -O0):
<strDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
store i64 %12, i64* %4
%13 = load i64, i64* %4
%14 = call i64 @malloc(i64 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = load i8*, i8** %2
%18 = load i64, i64* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @strDup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = tail call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i64 %7)
ret i8* %9
}