xunge/DecIR huggingface dataset:
/* Variables and functions */
int a1();
int a2();
int b1();
int b2();
int main(void) { return 0 + a1() + a2() + b1() + b2(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <a1@plt>
add    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <a2@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <b1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <b2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <a1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <a2@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1060 <b1@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <b2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a1()
%3 = add nsw i32 0, %2
%4 = call i32 (...) @a2()
%5 = add nsw i32 %3, %4
%6 = call i32 (...) @b1()
%7 = add nsw i32 %5, %6
%8 = call i32 (...) @b2()
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a1()
%2 = tail call i32 (...) @a2()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @b1()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @b2()
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int safe_atollu(char const *, unsigned long long *);
int safe_atolu(const char *s, unsigned long *ret_u) {
  return safe_atollu(s, (unsigned long long *)ret_u);
}


x86 assembly (clang, -O0):
<safe_atolu>:
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 <safe_atollu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atolu>:
jmp    1030 <safe_atollu@plt>

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

LLVM IR (-O2):
define i32 @safe_atolu(i8* %0, i64* %1) {
%3 = tail call i32 @safe_atollu(i8* %0, i64* %1)
ret i32 %3
}
__attribute__((always_)) char *xstrdup(const char *s) {
  char *ptr = strdup(s);
  if (ptr == ((void *)0))
    handle_memerr();
  return ptr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <handle_memerr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <handle_memerr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @handle_memerr()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @handle_memerr()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void gtk_tree_view_set_search_equal_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_search_equal_func() {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int c, i = 0;
  while (c != 10) {
    c = getchar();
    ++i;
  }
  printf("El total de caracteres es: %i\n", i - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1151 <main+0x31>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"El total de caracteres es: %i\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @getchar()
store i32 %7, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"El total de caracteres es: %i\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ %4, %1 ], [ 0, %0 ]
%3 = tail call i32 (...) @getchar()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %3, 10
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int arr(int i) {
  int array[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  return array[i];
}


x86 assembly (clang, -O0):
<arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@__const.arr.array = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @arr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [10 x i32], [10 x i32]* @__const.arr.array, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
int string_search(char c, char *string) {
  int n = 0;
  int i;
  for (i = 0; string[i] != 0; i++) {
    if (string[i] == c) {
      n++;
    }
  }
  return n;
}


x86 assembly (clang, -O0):
<string_search>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <string_search+0x65>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <string_search+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <string_search+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <string_search+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_search>:
mov    (%rsi),%cl
test   %cl,%cl
je     1126 <string_search+0x26>
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %dil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <string_search+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_search(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: mailcheck [-hs] [-f rcfile]\n"
         "\n"
         "Options:\n"
         "  -s  - show \"no mail\" summary, if no new mail was found\n"
         "  -f  - specify alternative rcfile location\n"
         "  -h  - show this help screen\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [178 x i8] c"Usage: mailcheck [-hs] [-f rcfile]\0A\0AOptions:\0A -s - show \22no mail\22 summary, if no new mail was found\0A -f - specify alternative rcfile location\0A -h - show this help screen\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [177 x i8] c"Usage: mailcheck [-hs] [-f rcfile]\0A\0AOptions:\0A -s - show \22no mail\22 summary, if no new mail was found\0A -f - specify alternative rcfile location\0A -h - show this help screen\0A\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
ret void
}
int s_regex(int res, int s, int regex) {}


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

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

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

LLVM IR (-O2):
define i32 @s_regex(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int suma(int, int);
int main(int argc, char *argv[]) {
  int num;
  int result = suma(num, 5);
  int result2 = suma(result, 2);
  return result2;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%esi
call   1030 <suma@plt>
mov    %eax,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <suma@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @suma(i32 %9, i32 5)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @suma(i32 %11, i32 2)
store i32 %12, i32* %8
%13 = load i32, i32* %8
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @suma(i32 undef, i32 5)
%4 = tail call i32 @suma(i32 %3, i32 2)
ret i32 %4
}
int do_281() { return 281; }


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

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

LLVM IR (-O0):
define i32 @do_281() {
ret i32 281
}

LLVM IR (-O2):
define i32 @do_281() {
ret i32 281
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *argv0) {
  printf("Usage: %s <src_eid> <dst_eid>\n", argv0);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s <src_eid> <dst_eid>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s <src_eid> <dst_eid>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void caller_2_1_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_2_2_1_2() {
ret void
}
int test_imm_9Fint16_mem(short *val) {
  return ((*val) & (0x9F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Fint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Fint16_mem>:
testb  $0x9f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 159
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_9Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 159
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
long sysconf(int /*<<< orphan*/);
int main(int argc, char **argv) {
  long result = sysconf(strtol(argv[1], NULL, 0));
  if (result != -1)
    return result;
  else
    return -errno;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%edi
call   1040 <sysconf@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
je     116b <main+0x4b>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1179 <main+0x59>
xor    %eax,%eax
mov    0x2e6c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%edi
call   1040 <sysconf@plt>
mov    0x2ea2(%rip),%rcx
sub    (%rcx),%ebx
cmp    $0xffffffffffffffff,%rax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strtol(i8* %9, i32* null, i32 0)
%11 = call i64 @sysconf(i32 %10)
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = icmp ne i64 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i64, i64* %6
%16 = trunc i64 %15 to i32
store i32 %16, i32* %3
br label %20
17: ; preds = %2
%18 = load i32, i32* @errno
%19 = sub nsw i32 0, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtol(i8* nocapture %4, i32* null, i32 0)
%6 = tail call i64 @sysconf(i32 %5)
%7 = icmp eq i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
%11 = select i1 %7, i32 %10, i32 %8
ret i32 %11
}
void free_2d_int(int **p) {
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free_2d_int>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_int(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = load i32**, i32*** %2
%8 = bitcast i32** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_int(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
char *skipspace(char *str) {
  while (str[0] == ' ')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <skipspace+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipspace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <skipspace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
async_release() {
  printf("Your system does not support async I/O\n");
  exit(173);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Your system does not support async I/O\0A\00"
define i32 @async_release() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 173)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Your system does not support async I/O\00"
define i32 @async_release() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 173)
unreachable
}
void sg_error_destroy_comp(void) {}


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

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

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

LLVM IR (-O2):
define void @sg_error_destroy_comp() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int flags;
};
typedef TYPE_1__ ASN1_STRING_TABLE;

/* Variables and functions */
int STABLE_FLAGS_MALLOC;
int /*<<< orphan*/ free(TYPE_1__ *);
void st_free(ASN1_STRING_TABLE *tbl) {
  if (tbl->flags & STABLE_FLAGS_MALLOC)
    free(tbl);
}


x86 assembly (clang, -O0):
<st_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     113d <st_free+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_free>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rdi)
je     1122 <st_free+0x12>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
@STABLE_FLAGS_MALLOC = global i32 0
define void @st_free(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @STABLE_FLAGS_MALLOC
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%11 = call i32 @free(%struct.TYPE_4__* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
@STABLE_FLAGS_MALLOC = global i32 0
define void @st_free(%struct.TYPE_4__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @STABLE_FLAGS_MALLOC
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @free(%struct.TYPE_4__* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int EAST_CD_4(int in) {
  FILE *fin = fopen("func_header.h.ecov", "a");
  if (fin) {
    fprintf(fin, "CD4:%d\n", in);
  }
  fclose(fin);
  return in;
}


x86 assembly (clang, -O0):
<EAST_CD_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <EAST_CD_4+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EAST_CD_4>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <EAST_CD_4+0x31>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD4:%d\0A\00"
define i32 @EAST_CD_4(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD4:%d\0A\00"
define i32 @EAST_CD_4(i32 returned %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret i32 %0
}
void func2() {
  for (int i = 0; i < 10; ++i) {
    if (i > 2) {
      return;
    }
    if (i == 3) {
      int j = 1;
    } else {
      int j = 2;
    }
  }
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1154 <func2+0x54>
cmpl   $0x2,-0x4(%rbp)
jle    1124 <func2+0x24>
jmp    1154 <func2+0x54>
cmpl   $0x3,-0x4(%rbp)
jne    113a <func2+0x3a>
movl   $0x1,-0x8(%rbp)
jmp    1141 <func2+0x41>
movl   $0x2,-0xc(%rbp)
jmp    1146 <func2+0x46>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <func2+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(int, int /*<<< orphan*/);
void main() {
  int a = 5;
  call(a, a++);
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x5,%esi
jmp    1030 <call@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @call(i32 %2, i32 %3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @call(i32 5, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_16_bit_crc_tab(int);
int main(int ac, char **av) {
  make_16_bit_crc_tab(0x10811L);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @make_16_bit_crc_tab(i32 67601)
ret i32 0
}
int cmx_shm_unpack_index(const int value_handle) {
  return 0xffff & value_handle;
}


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

x86 assembly (clang, -O2):
<cmx_shm_unpack_index>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @cmx_shm_unpack_index(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
g() { return 3; }


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 3
}
void pcp_def_swap_metrics(void) {}


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

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

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

LLVM IR (-O2):
define void @pcp_def_swap_metrics() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usage_msg(char *);
void check_cpubind(int flag) {
  if (flag)
    usage_msg("cannot do --cpubind on shared memory\n");
}


x86 assembly (clang, -O0):
<check_cpubind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1131 <check_cpubind+0x21>
lea    0xed4(%rip),%rdi
call   1030 <usage_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_cpubind>:
test   %edi,%edi
je     1120 <check_cpubind+0x10>
lea    0xee5(%rip),%rdi
jmp    1030 <usage_msg@plt>
ret

LLVM IR (-O0):
@.str = [38 x i8] c"cannot do --cpubind on shared memory\0A\00"
define void @check_cpubind(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @usage_msg(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"cannot do --cpubind on shared memory\0A\00"
define void @check_cpubind(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @usage_msg(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int VIM_HIF_GetReg8(int);
unsigned char VIM_JPEG_CheckDecodeOK(void) {
  return ((VIM_HIF_GetReg8((0x0000 + 0x002)) >> 1) & 1);
}


x86 assembly (clang, -O0):
<VIM_JPEG_CheckDecodeOK>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <VIM_HIF_GetReg8@plt>
sar    $0x1,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_CheckDecodeOK>:
push   %rax
mov    $0x2,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shr    %al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @VIM_JPEG_CheckDecodeOK() {
%1 = call i32 @VIM_HIF_GetReg8(i32 2)
%2 = ashr i32 %1, 1
%3 = and i32 %2, 1
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @VIM_JPEG_CheckDecodeOK() {
%1 = tail call i32 @VIM_HIF_GetReg8(i32 2)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
ret i8 %4
}
unsigned int is_lower(unsigned char ch) { return (('a' <= ch) && (ch <= 'z')); }


x86 assembly (clang, -O0):
<is_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <is_lower+0x2d>
movzbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_lower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_lower(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
char *langDbgDevKanji12() { return "Kanji 12"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Kanji 12\00"
define i8* @langDbgDevKanji12() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int test_imm_0Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Dint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Dint64_lowword_mem>:
testb  $0xd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Dint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 13
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_0Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int Info_Decode(char const *, char *, int);
char *Info_ValueForKey(char const *, char const *);
int BigInfo_DecodedValueForKey(const char *s, const char *key, char *out,
                               int outbuflen) {
  const char *value;
  value = Info_ValueForKey(s, key);
  return Info_Decode(value, out, outbuflen);
}


x86 assembly (clang, -O0):
<BigInfo_DecodedValueForKey>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Info_ValueForKey@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <Info_Decode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigInfo_DecodedValueForKey>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1030 <Info_ValueForKey@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Info_Decode@plt>

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

LLVM IR (-O2):
define i32 @BigInfo_DecodedValueForKey(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @Info_ValueForKey(i8* %0, i8* %1)
%6 = tail call i32 @Info_Decode(i8* %5, i8* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int request_run(void *);
int _run_request(void *data, int retcode) { return request_run(data); }


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

x86 assembly (clang, -O2):
<_run_request>:
jmp    1030 <request_run@plt>

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

LLVM IR (-O2):
define i32 @_run_request(i8* %0, i32 %1) {
%3 = tail call i32 @request_run(i8* %0)
ret i32 %3
}
int test_imm_2Euint16_reg(unsigned short val) {
  return ((val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Euint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Euint16_reg>:
test   $0x2e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Euint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 46
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_2Euint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 46
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ left_encoder_reset();
int /*<<< orphan*/ right_encoder_reset();
extern void encoders_reset(void) {
  left_encoder_reset();
  right_encoder_reset();
}


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

x86 assembly (clang, -O2):
<encoders_reset>:
push   %rax
xor    %eax,%eax
call   1040 <left_encoder_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <right_encoder_reset@plt>

LLVM IR (-O0):
define void @encoders_reset() {
%1 = call i32 (...) @left_encoder_reset()
%2 = call i32 (...) @right_encoder_reset()
ret void
}

LLVM IR (-O2):
define void @encoders_reset() {
%1 = tail call i32 (...) @left_encoder_reset()
%2 = tail call i32 (...) @right_encoder_reset()
ret void
}
void foo241() {}


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

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

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

LLVM IR (-O2):
define void @foo241() {
ret void
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u4() { return (rand() & 0xf); }


x86 assembly (clang, -O0):
<mk_rnd_u4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u4>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0xf,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u4() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 15
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u4() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 15
ret i8 %3
}
void dl_F3DEX_MOVEMEM() {}


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

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

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

LLVM IR (-O2):
define void @dl_F3DEX_MOVEMEM() {
ret void
}
int do_064() { return 64; }


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

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

LLVM IR (-O0):
define i32 @do_064() {
ret i32 64
}

LLVM IR (-O2):
define i32 @do_064() {
ret i32 64
}
unsigned char f71(unsigned char x, int y) {
  return (x << y) + (x >> ((-y) & (8 - 1)));
}


x86 assembly (clang, -O0):
<f71>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f71>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f71(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = and i32 %12, 7
%14 = ashr i32 %10, %13
%15 = add nsw i32 %8, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @f71(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 7
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
int gcd(int a, int b) {
  if (a <= 0 || b <= 0)
    return 1;
  while (a != b) {
    if (b > a)
      b = b - a;
    else {
      int tmp = a;
      a = b;
      b = tmp;
    }
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111e <gcd+0x1e>
cmpl   $0x0,-0xc(%rbp)
jg     112a <gcd+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1172 <gcd+0x72>
jmp    112f <gcd+0x2f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     116c <gcd+0x6c>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1155 <gcd+0x55>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1167 <gcd+0x67>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112f <gcd+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    $0x1,%eax
test   %edi,%edi
jle    1132 <gcd+0x32>
test   %esi,%esi
jle    1132 <gcd+0x32>
cmp    %edi,%esi
jne    1114 <gcd+0x14>
mov    %edi,%eax
ret
mov    %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
sub    %edi,%ecx
mov    %esi,%eax
cmovg  %edi,%eax
cmovle %edi,%ecx
mov    %ecx,%esi
mov    %eax,%edi
cmp    %eax,%ecx
jne    1120 <gcd+0x20>
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %2
%7 = icmp eq i32 %1, %0
br i1 %7, label %16, label %8
8: ; preds = %6, %8
%9 = phi i32 [ %14, %8 ], [ %1, %6 ]
%10 = phi i32 [ %13, %8 ], [ %0, %6 ]
%11 = icmp sgt i32 %9, %10
%12 = sub nsw i32 %9, %10
%13 = select i1 %11, i32 %10, i32 %9
%14 = select i1 %11, i32 %12, i32 %10
%15 = icmp eq i32 %14, %13
br i1 %15, label %16, label %8
16: ; preds = %8, %6, %2
%17 = phi i32 [ 1, %2 ], [ %0, %6 ], [ %13, %8 ]
ret i32 %17
}
char *corta_string(char *apuntador) {
  int len;
  for (len = 0; *(apuntador + len) != ' '; ++len) {
  }
  if (len > 0) {
    apuntador = apuntador + len;
    return apuntador;
  } else {
    return "Error!!!";
  }
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     1137 <corta_string+0x37>
jmp    1129 <corta_string+0x29>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <corta_string+0xf>
cmpl   $0x0,-0x14(%rbp)
jle    115d <corta_string+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <corta_string+0x68>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <corta_string+0x10>
mov    %eax,%ecx
add    %rcx,%rdi
test   %eax,%eax
lea    0xed7(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Error!!!\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %17
13: ; preds = %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8* %24, i8** %3
%25 = load i8*, i8** %3
store i8* %25, i8** %2
br label %27
26: ; preds = %17
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %27
27: ; preds = %26, %20
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
@.str = [9 x i8] c"Error!!!\00"
define i8* @corta_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = and i64 %3, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = icmp eq i32 %9, 0
%13 = select i1 %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11
ret i8* %13
}