xunge/DecIR huggingface dataset:
/* Type definitions */
struct statfs64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __fstatfs64(int fd, struct statfs64 *buf) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

LLVM IR (-O0):
%struct.statfs64 = type { i32 }
@ENOSYS = global i32 0
define i32 @__fstatfs64(i32 %0, %struct.statfs64* %1) {
%3 = alloca i32
%4 = alloca %struct.statfs64*
store i32 %0, i32* %3
store %struct.statfs64* %1, %struct.statfs64** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.statfs64 = type { i32 }
@ENOSYS = global i32 0
define i32 @__fstatfs64(i32 %0, %struct.statfs64* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int get_max(int a, int b, int c) {
  int m = 0;
  if (a > b) {
    m = a;
    if (c > m) {
      m = c;
    }
  } else {
    m = b;
    if (c > m) {
      m = c;
    }
  }
  return m;
}


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <get_max+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1138 <get_max+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115a <get_max+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1155 <get_max+0x55>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115a <get_max+0x5a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
mov    %edi,%eax
cmp    %edi,%edx
cmovg  %edx,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %0
%5 = select i1 %4, i32 %2, i32 %0
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
float fasterlog2(float);
float fasterpow2(float);
float fasterpow(float x, float p) { return fasterpow2(p * fasterlog2(x)); }


x86 assembly (clang, -O0):
<fasterpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fasterlog2@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <fasterpow2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterpow>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <fasterlog2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <fasterpow2@plt>

LLVM IR (-O0):
define float @fasterpow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call float @fasterlog2(float %6)
%8 = fmul float %5, %7
%9 = call float @fasterpow2(float %8)
ret float %9
}

LLVM IR (-O2):
define float @fasterpow(float %0, float %1) {
%3 = tail call float @fasterlog2(float %0)
%4 = fmul float %3, %1
%5 = tail call float @fasterpow2(float %4)
ret float %5
}
/* Variables and functions */
scalar_t__ bar();
int foo() {
  int c = 7;
  if (bar())
    c = 2;
  else
    c += 3;
  while (c) {
    c += 5;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%rax
je     113c <foo+0x2c>
movl   $0x2,-0x8(%rbp)
jmp    1145 <foo+0x35>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <foo+0x3a>
cmpl   $0x0,-0x8(%rbp)
je     1162 <foo+0x52>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <foo+0x3a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i64 (...) @bar()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ handle_43(int /*<<< orphan*/);
int gen_43() { handle_43(0); }


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

x86 assembly (clang, -O2):
<gen_43>:
xor    %edi,%edi
jmp    1030 <handle_43@plt>

LLVM IR (-O0):
define i32 @gen_43() {
%1 = alloca i32
%2 = call i32 @handle_43(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_43() {
%1 = tail call i32 @handle_43(i32 0)
ret i32 undef
}
char ttt(int intSeconds) {
  double seconds = intSeconds;
  if (seconds)
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<ttt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <ttt+0x2e>
jp     112e <ttt+0x2e>
jmp    1137 <ttt+0x37>
movb   $0x0,-0x1(%rbp)
jmp    113b <ttt+0x3b>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @ttt(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
store double %6, double* %4
%7 = load double, double* %4
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 0, i8* %2
br label %11
10: ; preds = %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @ttt(i32 %0) {
ret i8 0
}
/* Variables and functions */
scalar_t__ isupper(int);
int lower(int c) { return c + (isupper(c) ? ('a' - 'A') : 0); }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
mov    $0x20,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x5,%ecx
add    %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 32, i32 0
%9 = add nsw i32 %3, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 32
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_drop() {
  puts("drop [<hotel name>]\n"
       "Deletes the disk file associated with the mentioned hotel. Prompts\n"
       "for hotel name if not provided as parameter.");
}


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

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

LLVM IR (-O0):
@.str = [132 x i8] c"drop [<hotel name>]\0ADeletes the disk file associated with the mentioned hotel. Prompts\0Afor hotel name if not provided as parameter.\00"
define void @help_drop() {
%1 = call i32 @puts(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [132 x i8] c"drop [<hotel name>]\0ADeletes the disk file associated with the mentioned hotel. Prompts\0Afor hotel name if not provided as parameter.\00"
define void @help_drop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_xrl_direct(char *str, uint8_t direct) {
  sprintf(str,
          "XRL   A, "
          "0x%02X"
          "                   ",
          direct);
}


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

x86 assembly (clang, -O2):
<sprint_xrl_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"XRL A, 0x%02X \00"
define void @sprint_xrl_direct(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 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"XRL A, 0x%02X \00"
define void @sprint_xrl_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void uninivar_perror(void) {
  char *string;
  (void)perror(string);
}


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

x86 assembly (clang, -O2):
<uninivar_perror>:
jmp    1030 <perror@plt>

LLVM IR (-O0):
define void @uninivar_perror() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @perror(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninivar_perror() {
%1 = tail call i32 @perror(i8* undef)
ret void
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
void reverse_nl(struct terminal *term, void *arg) { move_cursor(term, -1, 0); }


x86 assembly (clang, -O0):
<reverse_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1030 <move_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_nl>:
mov    $0xffffffff,%esi
xor    %edx,%edx
jmp    1030 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
define void @reverse_nl(%struct.terminal* %0, i8* %1) {
%3 = alloca %struct.terminal*
%4 = alloca i8*
store %struct.terminal* %0, %struct.terminal** %3
store i8* %1, i8** %4
%5 = load %struct.terminal*, %struct.terminal** %3
%6 = call i32 @move_cursor(%struct.terminal* %5, i32 -1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @reverse_nl(%struct.terminal* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @move_cursor(%struct.terminal* %0, i32 -1, i32 0)
ret void
}
char eas_allowed(char data) {
  if (data & 0x80)
    return 0;
  if (data == 13 || data == 10)
    return 1;
  if (data >= 32 && data <= 126)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<eas_allowed>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1125 <eas_allowed+0x25>
movb   $0x0,-0x1(%rbp)
jmp    116f <eas_allowed+0x6f>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
je     113f <eas_allowed+0x3f>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jne    1148 <eas_allowed+0x48>
movb   $0x1,-0x1(%rbp)
jmp    116f <eas_allowed+0x6f>
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     116b <eas_allowed+0x6b>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     116b <eas_allowed+0x6b>
movb   $0x1,-0x1(%rbp)
jmp    116f <eas_allowed+0x6f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eas_allowed>:
test   %dil,%dil
js     1114 <eas_allowed+0x14>
mov    $0x1,%al
cmp    $0xa,%dil
je     1113 <eas_allowed+0x13>
cmp    $0xd,%dil
jne    1117 <eas_allowed+0x17>
ret
xor    %eax,%eax
ret
add    $0xe0,%dil
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define signext i8 @eas_allowed(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 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %2
br label %28
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 13
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %13, %9
store i8 1, i8* %2
br label %28
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 32
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 126
br i1 %25, label %26, label %27
26: ; preds = %22
store i8 1, i8* %2
br label %28
27: ; preds = %22, %18
store i8 0, i8* %2
br label %28
28: ; preds = %27, %26, %17, %8
%29 = load i8, i8* %2
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @eas_allowed(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1
switch i8 %0, label %4 [
i8 13, label %8
i8 10, label %8
]
4: ; preds = %3
%5 = add nsw i8 %0, -32
%6 = icmp ult i8 %5, 95
%7 = zext i1 %6 to i8
br label %8
8: ; preds = %4, %3, %3, %1
%9 = phi i8 [ 0, %1 ], [ 1, %3 ], [ 1, %3 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assume(int);
void *malloc(int);
void *malloc_x(int sz) {
  void *p = malloc(sz);
  __CRAB_assume(p > 0);
  return p;
}


x86 assembly (clang, -O0):
<malloc_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assume@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_x>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <__CRAB_assume@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @malloc_x(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ugt i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @__CRAB_assume(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @malloc_x(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @__CRAB_assume(i32 %4)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ LRDP(char *);
void uc2_special2() { LRDP("uc2:special2\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"uc2:special2\0A\00"
define void @uc2_special2() {
%1 = call i32 @LRDP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"uc2:special2\0A\00"
define void @uc2_special2() {
%1 = tail call i32 @LRDP(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *name) {
  printf("Usage: %s num_customers [-s num_selfserve] "
         "[-b num_barista] [-c num_cashier]\n",
         name);
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"Usage: %s num_customers [-s num_selfserve] [-b num_barista] [-c num_cashier]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [78 x i8] c"Usage: %s num_customers [-s num_selfserve] [-b num_barista] [-c num_cashier]\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int pow3(int x, int y) {
  for (int i = 1; i < y; i++) {
    x = x * x;
  }
  return x;
}


x86 assembly (clang, -O0):
<pow3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1135 <pow3+0x35>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <pow3+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow3>:
mov    %edi,%eax
cmp    $0x2,%esi
jl     1158 <pow3+0x58>
lea    -0x1(%rsi),%edx
add    $0xfffffffe,%esi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%esi
jb     113d <pow3+0x3d>
and    $0xfffffff8,%edx
nopw   0x0(%rax,%rax,1)
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
imul   %eax,%eax
add    $0xfffffff8,%edx
jne    1120 <pow3+0x20>
test   %ecx,%ecx
je     1158 <pow3+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %eax,%eax
add    $0xffffffff,%ecx
jne    1150 <pow3+0x50>
ret

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

LLVM IR (-O2):
define i32 @pow3(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = add i32 %1, -1
%6 = add i32 %1, -2
%7 = and i32 %5, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = and i32 %5, -8
br label %23
11: ; preds = %23, %4
%12 = phi i32 [ undef, %4 ], [ %33, %23 ]
%13 = phi i32 [ %0, %4 ], [ %33, %23 ]
%14 = icmp eq i32 %7, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi i32 [ %18, %15 ], [ %13, %11 ]
%17 = phi i32 [ %19, %15 ], [ 0, %11 ]
%18 = mul nsw i32 %16, %16
%19 = add i32 %17, 1
%20 = icmp eq i32 %19, %7
br i1 %20, label %21, label %15
21: ; preds = %11, %15, %2
%22 = phi i32 [ %0, %2 ], [ %12, %11 ], [ %18, %15 ]
ret i32 %22
23: ; preds = %23, %9
%24 = phi i32 [ %0, %9 ], [ %33, %23 ]
%25 = phi i32 [ 0, %9 ], [ %34, %23 ]
%26 = mul nsw i32 %24, %24
%27 = mul nsw i32 %26, %26
%28 = mul nsw i32 %27, %27
%29 = mul nsw i32 %28, %28
%30 = mul nsw i32 %29, %29
%31 = mul nsw i32 %30, %30
%32 = mul nsw i32 %31, %31
%33 = mul nsw i32 %32, %32
%34 = add i32 %25, 8
%35 = icmp eq i32 %34, %10
br i1 %35, label %11, label %23
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void format(void) {
  fprintf(stderr, "Usage: scripts/sign-file [-dp] <hash algo> <key> <x509> "
                  "<module> [<dest>]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<format>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<format>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: scripts/sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: scripts/sign-file [-dp] <hash algo> <key> <x509> <module> [<dest>]\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
double sinyy(double d) {
  double (*y)(double) = 0x0;
  return y(d);
}


x86 assembly (clang, -O0):
<sinyy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define double @sinyy(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* null, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
int foo(int x) { return (x * 2) & 65535; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = and i32 %2, 65534
ret i32 %3
}
/* Type definitions */
typedef enum beaglelogic_triggerflags {
  ____Placeholder_beaglelogic_triggerflags
} beaglelogic_triggerflags;

/* Variables and functions */
int /*<<< orphan*/ _IOR(char, int, int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ uint32_t;
int beaglelogic_get_triggerflags(int fd,
                                 enum beaglelogic_triggerflags *triggerflags) {
  return ioctl(fd, _IOR('k', 0x23, uint32_t), triggerflags);
}


x86 assembly (clang, -O0):
<beaglelogic_get_triggerflags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    $0x6b,%edi
mov    $0x23,%esi
call   1040 <_IOR@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_get_triggerflags>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    $0x6b,%edi
mov    $0x23,%esi
call   1040 <_IOR@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@uint32_t = global i32 0
define i32 @beaglelogic_get_triggerflags(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @uint32_t
%7 = call i32 @_IOR(i8 signext 107, i32 35, i32 %6)
%8 = load i32*, i32** %4
%9 = call i32 @ioctl(i32 %5, i32 %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@uint32_t = global i32 0
define i32 @beaglelogic_get_triggerflags(i32 %0, i32* %1) {
%3 = load i32, i32* @uint32_t
%4 = tail call i32 @_IOR(i8 signext 107, i32 35, i32 %3)
%5 = tail call i32 @ioctl(i32 %0, i32 %4, i32* %1)
ret i32 %5
}
int test_imm_06uint8_reg(unsigned char val) {
  return ((val) & (0x06 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_06uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 6
%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_06uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 6
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x06() {
  Assert_real((isprint(6) == 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_isprint.c",
              35, ("isprint should be 0 for 0x06"));
}


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

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

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x06\00"
define void @t_isprint_0x06() {
%1 = call i64 @isprint(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x06\00"
define void @t_isprint_0x06() {
%1 = tail call i64 @isprint(i32 6)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dict {
  int dummy;
};

/* Variables and functions */
int dict_iset(struct dict *, char *, int /*<<< orphan*/, void *);
int /*<<< orphan*/ strlen(char *);
int dict_set(struct dict *dict, char *key, void *val) {
  return dict_iset(dict, key, strlen(key), val);
}


x86 assembly (clang, -O0):
<dict_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
call   1040 <dict_iset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_set>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <dict_iset@plt>

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

LLVM IR (-O2):
%struct.dict = type { i32 }
define i32 @dict_set(%struct.dict* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @dict_iset(%struct.dict* %0, i8* %1, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  char test[] = "The test string of strings!";
  printf("%s\n", test);
  reverse(test);
  printf("%s\n", test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x20(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movups 0xede(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed7(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.test = [28 x i8] c"The test string of strings!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [28 x i8]
%2 = bitcast [28 x i8]* %1 to i8*
%3 = getelementptr inbounds [28 x i8], [28 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [28 x i8], [28 x i8]* %1, i64 0, i64 0
%6 = call i32 @reverse(i8* %5)
%7 = getelementptr inbounds [28 x i8], [28 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [28 x i8] c"The test string of strings!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [28 x i8]
%2 = getelementptr inbounds [28 x i8], [28 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, unsigned int *, unsigned int *,
                          unsigned int *);
unsigned int str_to_seconds(const char *time_string) {
  unsigned int h = 0, m = 0, s = 0;
  sscanf(time_string, "%d:%d:%d", &h, &m, &s);
  return (h * 3600) + (m * 60) + s;
}


x86 assembly (clang, -O0):
<str_to_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <sscanf@plt>
imul   $0xe10,-0xc(%rbp),%eax
imul   $0x3c,-0x10(%rbp),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_seconds>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xecd(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <sscanf@plt>
imul   $0xe10,0x14(%rsp),%ecx
imul   $0x3c,0x10(%rsp),%eax
add    %ecx,%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d:%d:%d\00"
define i32 @str_to_seconds(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i8*, i8** %2
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %3
%9 = mul i32 %8, 3600
%10 = load i32, i32* %4
%11 = mul i32 %10, 60
%12 = add i32 %9, %11
%13 = load i32, i32* %5
%14 = add i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d:%d:%d\00"
define i32 @str_to_seconds(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = mul i32 %9, 3600
%11 = load i32, i32* %3
%12 = mul i32 %11, 60
%13 = add i32 %12, %10
%14 = load i32, i32* %4
%15 = add i32 %13, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ syscall_wrapper_entrace();
int main() {
  syscall_wrapper_entrace();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @syscall_wrapper_entrace()
ret i32 0
}
/* Variables and functions */
size_t pow2gt(size_t x) {
  --x;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x + 1;
}


x86 assembly (clang, -O0):
<pow2gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2gt>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @pow2gt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = add i64 %25, 1
ret i64 %26
}

LLVM IR (-O2):
define i64 @pow2gt(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
/* Variables and functions */
int mprotect(void *, size_t, int);
int runtime_memprotect(void *addr, size_t length, int prot) {
  return mprotect(addr, length, prot);
}


x86 assembly (clang, -O0):
<runtime_memprotect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <mprotect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runtime_memprotect>:
jmp    1030 <mprotect@plt>

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

LLVM IR (-O2):
define i32 @runtime_memprotect(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @mprotect(i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int main() {
  int x = 10;
  if (x > 15)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jle    1137 <main+0x27>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_5d(int Salt, int Parameter) {
  unsigned b = Salt * 0x19B32B03 + 0x4AD1;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_5d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x19b32b03,-0x4(%rbp),%eax
add    $0x4ad1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_5d>:
imul   $0x19b32b03,%edi,%edi
add    $0x4ad1,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_5d(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 431172355
%8 = add nsw i32 %7, 19153
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_5d(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 431172355
%4 = add nsw i32 %3, 19153
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
float fun_float(float a, float b) { return a; }


x86 assembly (clang, -O0):
<fun_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @fun_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
ret float %5
}

LLVM IR (-O2):
define float @fun_float(float returned %0, float %1) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("only time will tell\n");
  printf("fit as a fiddle\n");
  printf("the quick brown fox jumped over the lazy dogs\n");
  printf("hello world\n");
  printf("the early bird catches the worm\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"only time will tell\0A\00"
@.str.1 = [17 x i8] c"fit as a fiddle\0A\00"
@.str.2 = [47 x i8] c"the quick brown fox jumped over the lazy dogs\0A\00"
@.str.3 = [13 x i8] c"hello world\0A\00"
@.str.4 = [33 x i8] c"the early bird catches the worm\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"only time will tell\00"
@str.5 = [16 x i8] c"fit as a fiddle\00"
@str.6 = [46 x i8] c"the quick brown fox jumped over the lazy dogs\00"
@str.7 = [12 x i8] c"hello world\00"
@str.8 = [32 x i8] c"the early bird catches the worm\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
void sync_quota_sb(struct super_block *sb, int type) {}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define void @sync_quota_sb(%struct.super_block* %0, i32 %1) {
%3 = alloca %struct.super_block*
%4 = alloca i32
store %struct.super_block* %0, %struct.super_block** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.super_block = type opaque
define void @sync_quota_sb(%struct.super_block* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int length;
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strdup(char *);
char *xml_int(int i) {
  const length = 128;
  char buffer[length];
  snprintf(buffer, length, "<number>%d</number>", i);
  return strdup(buffer);
}


x86 assembly (clang, -O0):
<xml_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_int>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"<number>%d</number>\00"
@length = global i32 0
define i8* @xml_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 128, i32* %3
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %4
%6 = alloca i8, i64 128
%7 = load i32, i32* %2
%8 = call i32 @snprintf(i8* %6, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i8* @strdup(i8* %6)
%10 = load i8*, i8** %4
ret i8* %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"<number>%d</number>\00"
@length = global i32 0
define noalias i8* @xml_int(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}