xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, scalar_t__, scalar_t__);
int64_t addfn(int64_t x, int64_t y) {
  int64_t ret = x + y;
  printf("addfn %lu,%lu\n", x, y);
  return ret;
}


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

x86 assembly (clang, -O2):
<addfn>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    (%rdx,%rdi,1),%rbx
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"addfn %lu,%lu\0A\00"
define i64 @addfn(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 = load i64, i64* %4
%8 = add nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10)
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"addfn %lu,%lu\0A\00"
define i64 @addfn(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret i64 %3
}
int ft_recursive_factorial(int nb) {
  if ((nb < 0) || (nb > 12))
    return (0);
  if (nb == 0)
    return (1);
  if (nb > 0)
    return (nb * ft_recursive_factorial(nb - 1));
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_recursive_factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <ft_recursive_factorial+0x1f>
cmpl   $0xc,-0x8(%rbp)
jle    113b <ft_recursive_factorial+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1183 <ft_recursive_factorial+0x73>
cmpl   $0x0,-0x8(%rbp)
jne    1151 <ft_recursive_factorial+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1183 <ft_recursive_factorial+0x73>
cmpl   $0x0,-0x8(%rbp)
jle    117c <ft_recursive_factorial+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_recursive_factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <ft_recursive_factorial+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_recursive_factorial>:
xor    %eax,%eax
cmp    $0xc,%edi
ja     1134 <ft_recursive_factorial+0x34>
lea    -0xe(%rdi),%edx
mov    $0x1,%ecx
mov    $0x1,%eax
mov    %edi,%esi
cs nopw 0x0(%rax,%rax,1)
sub    $0x1,%esi
jb     1131 <ft_recursive_factorial+0x31>
imul   %edi,%eax
mov    %esi,%edi
cmp    $0xfffffff2,%edx
ja     1120 <ft_recursive_factorial+0x20>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_recursive_factorial(i32 %0) {
%2 = icmp ugt i32 %0, 12
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add i32 %0, -14
%5 = icmp ult i32 %4, -13
br label %6
6: ; preds = %3, %10
%7 = phi i32 [ %11, %10 ], [ %0, %3 ]
%8 = phi i32 [ %12, %10 ], [ 1, %3 ]
%9 = icmp eq i32 %7, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = add nsw i32 %7, -1
%12 = mul nsw i32 %7, %8
br i1 %5, label %13, label %6
13: ; preds = %6, %10
%14 = phi i32 [ %12, %10 ], [ %8, %6 ]
%15 = phi i32 [ 0, %10 ], [ 1, %6 ]
%16 = mul nuw nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (x < 0) {
    x = x + y;
    y--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1154 <main+0x44>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int test_imm_8Eint32_mem(int *val) {
  return ((*val) & (0x8E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Eint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 142
%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_8Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 142
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int a = 1, b = 0;
  if (!a)
    b++;
  else if (a == 0)
    if (a)
      b += 2;
    else
      b += 3;
  printf("%d\n", b);
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114c <main+0x3c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1181 <main+0x71>
cmpl   $0x0,-0x14(%rbp)
jne    117c <main+0x6c>
cmpl   $0x0,-0x14(%rbp)
je     116e <main+0x5e>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    1177 <main+0x67>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    117c <main+0x6c>
jmp    1181 <main+0x71>
mov    -0x18(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
void pregunta(int *p_numero, char *mensaje) {
  printf("%s ", mensaje);
  scanf("%d", p_numero);
}


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

x86 assembly (clang, -O2):
<pregunta>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [3 x i8] c"%d\00"
define void @pregunta(i32* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
void lib_ring_buffer_tick_nohz_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @lib_ring_buffer_tick_nohz_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_by_value_18_x();
int main() {
  struct_by_value_18_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <struct_by_value_18_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_by_value_18_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int aurora_l2_pm_exit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @aurora_l2_pm_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @aurora_l2_pm_exit() {
ret i32 0
}
unsigned long hash_djb2_l(const char *str) {
  unsigned long h = 5381;
  const char *p = str;
  while (*p != '\0')
    h = ((h << 5) + h) + (*p++);
  return h;
}


x86 assembly (clang, -O0):
<hash_djb2_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <hash_djb2_l+0x53>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <hash_djb2_l+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2_l>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_djb2_l+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_djb2_l+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_djb2_l(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = mul i64 %7, 33
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ test_heat_diffuse();
int main(int argc, char **argv) {
  test_heat_diffuse();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_heat_diffuse@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 (...) @test_heat_diffuse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_heat_diffuse()
ret i32 0
}
char LowerCase(const char c) {
  if (c >= 'A' && c <= 'Z') {
    return c - 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<LowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <LowerCase+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <LowerCase+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <LowerCase+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowerCase>:
lea    -0x41(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @LowerCase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @LowerCase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
struct list_cursor {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_cursor *cctools_list_cursor_create(struct list *);
int /*<<< orphan*/ cctools_list_cursor_destroy(struct list_cursor *);
int /*<<< orphan*/ cctools_list_insert(struct list_cursor *, void *);
int cctools_list_push_tail(struct list *l, void *item) {
  struct list_cursor *cur = cctools_list_cursor_create(l);
  cctools_list_insert(cur, item);
  cctools_list_cursor_destroy(cur);
  return 1;
}


x86 assembly (clang, -O0):
<cctools_list_push_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <cctools_list_cursor_create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cctools_list_insert@plt>
mov    -0x18(%rbp),%rdi
call   1040 <cctools_list_cursor_destroy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cctools_list_push_tail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <cctools_list_cursor_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <cctools_list_insert@plt>
mov    %rbx,%rdi
call   1040 <cctools_list_cursor_destroy@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_cursor = type { i32 }
define i32 @cctools_list_push_tail(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
%5 = alloca %struct.list_cursor*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
%6 = load %struct.list*, %struct.list** %3
%7 = call %struct.list_cursor* @cctools_list_cursor_create(%struct.list* %6)
store %struct.list_cursor* %7, %struct.list_cursor** %5
%8 = load %struct.list_cursor*, %struct.list_cursor** %5
%9 = load i8*, i8** %4
%10 = call i32 @cctools_list_insert(%struct.list_cursor* %8, i8* %9)
%11 = load %struct.list_cursor*, %struct.list_cursor** %5
%12 = call i32 @cctools_list_cursor_destroy(%struct.list_cursor* %11)
ret i32 1
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_cursor = type { i32 }
define i32 @cctools_list_push_tail(%struct.list* %0, i8* %1) {
%3 = tail call %struct.list_cursor* @cctools_list_cursor_create(%struct.list* %0)
%4 = tail call i32 @cctools_list_insert(%struct.list_cursor* %3, i8* %1)
%5 = tail call i32 @cctools_list_cursor_destroy(%struct.list_cursor* %3)
ret i32 1
}
char *strcpy(char *dest, char *source) {
  char *dp = dest;
  for (; *source; source++, dest++) {
    *dest = source;
  }
  *dest = '\0';
  return dp;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strcpy+0x4a>
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
cmpb   $0x0,(%rsi)
mov    %rdi,%rcx
je     1134 <strcpy+0x34>
lea    0x1(%rsi),%rdx
mov    %rax,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %sil,(%rcx)
add    $0x1,%rcx
add    $0x1,%sil
cmpb   $0x0,(%rdx)
lea    0x1(%rdx),%rdx
jne    1120 <strcpy+0x20>
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ %0, %2 ], [ %11, %5 ]
store i8 0, i8* %15
ret i8* %0
}
/* Type definitions */
struct word_at_a_time {
  int dummy;
};

/* Variables and functions */
unsigned long __insn_seqib(unsigned long, int /*<<< orphan*/);
unsigned long has_zero(unsigned long val, unsigned long *data,
                       const struct word_at_a_time *c) {
  unsigned long mask = __insn_seqib(val, 0);
  *data = mask;
  return mask;
}


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

x86 assembly (clang, -O2):
<has_zero>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1030 <__insn_seqib@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.word_at_a_time = type { i32 }
define i64 @has_zero(i64 %0, i64* %1, %struct.word_at_a_time* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca %struct.word_at_a_time*
%7 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store %struct.word_at_a_time* %2, %struct.word_at_a_time** %6
%8 = load i64, i64* %4
%9 = call i64 @__insn_seqib(i64 %8, i32 0)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i64*, i64** %5
store i64 %10, i64* %11
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
%struct.word_at_a_time = type { i32 }
define i64 @has_zero(i64 %0, i64* nocapture writeonly %1, %struct.word_at_a_time* nocapture readnone %2) {
%4 = tail call i64 @__insn_seqib(i64 %0, i32 0)
store i64 %4, i64* %1
ret i64 %4
}
/* Variables and functions */
unsigned long hash_djb2(unsigned char const *);
unsigned long int key_index(const unsigned char *key, unsigned long int size) {
  unsigned long int bucket;
  unsigned long int index;
  bucket = hash_djb2(key);
  index = bucket % size;
  return (index);
}


x86 assembly (clang, -O0):
<key_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_djb2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_index>:
push   %rbx
mov    %rsi,%rbx
call   1030 <hash_djb2@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     112f <key_index+0x1f>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @key_index(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @hash_djb2(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = urem i64 %9, %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
ret i64 %12
}

LLVM IR (-O2):
define i64 @key_index(i8* %0, i64 %1) {
%3 = tail call i64 @hash_djb2(i8* %0)
%4 = urem i64 %3, %1
ret i64 %4
}
void freetabuleiro(char ***tab) {
  if (!tab)
    return;
  free(tab[0][0]);
  free(tab[0]);
  free(tab);
}


x86 assembly (clang, -O0):
<freetabuleiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <freetabuleiro+0x1c>
jmp    1150 <freetabuleiro+0x40>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
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):
<freetabuleiro>:
test   %rdi,%rdi
je     1135 <freetabuleiro+0x25>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freetabuleiro(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = icmp ne i8*** %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %18
6: ; preds = %1
%7 = load i8***, i8**** %2
%8 = getelementptr inbounds i8**, i8*** %7, i64 0
%9 = load i8**, i8*** %8
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8***, i8**** %2
%13 = getelementptr inbounds i8**, i8*** %12, i64 0
%14 = load i8**, i8*** %13
%15 = bitcast i8** %14 to i8*
%16 = load i8***, i8**** %2
%17 = bitcast i8*** %16 to i8*
br label %18
18: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @freetabuleiro(i8*** %0) {
%2 = icmp eq i8*** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8**, i8*** %0
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i8*** %0 to i8**
%7 = load i8*, i8** %6
tail call void @free(i8* %7)
%8 = bitcast i8*** %0 to i8*
tail call void @free(i8* %8)
br label %9
9: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vec_elim(void *, size_t, int, size_t);
void vec_delete(void *vecp, size_t which, size_t size) {
  vec_elim(vecp, which, 1, size);
}


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

x86 assembly (clang, -O2):
<vec_delete>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <vec_elim@plt>

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

LLVM IR (-O2):
define void @vec_delete(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @vec_elim(i8* %0, i64 %1, i32 1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void movsx_reg32_m16(int reg32, unsigned short *m16) {
  put8(0x0F);
  put8(0xBF);
  put8((reg32 << 3) | 5);
  put32((unsigned long)(m16));
}


x86 assembly (clang, -O0):
<movsx_reg32_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_m16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @movsx_reg32_m16(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
store i16* %1, i16** %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 191)
%7 = load i32, i32* %3
%8 = shl i32 %7, 3
%9 = or i32 %8, 5
%10 = call i32 @put8(i32 %9)
%11 = load i16*, i16** %4
%12 = ptrtoint i16* %11 to i64
%13 = call i32 @put32(i64 %12)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_m16(i32 %0, i16* %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 191)
%5 = shl i32 %0, 3
%6 = or i32 %5, 5
%7 = tail call i32 @put8(i32 %6)
%8 = ptrtoint i16* %1 to i64
%9 = tail call i32 @put32(i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void clrtoeos(void) {
  write(1,
        "\x1b"
        "J",
        2);
}


x86 assembly (clang, -O0):
<clrtoeos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrtoeos>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1BJ\00"
define void @clrtoeos() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1BJ\00"
define void @clrtoeos() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
void tick_resume_oneshot(void) { BUG(); }


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

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

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

LLVM IR (-O2):
define void @tick_resume_oneshot() {
%1 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isnanf(float const);
int isrealf(const float x) { return !isnanf(x); }


x86 assembly (clang, -O0):
<isrealf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isrealf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @isnanf(float %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isrealf(float %0) {
%2 = tail call i32 @isnanf(float %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void append_fizz_to_char_buffer(char *buffer) { sprintf(buffer, "fizz"); }


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

x86 assembly (clang, -O2):
<append_fizz_to_char_buffer>:
movb   $0x0,0x4(%rdi)
movl   $0x7a7a6966,(%rdi)
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fizz\00"
define void @append_fizz_to_char_buffer(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 5, i1 false)
ret void
}
int test_imm_65int8_reg(signed char val) {
  return ((val) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_65int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 101
%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_65int8_reg(i8 signext %0) {
%2 = and i8 %0, 101
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void xor_reg32_imm32(int reg32, unsigned int imm32) {
  put8(0x81);
  put8(0xF0 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<xor_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xf0,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xf0,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @xor_reg32_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = load i32, i32* %3
%7 = add nsw i32 240, %6
%8 = call i32 @put8(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @put32(i32 %9)
ret void
}

LLVM IR (-O2):
define void @xor_reg32_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = add nsw i32 %0, 240
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void ok_syntax1_error(int regs[26], int *base, const char *s) {
  ((void)(regs));
  ((void)(base));
  fprintf(stderr, "%s\n", s);
}


x86 assembly (clang, -O0):
<ok_syntax1_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok_syntax1_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ok_syntax1_error(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
regx0adr1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[x0]) <= (*((signed char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    $0xa98ac7,%ecx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <regx0adr1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <regx0adr1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adr1>:
movslq %edx,%rax
mov    (%r8,%rax,1),%cl
xor    %eax,%eax
cmp    0xa98ac7,%cl
setle  %al
ret

LLVM IR (-O0):
define i32 @regx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = load i32, i32* %10
%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* inttoptr (i64 11111111 to i8*)
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @regx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = load i8, i8* %8
%10 = load i8, i8* inttoptr (i64 11111111 to i8*)
%11 = icmp sle i8 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t __REVSH(int32_t value) {
  uint32_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__REVSH(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char *util_file_search(char *, char *, char *);
char *util_path_search(char *prog) {
  return util_file_search(prog, ((char *)0), (char *)"x");
}


x86 assembly (clang, -O0):
<util_path_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xed5(%rip),%rdx
call   1030 <util_file_search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_path_search>:
lea    0xee9(%rip),%rdx
xor    %esi,%esi
jmp    1030 <util_file_search@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
define i8* @util_path_search(i8* %0) {
%2 = tail call i8* @util_file_search(i8* %0, i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int VbExLegacy(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @VbExLegacy() {
ret i32 1
}

LLVM IR (-O2):
define i32 @VbExLegacy() {
ret i32 1
}
/* Variables and functions */
long f();
long main() {
  long g;
  g = f();
}


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @f()
store i64 %3, i64* %2
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i64 (...) @f()
ret i64 undef
}
int ld_bun_rr2(long double a1, long double a2) {
  return !(__builtin_isunordered(a1, a2));
}


x86 assembly (clang, -O0):
<ld_bun_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_rr2>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
ret

LLVM IR (-O0):
define i32 @ld_bun_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp uno x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_bun_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ord x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int foo(int i) { return __builtin_abs(i) >= 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 %4, i32 %3
%7 = icmp sge i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 1
}
/* Variables and functions */
double M_PI;
double malPi(double in) { return in * M_PI; }


x86 assembly (clang, -O0):
<malPi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<malPi>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @malPi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @malPi(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ experiment();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  while (n-- > 0)
    experiment();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115f <main+0x3f>
mov    $0x0,%al
call   1030 <experiment@plt>
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    1158 <main+0x38>
xor    %eax,%eax
call   1030 <experiment@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (...) @experiment()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp sgt i32 %9, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateRTCEnable(void) {
  (*((volatile unsigned long *)(0x400FC010))) |= 0x00000001;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCEnable>:
orq    $0x1,0x400fc010
40 01
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __SOCKADDR_ARG;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getpeername(int fd, __SOCKADDR_ARG addr, socklen_t *len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpeername>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @getpeername(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}