xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ tok(char *);
int main() {
  char *test = "select * from mytable ; ";
  char *test2 = "select foo, bar ,baz from mytable ; ";
  tok(test);
  tok(test2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tok@plt>
mov    -0x18(%rbp),%rdi
call   1030 <tok@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"select * from mytable ; \00"
@.str.1 = [37 x i8] c"select foo, bar ,baz from mytable ; \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = call i32 @tok(i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @tok(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"select * from mytable ; \00"
@.str.1 = [37 x i8] c"select foo, bar ,baz from mytable ; \00"
define i32 @main() {
%1 = tail call i32 @tok(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @tok(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __isfinite(long double);
int __isfinitel(long double a1) { return __isfinite(a1); }


x86 assembly (clang, -O0):
<__isfinitel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__isfinite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isfinitel>:
jmp    1030 <__isfinite@plt>

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

LLVM IR (-O2):
define i32 @__isfinitel(x86_fp80 %0) {
%2 = tail call i32 @__isfinite(x86_fp80 %0)
ret i32 %2
}
int fun874() { return 874; }


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

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

LLVM IR (-O0):
define i32 @fun874() {
ret i32 874
}

LLVM IR (-O2):
define i32 @fun874() {
ret i32 874
}
/* Variables and functions */
int ptrace(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int ptraceKill(int pid) { return ptrace(8, pid, 0, 0); }


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

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

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

LLVM IR (-O2):
define i32 @ptraceKill(i32 %0) {
%2 = tail call i32 @ptrace(i32 8, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t p2floor(uint32_t x) {
  uint32_t y;
  while ((y = x & (x - 1)))
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<p2floor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1129 <p2floor+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <p2floor+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p2floor>:
mov    %edi,%eax
lea    -0x1(%rax),%edi
and    %eax,%edi
jne    1100 <p2floor>
ret

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

LLVM IR (-O2):
define i32 @p2floor(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = add nsw i32 %3, -1
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("input num : ");
  scanf("%d", &num);
  printf("Factorial : %d", factorial(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"input num : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Factorial : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"input num : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"Factorial : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldrh(int /*<<< orphan*/);
int /*<<< orphan*/ arm_memio_regdh_op();
void arm_ldrh_reg() { arm_memio_ldrh(arm_memio_regdh_op()); }


x86 assembly (clang, -O0):
<arm_ldrh_reg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_ldrh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrh_reg>:
push   %rax
xor    %eax,%eax
call   1040 <arm_memio_regdh_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_ldrh@plt>

LLVM IR (-O0):
define void @arm_ldrh_reg() {
%1 = call i32 (...) @arm_memio_regdh_op()
%2 = call i32 @arm_memio_ldrh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrh_reg() {
%1 = tail call i32 (...) @arm_memio_regdh_op()
%2 = tail call i32 @arm_memio_ldrh(i32 %1)
ret void
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_list_formats(struct XorrisO *, int /*<<< orphan*/);
int Xorriso_option_list_formats(struct XorrisO *xorriso, int flag) {
  int ret;
  ret = Xorriso_list_formats(xorriso, 0);
  return (ret);
}


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

x86 assembly (clang, -O2):
<Xorriso_option_list_formats>:
xor    %esi,%esi
jmp    1030 <Xorriso_list_formats@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_formats(%struct.XorrisO* %0, i32 %1) {
%3 = alloca %struct.XorrisO*
%4 = alloca i32
%5 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %3
store i32 %1, i32* %4
%6 = load %struct.XorrisO*, %struct.XorrisO** %3
%7 = call i32 @Xorriso_list_formats(%struct.XorrisO* %6, i32 0)
store i32 %7, i32* %5
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_formats(%struct.XorrisO* %0, i32 %1) {
%3 = tail call i32 @Xorriso_list_formats(%struct.XorrisO* %0, i32 0)
ret i32 %3
}
int main0() {
  int *arr2 = (int *)0x04000000;
  *(arr2) = 0;
  for (int i = 0; i <= 20; i++) {
    *(arr2) += i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jg     1141 <main0+0x41>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <main0+0x1e>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main0>:
movl   $0xd2,0x4000000
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main0() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 67108864 to i32*), i32** %1
%3 = load i32*, i32** %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 20
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main0() {
store i32 210, i32* inttoptr (i64 67108864 to i32*)
ret i32 0
}
int loop(int x) {
  if (x < 10) {
    return loop(x + 1);
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1138 <loop+0x28>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <loop@plt>
mov    %eax,-0x4(%rbp)
jmp    113e <loop+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
cmp    $0xb,%edi
mov    $0xa,%eax
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @loop(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 10)
ret i32 %2
}
/* Variables and functions */
scalar_t__ qe_inrange(int, char, char);
int qe_isalnum(int c) {
  return (qe_inrange(c, '0', '9') || qe_inrange(c | ('a' - 'A'), 'a', 'z'));
}


x86 assembly (clang, -O0):
<qe_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x30,%esi
mov    $0x39,%edx
call   1030 <qe_inrange@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    115e <qe_isalnum+0x4e>
mov    -0x4(%rbp),%edi
or     $0x20,%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <qe_inrange@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_isalnum>:
push   %rbx
mov    %edi,%ebx
mov    $0x30,%esi
mov    $0x39,%edx
call   1030 <qe_inrange@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1131 <qe_isalnum+0x21>
pop    %rbx
ret
or     $0x20,%ebx
mov    %ebx,%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <qe_inrange@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @qe_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @qe_inrange(i32 %3, i8 signext 48, i8 signext 57)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
%9 = call i64 @qe_inrange(i32 %8, i8 signext 97, i8 signext 122)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @qe_isalnum(i32 %0) {
%2 = tail call i64 @qe_inrange(i32 %0, i8 signext 48, i8 signext 57)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = or i32 %0, 32
%6 = tail call i64 @qe_inrange(i32 %5, i8 signext 97, i8 signext 122)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no, noclone)) int i_am_pure1(int a) {
  if (a > 50)
    abort();
  return a;
}


x86 assembly (clang, -O0):
<i_am_pure1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jle    112c <i_am_pure1+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_am_pure1>:
cmp    $0x33,%edi
jge    1118 <i_am_pure1+0x8>
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @i_am_pure1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 50
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @i_am_pure1(i32 returned %0) {
%2 = icmp sgt i32 %0, 50
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ vecNd_print_to_string(char *, int, double const *,
                                         int const);
void vecNd_print(const double v[], const int n) {
  char str[128];
  vecNd_print_to_string(str, 128, v, n);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<vecNd_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x80,%esi
call   1040 <vecNd_print_to_string@plt>
lea    -0x90(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNd_print>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <vecNd_print_to_string@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @vecNd_print(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca [128 x i8]
store double* %0, double** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load i32, i32* %4
%9 = call i32 @vecNd_print_to_string(i8* %6, i32 128, double* %7, i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @vecNd_print(double* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @vecNd_print_to_string(i8* %4, i32 128, double* %0, i32 %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int ispref(const char *s1, const char *s2) {
  while (*s1++ == *s2)
    continue;
  return *s1 == '\0';
}


x86 assembly (clang, -O0):
<ispref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1132 <ispref+0x32>
jmp    110c <ispref+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispref>:
mov    (%rsi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdi,%rcx
add    $0x1,%rdi
cmp    %al,(%rcx)
je     1110 <ispref+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ispref(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %6, %4 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, %3
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int zc_hashtable_str_equal(const void *key1, const void *key2) {
  return ((strcmp((const char *)key1, (const char *)key2) == 0));
}


x86 assembly (clang, -O0):
<zc_hashtable_str_equal>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @zc_hashtable_str_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @zc_hashtable_str_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *barebox_memalign(size_t alignment, size_t bytes) {
  return memalign(alignment, bytes);
}


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

x86 assembly (clang, -O2):
<barebox_memalign>:
jmp    1030 <memalign@plt>

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

LLVM IR (-O2):
define noalias i8* @barebox_memalign(i64 %0, i64 %1) {
%3 = tail call i8* @memalign(i64 %0, i64 %1)
ret i8* %3
}
unsigned short get_le16(const unsigned char *p) { return p[0] | p[1] << 8; }


x86 assembly (clang, -O0):
<get_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @get_le16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @get_le16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = or i16 %7, %3
ret i16 %8
}
int baz(int x) { return 0; }


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

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

LLVM IR (-O0):
define i32 @baz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @baz(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int f1() {
  int a = 1;
  printf("f1 %d\n", a);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"f1 %d\0A\00"
define i32 @f1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ RST(int, int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xef(void) {
  RST(0x28, 5, 8);
  T_WAIT_UNTIL(11);
  return;
}


x86 assembly (clang, -O0):
<op_0xef>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xef>:
push   %rax
mov    $0x28,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xef() {
%1 = call i32 @RST(i32 40, i32 5, i32 8)
%2 = call i32 @T_WAIT_UNTIL(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_0xef() {
%1 = tail call i32 @RST(i32 40, i32 5, i32 8)
%2 = tail call i32 @T_WAIT_UNTIL(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *, ...);
void syslog_msg(const char *file, int line, const char *func, int priority,
                const char *message, const char *appendix) {
  if (appendix)
    syslog(priority, "%s: %s\n", message, appendix);
  else
    syslog(priority, "%s\n", message);
}


x86 assembly (clang, -O0):
<syslog_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1157 <syslog_msg+0x47>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
jmp    116c <syslog_msg+0x5c>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rdx
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_msg>:
mov    %r8,%rdx
test   %r9,%r9
je     112b <syslog_msg+0x1b>
lea    0xee1(%rip),%rsi
mov    %ecx,%edi
mov    %r9,%rcx
xor    %eax,%eax
jmp    1030 <syslog@plt>
lea    0xed2(%rip),%rsi
mov    %ecx,%edi
xor    %eax,%eax
jmp    1030 <syslog@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @syslog_msg(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* %4, i8* %5) {
%7 = icmp eq i8* %5, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 (i32, i8*, i8*, ...) @syslog(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
br label %12
10: ; preds = %6
%11 = tail call i32 (i32, i8*, i8*, ...) @syslog(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %12
12: ; preds = %10, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ psignal(int, char *);
void handler(int sig) { psignal(sig, "SIGINT"); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <psignal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
lea    0xee9(%rip),%rsi
jmp    1030 <psignal@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SIGINT\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @psignal(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"SIGINT\00"
define void @handler(i32 %0) {
%2 = tail call i32 @psignal(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void UARTModemControlSet(unsigned long ulBase, unsigned long ulControl) {
  unsigned long ulTemp;
  ;
  ;
  ;
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000030)));
  ulTemp |= (ulControl & (0x00000800 | 0x00000400));
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ulTemp;
}


x86 assembly (clang, -O0):
<UARTModemControlSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xc00,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlSet>:
and    $0xc00,%esi
or     %rsi,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTModemControlSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 48
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = and i64 %10, 3072
%12 = load i64, i64* %5
%13 = or i64 %12, %11
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = load i64, i64* %3
%16 = add i64 %15, 48
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @UARTModemControlSet(i64 %0, i64 %1) {
%3 = add i64 %0, 48
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %1, 3072
%7 = or i64 %5, %6
store volatile i64 %7, i64* %4
ret void
}
int hash_int(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @hash_int(i32 returned %0) {
ret i32 %0
}
void foo564() {}


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

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

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

LLVM IR (-O2):
define void @foo564() {
ret void
}
int num(char a) { return a >= '0' && a <= '9'; }


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <num+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @num(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
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 @num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int isprint(int c) { return (c >= 0x20 && c <= 0x7E); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int create_socket(char *, int);
int main() {
  int sockfd = create_socket("127.0.0.1", 80);
  close(sockfd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x50,%esi
call   1040 <create_socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x50,%esi
call   1040 <create_socket@plt>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @create_socket(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @close(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main() {
%1 = tail call i32 @create_socket(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80)
%2 = tail call i32 @close(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void buscarRegistroPesquisa() {
  printf("Vamos buscar um registro de pesquisa.\n");
  system("pause");
}


x86 assembly (clang, -O0):
<buscarRegistroPesquisa>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<buscarRegistroPesquisa>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Vamos buscar um registro de pesquisa.\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @buscarRegistroPesquisa() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"pause\00"
@str = [38 x i8] c"Vamos buscar um registro de pesquisa.\00"
define void @buscarRegistroPesquisa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fm_validateclock(const unsigned char clock) { return (clock == 0xff); }


x86 assembly (clang, -O0):
<fm_validateclock>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_validateclock>:
xor    %eax,%eax
cmp    $0xff,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @fm_validateclock(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 255
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fm_validateclock(i8 zeroext %0) {
%2 = icmp eq i8 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Hello, World%s\n", "!!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, World%s\0A\00"
@.str.1 = [3 x i8] c"!!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, World%s\0A\00"
@.str.1 = [3 x i8] c"!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I don't get built. It makes me saaaaaad. :(\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"I don't get built. It makes me saaaaaad. :(\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"I don't get built. It makes me saaaaaad. :(\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int multi_line_if_conditional(a, b, c)
int a, b, c;
{
  if (a && b && c)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<multi_line_if_conditional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <multi_line_if_conditional+0x37>
cmpl   $0x0,-0xc(%rbp)
je     1137 <multi_line_if_conditional+0x37>
cmpl   $0x0,-0x10(%rbp)
je     1137 <multi_line_if_conditional+0x37>
movl   $0x0,-0x4(%rbp)
jmp    113e <multi_line_if_conditional+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multi_line_if_conditional>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
test   %edx,%edx
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @multi_line_if_conditional(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* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %4
br label %18
17: ; preds = %13, %10, %3
store i32 1, i32* %4
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @multi_line_if_conditional(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 0
%5 = icmp ne i32 %1, 0
%6 = and i1 %4, %5
%7 = icmp ne i32 %2, 0
%8 = and i1 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void unexplained_error() {
  printf("Error! Something unexpected happened!\n");
  printf("Fix the source code!");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Error! Something unexpected happened!\0A\00"
@.str.1 = [21 x i8] c"Fix the source code!\00"
define void @unexplained_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Fix the source code!\00"
@str = [38 x i8] c"Error! Something unexpected happened!\00"
define void @unexplained_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ factor();
int /*<<< orphan*/ match(char);
void divide() {
  match('/');
  factor();
  emitln("mov\t%eax,%ebx");
  emitln("pop\t%eax");
  emitln("xor\t%edx,%edx");
  emitln("div\t%ebx");
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <factor@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb3(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %rax
mov    $0x2f,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1050 <factor@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb9(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb8(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mov\09%eax,%ebx\00"
@.str.1 = [9 x i8] c"pop\09%eax\00"
@.str.2 = [14 x i8] c"xor\09%edx,%edx\00"
@.str.3 = [9 x i8] c"div\09%ebx\00"
define void @divide() {
%1 = call i32 @match(i8 signext 47)
%2 = call i32 (...) @factor()
%3 = call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mov\09%eax,%ebx\00"
@.str.1 = [9 x i8] c"pop\09%eax\00"
@.str.2 = [14 x i8] c"xor\09%edx,%edx\00"
@.str.3 = [9 x i8] c"div\09%ebx\00"
define void @divide() {
%1 = tail call i32 @match(i8 signext 47)
%2 = tail call i32 (...) @factor()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @emitln(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void clntraw_abort() {}


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

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

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

LLVM IR (-O2):
define void @clntraw_abort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bsW(int, unsigned int);
void bsPutUChar(unsigned char c) { bsW(8, (unsigned int)c); }


x86 assembly (clang, -O0):
<bsPutUChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
mov    $0x8,%edi
call   1030 <bsW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsPutUChar>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <bsW@plt>

LLVM IR (-O0):
define void @bsPutUChar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i32 @bsW(i32 8, i32 %4)
ret void
}

LLVM IR (-O2):
define void @bsPutUChar(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 @bsW(i32 8, i32 %2)
ret void
}
int *f(struct { int i, j; } * a) { return &(*a).j; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32* @f(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
ret i32* %4
}

LLVM IR (-O2):
%struct.anon = type { i32, i32 }
define i32* @f(%struct.anon* readnone %0) {
%2 = getelementptr inbounds %struct.anon, %struct.anon* %0, i64 0, i32 1
ret i32* %2
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ printf(char *);
void translate() {
  printf(_("Mutabor"
           " -- %s"));
}


x86 assembly (clang, -O0):
<translate>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Mutabor -- %s\00"
define void @translate() {
%1 = call i8* @_(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Mutabor -- %s\00"
define void @translate() {
%1 = tail call i8* @_(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ nw_readline(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void *pc(void *x) {
  char buf[2048];
  memset(buf, 0, 2048);
  nw_readline(buf, 2048, -1, NULL);
  printf("DATA RECEIVED: %s", buf);
  return (NULL);
}


x86 assembly (clang, -O0):
<pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1050 <memset@plt>
lea    -0x810(%rbp),%rdi
mov    $0x800,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <nw_readline@plt>
lea    -0x810(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    $0x800,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
call   1040 <nw_readline@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"DATA RECEIVED: %s\00"
define i8* @pc(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 2048)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = call i32 @nw_readline(i8* %6, i32 2048, i32 -1, i32* null)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i8* null
}

LLVM IR (-O2):
@.str = [18 x i8] c"DATA RECEIVED: %s\00"
define noalias i8* @pc(i8* nocapture readnone %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 2048)
%5 = call i32 @nw_readline(i8* %3, i32 2048, i32 -1, i32* null)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_errorcallbackfunc1(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_errorcallbackfunc1() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_errorcallbackfunc1() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
void init_f64(double *o) { *o = 0; }


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

x86 assembly (clang, -O2):
<init_f64>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @init_f64(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 0.000000e+00, double* %3
ret void
}

LLVM IR (-O2):
define void @init_f64(double* nocapture writeonly %0) {
store double 0.000000e+00, double* %0
ret void
}