xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ swap_le64(void *, void *);
void swap_le64_num(void *s, void *d, int n) {
  int i;
  for (i = 0; i < n; i++, s += 64 / 8, d += 64 / 8)
    swap_le64(s, d);
}


x86 assembly (clang, -O0):
<swap_le64_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <swap_le64_num+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap_le64@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <swap_le64_num+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_le64_num>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1149 <swap_le64_num+0x39>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <swap_le64@plt>
add    $0x8,%rbp
add    $0x8,%rbx
add    $0xffffffff,%r14d
jne    1130 <swap_le64_num+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swap_le64_num(i8* %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ 0, %3 ]
%7 = phi i8* [ %11, %5 ], [ %0, %3 ]
%8 = phi i8* [ %12, %5 ], [ %1, %3 ]
%9 = tail call i32 @swap_le64(i8* %7, i8* %8)
%10 = add nuw nsw i32 %6, 1
%11 = getelementptr i8, i8* %7, i64 8
%12 = getelementptr i8, i8* %8, i64 8
%13 = icmp eq i32 %10, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
long IS_ERR(unsigned long x) { return ((x) >= (unsigned long)-4095); }


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xfffffffffffff001,-0x8(%rbp)
ff
setae  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR>:
xor    %eax,%eax
cmp    $0xfffffffffffff001,%rdi
setae  %al
ret

LLVM IR (-O0):
define i64 @IS_ERR(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, -4095
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @IS_ERR(i64 %0) {
%2 = icmp ugt i64 %0, -4096
%3 = zext i1 %2 to i64
ret i64 %3
}
void add_ptr_func(int *a) { (*a)++; }


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

x86 assembly (clang, -O2):
<add_ptr_func>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @add_ptr_func(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int print(int /*<<< orphan*/, int *);
int my_printf(const char *format, ...) {
  register int *varg = (int *)(&format);
  return print(0, varg);
}


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

x86 assembly (clang, -O2):
<my_printf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <print@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @my_printf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i32*
%4 = call i32 @print(i32 0, i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int xxxxx() {
  int i = 0;
  volatile unsigned long *gpmcon = (volatile unsigned long *)0x7F008820;
  volatile unsigned long *gpmdat = (volatile unsigned long *)0x7F008824;
  *gpmcon = 0x1111;
  while (1) {
    *gpmdat = i;
    i++;
    if (i == 16)
      i = 0;
    delay();
  }
  return 0;
}


x86 assembly (clang, -O0):
<xxxxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7f008820,%eax
mov    %rax,-0x10(%rbp)
mov    $0x7f008824,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1111,(%rax)
movslq -0x4(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jne    1161 <xxxxx+0x51>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <delay@plt>
jmp    113c <xxxxx+0x2c>

x86 assembly (clang, -O2):
<xxxxx>:
push   %rbp
push   %rbx
push   %rax
movq   $0x1111,0x7f008820
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %ebx,%rbx
mov    %rbx,0x7f008824
7f
add    $0x1,%ebx
cmp    $0x10,%ebx
cmove  %ebp,%ebx
xor    %eax,%eax
call   1030 <delay@plt>
jmp    1130 <xxxxx+0x20>

LLVM IR (-O0):
define i32 @xxxxx() {
%1 = alloca i32
%2 = alloca i64*
%3 = alloca i64*
store i32 0, i32* %1
store i64* inttoptr (i64 2130741280 to i64*), i64** %2
store i64* inttoptr (i64 2130741284 to i64*), i64** %3
%4 = load i64*, i64** %2
store volatile i64 4369, i64* %4
br label %5
5: ; preds = %0, %14
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
store volatile i64 %7, i64* %8
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 16
br i1 %12, label %13, label %14
13: ; preds = %5
store i32 0, i32* %1
br label %14
14: ; preds = %13, %5
%15 = call i32 (...) @delay()
br label %5
}

LLVM IR (-O2):
define i32 @xxxxx() {
store volatile i64 4369, i64* inttoptr (i64 2130741280 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 2130741284 to i64*)
%4 = add nsw i32 %2, 1
%5 = icmp eq i32 %4, 16
%6 = select i1 %5, i32 0, i32 %4
%7 = tail call i32 (...) @delay()
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
char *DisplayString(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int io_error_handler(Display *display) {
  fprintf(stderr, "[an i/o error occurred on display %s]\n",
          DisplayString(display));
  return 0;
}


x86 assembly (clang, -O0):
<io_error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <DisplayString@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_error_handler>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <DisplayString@plt>
lea    0xeca(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"[an i/o error occurred on display %s]\0A\00"
define i32 @io_error_handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stderr
%4 = load i32*, i32** %2
%5 = call i8* @DisplayString(i32* %4)
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"[an i/o error occurred on display %s]\0A\00"
define i32 @io_error_handler(i32* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @DisplayString(i32* %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MurmurHash3_x86_32(void const *, int, int, unsigned int *);
unsigned long murmurhash(const void *data, int len) {
  unsigned int hash[1];
  MurmurHash3_x86_32(data, len, 0x1337, hash);
  return hash[0];
}


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

x86 assembly (clang, -O2):
<murmurhash>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x1337,%edx
call   1030 <MurmurHash3_x86_32@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @murmurhash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1 x i32]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%9 = call i32 @MurmurHash3_x86_32(i8* %6, i32 %7, i32 4919, i32* %8)
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%11 = load i32, i32* %10
%12 = zext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @murmurhash(i8* %0, i32 %1) {
%3 = alloca [1 x i32]
%4 = bitcast [1 x i32]* %3 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%6 = call i32 @MurmurHash3_x86_32(i8* %0, i32 %1, i32 4919, i32* %5)
%7 = load i32, i32* %5
%8 = zext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void my_function(char c) { printf("parameter using %%d %d\n", c); }


x86 assembly (clang, -O0):
<my_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_function>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"parameter using %%d %d\0A\00"
define void @my_function(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
scalar_t__ send_command_to_variable_server(int, char *);
int unpause(int socket) {
  if (send_command_to_variable_server(socket, "trick.var_unpause()") < 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<unpause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
cmp    $0x0,%rax
jge    1140 <unpause+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <unpause+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpause>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <send_command_to_variable_server@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"trick.var_unpause()\00"
define i32 @unpause(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @send_command_to_variable_server(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"trick.var_unpause()\00"
define i32 @unpause(i32 %0) {
%2 = tail call i64 @send_command_to_variable_server(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void create_random(int tab[]) {
  srand(time(NULL));
  for (int i = 0; i < 100; i++) {
    tab[i] = (rand() % (20 + 1));
  }
}


x86 assembly (clang, -O0):
<create_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1185 <create_random+0x55>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <create_random+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_random>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1150 <create_random+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @create_random(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 21
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @create_random(i32* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %5
4: ; preds = %5
ret void
5: ; preds = %1, %5
%6 = phi i64 [ 0, %1 ], [ %10, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 21
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 100
br i1 %11, label %4, label %5
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
void volatile_fetch_add_u64(uint64_t *dest, uint64_t val) {
  *((volatile uint64_t *)dest) += val;
}


x86 assembly (clang, -O0):
<volatile_fetch_add_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_fetch_add_u64>:
add    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_fetch_add_u64(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
%8 = add nsw i64 %7, %5
store volatile i64 %8, i64* %6
ret void
}

LLVM IR (-O2):
define void @volatile_fetch_add_u64(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = add nsw i64 %3, %1
store volatile i64 %4, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void rtxPrintNull(const char *name) { printf("%s = <null>\n", name); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s = <null>\0A\00"
define void @rtxPrintNull(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double KTStoMPS(double KTS) {
  double MPS = 0.5144444 * KTS;
  return MPS;
}


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

x86 assembly (clang, -O2):
<KTStoMPS>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KTStoMPS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FE076541A3387ED, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @KTStoMPS(double %0) {
%2 = fmul double %0, 0x3FE076541A3387ED
ret double %2
}
int ex_hashfun_uchar(const char *s) { return (unsigned char)(*s); }


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

x86 assembly (clang, -O2):
<ex_hashfun_uchar>:
movzbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ex_hashfun_uchar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_action(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x00D0);
}


x86 assembly (clang, -O0):
<ieee80211_is_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xd0,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_action>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xd0,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_action(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 208)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_action(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 208)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x86() {
  Assert_real((isodigit(134) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              675, ("isodigit should be 0 for 0x86"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x86>:
push   %rbp
mov    %rsp,%rbp
mov    $0x86,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a3,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x86>:
push   %rax
mov    $0x86,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2a3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x86\00"
define void @t_isodigit_0x86() {
%1 = call i64 @isodigit(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x86\00"
define void @t_isodigit_0x86() {
%1 = tail call i64 @isodigit(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double x_sqr(const double val) { return val * val; }


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

x86 assembly (clang, -O2):
<x_sqr>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @x_sqr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @x_sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int printf(char *, short);
int print_short(short v) { return printf("%d", v); }


x86 assembly (clang, -O0):
<print_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeda(%rip),%rdi
movswl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_short>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @print_short(i16 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %0)
ret i32 %2
}
unsigned clz(int x) {
  unsigned n = 0;
  if (x == 0)
    return sizeof(x) * 8;
  while (1) {
    if (x < 0)
      break;
    n++;
    x <<= 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <clz+0x24>
movl   $0x20,-0x4(%rbp)
jmp    1155 <clz+0x55>
jmp    1129 <clz+0x29>
cmpl   $0x0,-0x8(%rbp)
jge    1138 <clz+0x38>
jmp    114f <clz+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <clz+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
test   %edi,%edi
je     1118 <clz+0x18>
js     111e <clz+0x1e>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
add    %edi,%edi
jns    1110 <clz+0x10>
ret
mov    $0x20,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %0, %3 ]
%8 = add i32 %6, 1
%9 = shl nuw i32 %7, 1
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 32, %1 ], [ 0, %3 ], [ %8, %5 ]
ret i32 %12
}
unsigned int __atomic_fetch_add_4(volatile void *atom, unsigned int value,
                                  int memorder) {
  unsigned int xchg;
  unsigned int cmp;
  __atomic_load((unsigned int *)atom, (unsigned int *)&cmp, 0);
  do {
    xchg = ((cmp + value));
  } while (
      !__atomic_compare_exchange((unsigned int *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_add_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x21(%rbp)
mov    %ecx,-0x20(%rbp)
test   $0x1,%al
jne    1147 <__atomic_fetch_add_4+0x47>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1117 <__atomic_fetch_add_4+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_add_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
lea    (%rcx,%rsi,1),%edx
lock cmpxchg %edx,(%rdi)
jne    1110 <__atomic_fetch_add_4+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_fetch_add_4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load atomic i32, i32* %11 monotonic
store i32 %12, i32* %8
br label %13
13: ; preds = %26, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = add i32 %14, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = cmpxchg weak i32* %19, i32 %20, i32 %21 seq_cst seq_cst
%23 = extractvalue { i32, i1 } %22, 0
%24 = extractvalue { i32, i1 } %22, 1
br i1 %24, label %26, label %25
25: ; preds = %17
store i32 %23, i32* %8
br label %26
26: ; preds = %25, %17
%27 = zext i1 %24 to i8
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = trunc i8 %28 to i1
%30 = xor i1 %29, true
br i1 %30, label %13, label %31
31: ; preds = %26
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @__atomic_fetch_add_4(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load atomic i32, i32* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ %5, %3 ], [ %11, %6 ]
%8 = add i32 %7, %1
%9 = cmpxchg weak i32* %4, i32 %7, i32 %8 seq_cst seq_cst
%10 = extractvalue { i32, i1 } %9, 1
%11 = extractvalue { i32, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getPunch(unsigned char id) { return dxl_read_word(id, (48)); }


x86 assembly (clang, -O0):
<getPunch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x30,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPunch>:
mov    $0x30,%esi
jmp    1030 <dxl_read_word@plt>

LLVM IR (-O0):
define zeroext i16 @getPunch(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 48)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getPunch(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 48)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int rat_lib_6addr_from_str(struct in6_addr *, char const *);
int rat_opt_rdnss_set_val_addr(const char *argv, uint8_t *data, uint16_t len) {
  struct in6_addr *addr = (struct in6_addr *)data;
  do {
  } while (0);
  if (len < sizeof(*addr))
    goto exit_err;
  return rat_lib_6addr_from_str(addr, argv);
exit_err:
  return -1;
}


x86 assembly (clang, -O0):
<rat_opt_rdnss_set_val_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1130 <rat_opt_rdnss_set_val_addr+0x20>
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1143 <rat_opt_rdnss_set_val_addr+0x33>
jmp    1158 <rat_opt_rdnss_set_val_addr+0x48>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rat_lib_6addr_from_str@plt>
mov    %eax,-0x4(%rbp)
jmp    115f <rat_opt_rdnss_set_val_addr+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_opt_rdnss_set_val_addr>:
cmp    $0x4,%edx
jae    111b <rat_opt_rdnss_set_val_addr+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <rat_lib_6addr_from_str@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @rat_opt_rdnss_set_val_addr(i8* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca %struct.in6_addr*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%9 = load i32*, i32** %6
%10 = bitcast i32* %9 to %struct.in6_addr*
store %struct.in6_addr* %10, %struct.in6_addr** %8
br label %11
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 4
br i1 %15, label %16, label %17
16: ; preds = %12
br label %21
17: ; preds = %12
%18 = load %struct.in6_addr*, %struct.in6_addr** %8
%19 = load i8*, i8** %5
%20 = call i32 @rat_lib_6addr_from_str(%struct.in6_addr* %18, i8* %19)
store i32 %20, i32* %4
br label %22
21: ; preds = %16
store i32 -1, i32* %4
br label %22
22: ; preds = %21, %17
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @rat_opt_rdnss_set_val_addr(i8* %0, i32* %1, i32 %2) {
%4 = icmp ult i32 %2, 4
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast i32* %1 to %struct.in6_addr*
%7 = tail call i32 @rat_lib_6addr_from_str(%struct.in6_addr* %6, i8* %0)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ trm_str(char *);
void parse_error(void) { trm_str("I don't understand.\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"I don't understand.\0A\00"
define void @parse_error() {
%1 = call i32 @trm_str(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"I don't understand.\0A\00"
define void @parse_error() {
%1 = tail call i32 @trm_str(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void hstr_curses_stop() {
  clear();
  refresh();
  doupdate();
  endwin();
}


x86 assembly (clang, -O0):
<hstr_curses_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1050 <doupdate@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstr_curses_stop>:
push   %rax
xor    %eax,%eax
call   1060 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1050 <doupdate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @hstr_curses_stop() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @doupdate()
%4 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @hstr_curses_stop() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @doupdate()
%4 = tail call i32 (...) @endwin()
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s && f)
    while (*s)
      (*f)(s++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <ft_striter+0x57>
cmpq   $0x0,-0x10(%rbp)
je     1157 <ft_striter+0x57>
jmp    112b <ft_striter+0x2b>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <ft_striter+0x52>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    112b <ft_striter+0x2b>
jmp    1157 <ft_striter+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
tail call void %1(i8* %10)
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xattr_listattr_data(void *, int /*<<< orphan*/ *);
void fs_listxattr_data(void *xanode, uint8_t *xabuff) {
  xattr_listattr_data(xanode, xabuff);
}


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

x86 assembly (clang, -O2):
<fs_listxattr_data>:
jmp    1030 <xattr_listattr_data@plt>

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

LLVM IR (-O2):
define void @fs_listxattr_data(i8* %0, i32* %1) {
%3 = tail call i32 @xattr_listattr_data(i8* %0, i32* %1)
ret void
}
/* Variables and functions */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int mNums1[] = {1, 2};
  int mNums2[] = {1, 1};
  double mResult = findMedianSortedArrays(mNums1, 2, mNums2, 2);
  printf("%lf\n", mResult);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x14(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x14(%rbp),%rdx
mov    $0x2,%ecx
mov    %ecx,%esi
call   1040 <findMedianSortedArrays@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x200000001,%rax
mov    %rax,0x10(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x2,%esi
mov    $0x2,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.mNums1 = [2 x i32] [i32 1, i32 2]
@__const.main.mNums2 = [2 x i32] [i32 1, i32 1]
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca double
store i32 0, i32* %1
%5 = bitcast [2 x i32]* %2 to i8*
%6 = bitcast [2 x i32]* %3 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 2, i32* %8, i32 2)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 8589934593, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 4294967297, i64* %2
%5 = bitcast i64* %1 to i32*
%6 = bitcast i64* %2 to i32*
%7 = call double @findMedianSortedArrays(i32* %5, i32 2, i32* %6, i32 2)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 6;
  if ((++i < 7) && (i++ / 6) || (++i <= 9))
    ;
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x7,%eax
jge    1154 <main+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    1166 <main+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x9,%eax
jg     116b <main+0x5b>
jmp    116b <main+0x5b>
mov    -0x8(%rbp),%esi
lea    0xe8b(%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
mov    $0x8,%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() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = sdiv i32 %7, 6
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6, %0
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = icmp sle i32 %13, 9
br i1 %14, label %15, label %16
15: ; preds = %11, %6
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(int);
int /*<<< orphan*/ *strchr(char *, int);
int is_separator(int c) {
  return c == '\0' || isspace(c) || strchr(",.()+-/*=~%[];", c) != NULL;
}


x86 assembly (clang, -O0):
<is_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116d <is_separator+0x4d>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <is_separator+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <strchr@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):
<is_separator>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
test   %edi,%edi
je     114e <is_separator+0x2e>
mov    %edi,%ebp
call   1040 <isspace@plt>
test   %rax,%rax
jne    114e <is_separator+0x2e>
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c",.()+-/*=~%[];\00"
define i32 @is_separator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @isspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32* @strchr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp ne i32* %11, null
br label %13
13: ; preds = %9, %5, %1
%14 = phi i1 [ true, %5 ], [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c",.()+-/*=~%[];\00"
define i32 @is_separator(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @isspace(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32* @strchr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int main() {
  char a[] = "ABCDE";
  permute(a, 0, 4);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <permute@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x45,0x4(%rsp)
movl   $0x44434241,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <permute@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i8] c"ABCDE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @permute(i8* %4, i32 0, i32 4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"ABCDE\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @permute(i8* %2, i32 0, i32 4)
%4 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ next_start_code();
void user_data() { next_start_code(); }


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

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

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

LLVM IR (-O2):
define void @user_data() {
%1 = tail call i32 (...) @next_start_code()
ret void
}
int id(int x) {
  if (x == 0)
    return 0;
  return id(x - 1) + 1;
}


x86 assembly (clang, -O0):
<id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1142 <id+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @id(i32 %0) {
ret i32 %0
}
int test_imm_03int8_mem(signed char *val) {
  return ((*val) & (-0x03 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_03int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -3
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double RtoC(double R) {
  double c = .55556 * ((R - 459.69) - 32);
  return c;
}


x86 assembly (clang, -O0):
<RtoC>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xefa(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RtoC>:
addsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @RtoC(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 4.596900e+02
%6 = fsub double %5, 3.200000e+01
%7 = fmul double 5.555600e-01, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @RtoC(double %0) {
%2 = fadd double %0, -4.596900e+02
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 5.555600e-01
ret double %4
}