xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ DES_cblock;

/* Variables and functions */
int /*<<< orphan*/ DES_random_key(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
DES_cblock *geniv() {
  DES_cblock *retval;
  retval = (DES_cblock *)malloc(sizeof(DES_cblock));
  if (retval != NULL) {
    DES_random_key(retval);
  }
  return retval;
}


x86 assembly (clang, -O0):
<geniv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <geniv+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <DES_random_key@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geniv>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113b <geniv+0x1b>
mov    %rbx,%rdi
call   1030 <DES_random_key@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @geniv() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @DES_random_key(i32* %7)
br label %9
9: ; preds = %6, %0
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
define i32* @geniv() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @DES_random_key(i32* %2)
br label %6
6: ; preds = %4, %0
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ InitSystem();
int main() {
  InitSystem();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitSystem()
ret i32 0
}
int left(int i) { return i * 2 + 1; }


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

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void USBIntDisableEndpoint(uint32_t ui32Base, uint32_t ui32Flags) {
  ;
  (*((volatile uint16_t *)(ui32Base + 0x00000006))) &=
      ~(ui32Flags & (0x0000FFFE | 0x0000FFFE | 0x00000001));
  (*((volatile uint16_t *)(ui32Base + 0x00000008))) &=
      ~((ui32Flags & (0xFFFE0000 | 0xFFFE0000)) >> 16);
}


x86 assembly (clang, -O0):
<USBIntDisableEndpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x6,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xfffe0000,%edx
shr    $0x10,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntDisableEndpoint>:
mov    %esi,%eax
not    %eax
or     $0xffff0000,%eax
movslq %edi,%rcx
and    %eax,0x6(%rcx)
shr    $0x10,%esi
not    %esi
or     $0xffff0001,%esi
and    %esi,0x8(%rcx)
ret

LLVM IR (-O0):
define void @USBIntDisableEndpoint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65535
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 6
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, %7
store volatile i32 %13, i32* %11
%14 = load i32, i32* %4
%15 = and i32 %14, -131072
%16 = lshr i32 %15, 16
%17 = xor i32 %16, -1
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 8
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = and i32 %22, %17
store volatile i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @USBIntDisableEndpoint(i32 %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = xor i32 %3, -1
%5 = add nsw i32 %0, 6
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %4
store volatile i32 %9, i32* %7
%10 = lshr i32 %1, 16
%11 = and i32 %10, 65534
%12 = xor i32 %11, -1
%13 = add nsw i32 %0, 8
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, %12
store volatile i32 %17, i32* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ser_def_log(char *msg) {
  fprintf(stderr, "%s\n", msg);
  return;
}


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

x86 assembly (clang, -O2):
<ser_def_log>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @ser_def_log(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void print_break(void) {
  printf("\n==================================================================="
         "=======\n\n");
  fprintf(stderr, "\n=========================================================="
                  "================\n\n");
}


x86 assembly (clang, -O0):
<print_break>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_break>:
push   %rax
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"\0A==========================================================================\0A\0A\00"
@stderr = global i32 0
define void @print_break() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [78 x i8] c"\0A==========================================================================\0A\0A\00"
@stderr = global i32 0
@str = [77 x i8] c"\0A==========================================================================\0A\00"
define void @print_break() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  if (x > 0 && x < 3 && x == 1)
    __VERIFIER_assert(x == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1168 <main+0x48>
cmpl   $0x3,-0x8(%rbp)
jge    1168 <main+0x48>
cmpl   $0x1,-0x8(%rbp)
jne    1168 <main+0x48>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x1,%eax
jne    1137 <main+0x17>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @__VERIFIER_assert(i32 1)
br label %5
5: ; preds = %3, %0
ret i32 0
}
void gdk_window_set_child_shapes() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_child_shapes() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void set_uint8(void *cp, uint8_t v) { *(uint8_t *)cp = v; }


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

x86 assembly (clang, -O2):
<set_uint8>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_uint8(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
unsigned int to_uint(char *);
unsigned int to_n_uint(char *buffer, unsigned int size) {
  char copy[10 + 1] = {
      0,
  };
  memcpy(copy, buffer, (((size) < (10 + 1)) ? (size) : (10 + 1)));
  return to_uint(copy);
}


x86 assembly (clang, -O0):
<to_n_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x17(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <memset@plt>
lea    -0x17(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0xb,-0xc(%rbp)
jae    1174 <to_n_uint+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1181 <to_n_uint+0x51>
mov    $0xb,%eax
mov    %eax,-0x2c(%rbp)
jmp    1181 <to_n_uint+0x51>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
call   1040 <memcpy@plt>
lea    -0x17(%rbp),%rdi
call   1050 <to_uint@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_n_uint>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rax
movl   $0x0,0x7(%rsp)
movq   $0x0,(%rsp)
cmp    $0xb,%esi
mov    $0xb,%edx
cmovb  %esi,%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
call   1040 <to_uint@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @to_n_uint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [11 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [11 x i8]* %5 to i8*
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = icmp ult i32 %9, 11
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 11, %13 ]
%16 = call i32 @memcpy(i8* %7, i8* %8, i32 %15)
%17 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%18 = call i32 @to_uint(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @to_n_uint(i8* %0, i32 %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = icmp ult i32 %1, 11
%6 = select i1 %5, i32 %1, i32 11
%7 = call i32 @memcpy(i8* %4, i8* %0, i32 %6)
%8 = call i32 @to_uint(i8* %4)
ret i32 %8
}
/* Type definitions */
struct ottery_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ottery_st_rand_bytes_impl(struct ottery_state *, void *,
                                             size_t);
scalar_t__ ottery_st_rand_check_nolock(struct ottery_state *);
void ottery_st_rand_bytes_nolock(struct ottery_state *st, void *out_,
                                 size_t n) {
  if (ottery_st_rand_check_nolock(st))
    return;
  ottery_st_rand_bytes_impl(st, out_, n);
}


x86 assembly (clang, -O0):
<ottery_st_rand_bytes_nolock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ottery_st_rand_check_nolock@plt>
cmp    $0x0,%rax
je     114c <ottery_st_rand_bytes_nolock+0x2c>
jmp    115d <ottery_st_rand_bytes_nolock+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ottery_st_rand_bytes_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ottery_st_rand_bytes_nolock>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <ottery_st_rand_check_nolock@plt>
test   %rax,%rax
je     113e <ottery_st_rand_bytes_nolock+0x1e>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ottery_st_rand_bytes_impl@plt>

LLVM IR (-O0):
%struct.ottery_state = type { i32 }
define void @ottery_st_rand_bytes_nolock(%struct.ottery_state* %0, i8* %1, i64 %2) {
%4 = alloca %struct.ottery_state*
%5 = alloca i8*
%6 = alloca i64
store %struct.ottery_state* %0, %struct.ottery_state** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.ottery_state*, %struct.ottery_state** %4
%8 = call i64 @ottery_st_rand_check_nolock(%struct.ottery_state* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %16
11: ; preds = %3
%12 = load %struct.ottery_state*, %struct.ottery_state** %4
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @ottery_st_rand_bytes_impl(%struct.ottery_state* %12, i8* %13, i64 %14)
br label %16
16: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.ottery_state = type { i32 }
define void @ottery_st_rand_bytes_nolock(%struct.ottery_state* %0, i8* %1, i64 %2) {
%4 = tail call i64 @ottery_st_rand_check_nolock(%struct.ottery_state* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ottery_st_rand_bytes_impl(%struct.ottery_state* %0, i8* %1, i64 %2)
br label %8
8: ; preds = %3, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void tty_close(void *ui) {
  FILE *tty = ui;
  fclose(tty);
}


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

x86 assembly (clang, -O2):
<tty_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @tty_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
float func_p1(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @func_p1(float returned %0) {
ret float %0
}
int test_imm_EAint8_mem(signed char *val) {
  return ((*val) & (0xEA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EAint8_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, 234
%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_EAint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -22
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void inclass_element2LF() {}


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

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

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

LLVM IR (-O2):
define void @inclass_element2LF() {
ret void
}
int caam_algapi_init(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @caam_algapi_init(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @caam_algapi_init(%struct.device* nocapture readnone %0) {
ret i32 0
}
int str_to_int(char *str) {
  int number = 0, i = 0;
  while (*(str + i) != '\0') {
    number = number * 10 + *(str + i) - '0';
    i++;
  }
  return number;
}


x86 assembly (clang, -O0):
<str_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <str_to_int+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <str_to_int+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <str_to_int+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_to_int+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ find_first(char *, char);
int main(void) { find_first("vxcvusystagvhjsdfq", 'j'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6a,%esi
call   1030 <find_first@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"vxcvusystagvhjsdfq\00"
define i32 @main() {
%1 = call i32 @find_first(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext 106)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"vxcvusystagvhjsdfq\00"
define i32 @main() {
%1 = tail call i32 @find_first(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext 106)
ret i32 0
}
int is_bit_set(int i, unsigned int mask) { return (1 << i) & mask; }


x86 assembly (clang, -O0):
<is_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_set>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @is_bit_set(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 = shl i32 1, %5
%7 = load i32, i32* %4
%8 = and i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_bit_set(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %0
%4 = and i32 %3, %1
ret i32 %4
}
void gtk_quit_add_destroy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_quit_add_destroy() {
ret void
}
/* Variables and functions */
int bit_highest_pos(unsigned long);
unsigned long bit_highest(register unsigned long value) {
  return (1 << bit_highest_pos(value));
}


x86 assembly (clang, -O0):
<bit_highest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bit_highest_pos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_highest>:
push   %rax
call   1030 <bit_highest_pos@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
movslq %edx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @bit_highest(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @bit_highest_pos(i64 %3)
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @bit_highest(i64 %0) {
%2 = tail call i32 @bit_highest_pos(i64 %0)
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
execr(args) char **args;
{
  execvp(*args, args);
  exit(0337);
}


x86 assembly (clang, -O0):
<execr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <execvp@plt>
mov    $0xdf,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<execr>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <execvp@plt>
mov    $0xdf,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @execr(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execvp to i32 (i8*, i8**, ...)*)(i8* %2, i8** %0)
tail call void @exit(i32 223)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float distancia, consumo_total, consumo_medio;
  scanf("%f%f", &distancia, &consumo_total);
  consumo_medio = distancia / consumo_total;
  printf("%.3f km/l\n", consumo_medio);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fdiv float %6, %7
store float %8, float* %4
%9 = load float, float* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fdiv float %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int is_match(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a[20], b[20];
  gets(a);
  gets(b);
  printf("%d\n", is_match(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_match@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <is_match@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @is_match(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i32 @gets(i8* %4)
%7 = call i32 @is_match(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ echo_srv(int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *thread_routine(void *arg) {
  pthread_detach(pthread_self());
  int conn = *((int *)arg);
  free(arg);
  echo_srv(conn);
  printf("exiting thread ...\n");
  return NULL;
}


x86 assembly (clang, -O0):
<thread_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%edi
call   1070 <echo_srv@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_routine>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    (%rbx),%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1070 <echo_srv@plt>
lea    0xe84(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"exiting thread ...\0A\00"
define i8* @thread_routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @pthread_detach(i32 %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
%11 = load i32, i32* %3
%12 = call i32 @echo_srv(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [19 x i8] c"exiting thread ...\00"
define noalias i8* @thread_routine(i8* nocapture %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @echo_srv(i32 %5)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* null
}
void to_sign_short_store_n(__float128 a, short *p, long n) { p[n] = (short)a; }


x86 assembly (clang, -O0):
<to_sign_short_store_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
call   1140 <__fixtfsi>
mov    %ax,%dx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x20,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_sign_short_store_n>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1120 <__fixtfsi>
mov    %ax,(%rbx,%r14,2)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define void @to_sign_short_store_n(fp128 %0, i16* %1, i64 %2) {
%4 = alloca fp128
%5 = alloca i16*
%6 = alloca i64
store fp128 %0, fp128* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load fp128, fp128* %4
%8 = fptosi fp128 %7 to i16
%9 = load i16*, i16** %5
%10 = load i64, i64* %6
%11 = getelementptr inbounds i16, i16* %9, i64 %10
store i16 %8, i16* %11
ret void
}

LLVM IR (-O2):
define void @to_sign_short_store_n(fp128 %0, i16* nocapture writeonly %1, i64 %2) {
%4 = fptosi fp128 %0 to i16
%5 = getelementptr inbounds i16, i16* %1, i64 %2
store i16 %4, i16* %5
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int select(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
__attribute__((visibility("hidden"))) int SYS_USleep(int iTimeVal) {
  struct timeval tv;
  tv.tv_sec = iTimeVal / 1000000;
  tv.tv_usec = iTimeVal - (tv.tv_sec * 1000000);
  return select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<SYS_USleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xf4240,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS_USleep>:
push   %rax
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0xfff0bdc0,%ecx,%ecx
add    %ecx,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define hidden i32 @SYS_USleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000000
%11 = sub nsw i32 %7, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define hidden i32 @SYS_USleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = mul nsw i32 %4, -1000000
%7 = add i32 %6, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret i32 %9
}
int comp_asc(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

x86 assembly (clang, -O2):
<comp_asc>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @comp_asc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_6Buint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Buint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 107
%7 = icmp ne i64 %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_6Buint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 459561500672
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *func2(void *arg) { printf("Hello from func2\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Hello from func2\00"
define noalias i8* @func2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa5() {
  Assert_real((isalnum(165) == 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_isalnum.c",
              830, ("isalnum should be 0 for 0xa5"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xa5>:
push   %rax
mov    $0xa5,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x33e,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa5\00"
define void @t_isalnum_0xa5() {
%1 = call i64 @isalnum(i32 165)
%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 830, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa5\00"
define void @t_isalnum_0xa5() {
%1 = tail call i64 @isalnum(i32 165)
%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 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *realloc(void *, int);
void *initArray(void *space, int size, size_t datatype) {
  void *ptr = NULL;
  ptr = realloc(ptr, sizeof(char) * (size * datatype));
  return ptr;
}


x86 assembly (clang, -O0):
<initArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0xc(%rbp),%rax
imul   -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initArray>:
imul   %edx,%esi
xor    %edi,%edi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @initArray(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
store i8* null, i8** %7
%8 = load i8*, i8** %7
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i8* @realloc(i8* %8, i32 %14)
store i8* %15, i8** %7
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @initArray(i8* nocapture readnone %0, i32 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = mul i32 %4, %1
%6 = tail call i8* @realloc(i8* null, i32 %5)
ret i8* %6
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint64_t TimerValueGet64(uint32_t ui32Base) {
  uint32_t ui32High1, ui32High2, ui32Low;
  ;
  do {
    ui32High1 = (*((volatile uint32_t *)(ui32Base + 0x0000004C)));
    ui32Low = (*((volatile uint32_t *)(ui32Base + 0x00000048)));
    ui32High2 = (*((volatile uint32_t *)(ui32Base + 0x0000004C)));
  } while (ui32High1 != ui32High2);
  return (((uint64_t)ui32High1 << 32) | (uint64_t)ui32Low);
}


x86 assembly (clang, -O0):
<TimerValueGet64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1108 <TimerValueGet64+0x8>
mov    -0x10(%rbp),%rax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x20(%rbp),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerValueGet64>:
mov    0x4c(%rdi),%rax
mov    0x48(%rdi),%rcx
cmp    0x4c(%rdi),%rax
jne    1100 <TimerValueGet64>
ret

LLVM IR (-O0):
define i32 @TimerValueGet64(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
br label %6
6: ; preds = %19, %1
%7 = load i64, i64* %2
%8 = add nsw i64 %7, 76
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 72
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %5
%15 = load i64, i64* %2
%16 = add nsw i64 %15, 76
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %4
br label %19
19: ; preds = %6
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = icmp ne i64 %20, %21
br i1 %22, label %6, label %23
23: ; preds = %19
%24 = load i64, i64* %3
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 32
%27 = load i64, i64* %5
%28 = trunc i64 %27 to i32
%29 = or i32 %26, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @TimerValueGet64(i64 %0) {
%2 = add nsw i64 %0, 76
%3 = inttoptr i64 %2 to i64*
%4 = add nsw i64 %0, 72
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* %3
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %3
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 poison
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void dtime(double *t) {
  struct timeval timev;
  gettimeofday(&timev, NULL);
  *t = timev.tv_sec + (double)timev.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<dtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xecf(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define void @dtime(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
store double* %0, double** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
%11 = load double*, double** %2
store double %10, double* %11
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define void @dtime(double* nocapture writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
store double %10, double* %0
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ app();
int /*<<< orphan*/ end();
int /*<<< orphan*/ init();
int main(int argc, char **argv) {
  init();
  app();
  end();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <app@plt>
mov    $0x0,%al
call   1030 <end@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <app@plt>
xor    %eax,%eax
call   1030 <end@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = call i32 (...) @app()
%8 = call i32 (...) @end()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @app()
%5 = tail call i32 (...) @end()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
char *my_malloc(int);
int main(void) {
  char *c = my_malloc(10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @my_malloc(i32 10)
ret i32 0
}
void ExttDomainAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttDomainAuxTable() {
ret void
}