xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Please specify:\n");
  printf("-d for a dirty clone (uses dd, for know working drives.)\n");
  printf("-c for a clean clone (uses ddrescue, for know bad drives.)\n");
  printf("-z to zerowrite a drive (use extreme caution)\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf48(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Please specify:\0A\00"
@.str.1 = [58 x i8] c"-d for a dirty clone (uses dd, for know working drives.)\0A\00"
@.str.2 = [60 x i8] c"-c for a clean clone (uses ddrescue, for know bad drives.)\0A\00"
@.str.3 = [47 x i8] c"-z to zerowrite a drive (use extreme caution)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Please specify:\00"
@str.4 = [57 x i8] c"-d for a dirty clone (uses dd, for know working drives.)\00"
@str.5 = [59 x i8] c"-c for a clean clone (uses ddrescue, for know bad drives.)\00"
@str.6 = [46 x i8] c"-z to zerowrite a drive (use extreme caution)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
ret void
}
int security_swapon(struct swap_info_struct *swap) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.swap_info_struct = type opaque
define i32 @security_swapon(%struct.swap_info_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzArbiter_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN(int);
void BrzArbiter_ackdown(struct comp *comp, int port) {
  struct BrzArbiter_ *c = (struct BrzArbiter_ *)comp;
  SEND_ACKDOWN(port - 2);
}


x86 assembly (clang, -O0):
<BrzArbiter_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <SEND_ACKDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzArbiter_ackdown>:
lea    -0x2(%rsi),%edi
jmp    1030 <SEND_ACKDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzArbiter_ = type { i32 }
define void @BrzArbiter_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzArbiter_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzArbiter_*
store %struct.BrzArbiter_* %7, %struct.BrzArbiter_** %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = call i32 @SEND_ACKDOWN(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzArbiter_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = add nsw i32 %1, -2
%4 = tail call i32 @SEND_ACKDOWN(i32 %3)
ret void
}
const char *base_name(fname) const char *fname;
{
  const char *s = fname;
  const char *p;
  if ((p = strrchr(s, '/')))
    s = p + 1;
  return s;
}


x86 assembly (clang, -O0):
<base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114c <base_name+0x3c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @base_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i32 47)
store i8* %7, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %3
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @base_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int ___UDFICB(uint8_t *data, uint8_t *FileType, uint16_t *Flags) {
  *FileType = ((uint8_t)data[11]);
  *Flags = ((uint16_t)data[18] | ((uint16_t)data[(18) + 1] << 8));
  return 0;
}


x86 assembly (clang, -O0):
<___UDFICB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x58(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x90(%rax),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x98(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___UDFICB>:
mov    0x58(%rdi),%rax
mov    %rax,(%rsi)
mov    0x98(%rdi),%eax
shl    $0x8,%eax
or     0x90(%rdi),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @___UDFICB(i64* %0, i64* %1, i32* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 11
%9 = load i64, i64* %8
%10 = load i64*, i64** %5
store i64 %9, i64* %10
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 18
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = load i64*, i64** %4
%16 = getelementptr inbounds i64, i64* %15, i64 19
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret i32 0
}

LLVM IR (-O2):
define i32 @___UDFICB(i64* nocapture %0, i64* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 11
%5 = load i64, i64* %4
store i64 %5, i64* %1
%6 = getelementptr inbounds i64, i64* %0, i64 18
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds i64, i64* %0, i64 19
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %12, %8
store i32 %13, i32* %2
ret i32 0
}
int bang(int x) {}


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

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

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

LLVM IR (-O2):
define i32 @bang(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char read_char();
int /*<<< orphan*/ unread_char(char);
scalar_t__ whitespacep(char);
unsigned int skip_whitespace(void) {
  char c;
  unsigned int skipped;
  while (whitespacep(c = read_char()))
    skipped += 1;
  unread_char(c);
  return skipped;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <read_char@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%edi
call   1030 <whitespacep@plt>
cmp    $0x0,%rax
je     1162 <skip_whitespace+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <skip_whitespace+0x8>
movsbl -0x1(%rbp),%edi
call   1050 <unread_char@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbp
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <read_char@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <whitespacep@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1140 <skip_whitespace+0x10>
mov    %ebp,%edi
call   1050 <unread_char@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @skip_whitespace() {
%1 = alloca i8
%2 = alloca i32
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @read_char()
store i8 %4, i8* %1
%5 = call i64 @whitespacep(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i8, i8* %1
%12 = call i32 @unread_char(i8 signext %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @skip_whitespace() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ undef, %0 ], [ %6, %1 ]
%3 = tail call signext i8 (...) @read_char()
%4 = tail call i64 @whitespacep(i8 signext %3)
%5 = icmp eq i64 %4, 0
%6 = add i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @unread_char(i8 signext %3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ solve();
int main() {
  solve();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @solve()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void frndint() {
  db(0xD9);
  db(0xFC);
}


x86 assembly (clang, -O0):
<frndint>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xfc,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<frndint>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xfc,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @frndint() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 252)
ret void
}

LLVM IR (-O2):
define void @frndint() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 252)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_ball_position();
int /*<<< orphan*/ update_paddles();
void update_state() {
  update_ball_position();
  update_paddles();
}


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

x86 assembly (clang, -O2):
<update_state>:
push   %rax
xor    %eax,%eax
call   1030 <update_ball_position@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_paddles@plt>

LLVM IR (-O0):
define void @update_state() {
%1 = call i32 (...) @update_ball_position()
%2 = call i32 (...) @update_paddles()
ret void
}

LLVM IR (-O2):
define void @update_state() {
%1 = tail call i32 (...) @update_ball_position()
%2 = tail call i32 (...) @update_paddles()
ret void
}
int fluff_packet_client_run(struct FluffPacketClient *self) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.FluffPacketClient = type opaque
define i32 @fluff_packet_client_run(%struct.FluffPacketClient* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int foo(int, int);
int bar(int i) {
  int j = 2;
  return foo(i, j);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x2,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0, i32 2)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint16_t;
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit_bytes(struct jit_state *, int /*<<< orphan*/ *, int);
void emit2(struct jit_state *state, uint16_t x) {
  emit_bytes(state, &x, sizeof(x));
}


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

x86 assembly (clang, -O2):
<emit2>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <emit_bytes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit2(%struct.jit_state* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @emit_bytes(%struct.jit_state* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_op_precedence(void) {
  test("10", "main(){int i=3; int j=1+i*3; printf(\"%d\", j);}");
  test("5", "main(){int i=9; int j=1+i/3+9/i; printf(\"%d\", j);}");
}


x86 assembly (clang, -O0):
<TEST_op_precedence>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xf04(%rip),%rdi
lea    0xeff(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_op_precedence>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <test@plt>
lea    0xf07(%rip),%rdi
lea    0xf02(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"10\00"
@.str.1 = [47 x i8] c"main(){int i=3; int j=1+i*3; printf(\22%d\22, j);}\00"
@.str.2 = [2 x i8] c"5\00"
@.str.3 = [51 x i8] c"main(){int i=9; int j=1+i/3+9/i; printf(\22%d\22, j);}\00"
define void @TEST_op_precedence() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"10\00"
@.str.1 = [47 x i8] c"main(){int i=3; int j=1+i*3; printf(\22%d\22, j);}\00"
@.str.2 = [2 x i8] c"5\00"
@.str.3 = [51 x i8] c"main(){int i=9; int j=1+i/3+9/i; printf(\22%d\22, j);}\00"
define void @TEST_op_precedence() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int execute_mknodat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mknodat() {
ret i32 0
}
void complete_acquire(struct completion *x) {}


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

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

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

LLVM IR (-O2):
%struct.completion = type opaque
define void @complete_acquire(%struct.completion* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
__attribute__((always_)) uint64_t detexPack64RGB16(uint16_t r16, uint16_t g16,
                                                   uint16_t b16) {
  return (uint64_t)r16 | ((uint64_t)g16 << 16) | ((uint64_t)b16 << 32);
}


x86 assembly (clang, -O0):
<detexPack64RGB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @detexPack64RGB16(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 16
%12 = or i32 %8, %11
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 32
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @detexPack64RGB16(i64 %0, i64 %1, i64 %2) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void http_tcpclient_close(int socket) { close(socket); }


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

x86 assembly (clang, -O2):
<http_tcpclient_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @http_tcpclient_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void foobar(int n) {}


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

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

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

LLVM IR (-O2):
define void @foobar(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ is_mounted(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (is_mounted("/dev/sr0")) {
    printf("CDROM mounted!\n");
  } else {
    printf("CDROM not mounted!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <is_mounted@plt>
cmp    $0x0,%rax
je     115d <main+0x3d>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xeb5(%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
call   1040 <is_mounted@plt>
test   %rax,%rax
lea    0xed2(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/sr0\00"
@.str.1 = [16 x i8] c"CDROM mounted!\0A\00"
@.str.2 = [20 x i8] c"CDROM not mounted!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @is_mounted(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/sr0\00"
@str = [19 x i8] c"CDROM not mounted!\00"
@str.3 = [15 x i8] c"CDROM mounted!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @is_mounted(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int sv_rewind(int, int);
int vox_rewind(int slot, int t) { return sv_rewind(slot, t); }


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

x86 assembly (clang, -O2):
<vox_rewind>:
jmp    1030 <sv_rewind@plt>

LLVM IR (-O0):
define i32 @vox_rewind(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* %4
%7 = call i32 @sv_rewind(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vox_rewind(i32 %0, i32 %1) {
%3 = tail call i32 @sv_rewind(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CMasterDataPut(uint32_t ui32Base, uint8_t ui8Data) {
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000808))) = ui8Data;
}


x86 assembly (clang, -O0):
<I2CMasterDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x40002808,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDataPut>:
mov    %rsi,0x40002808
40
ret

LLVM IR (-O0):
define void @I2CMasterDataPut(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
store volatile i64 %5, i64* inttoptr (i64 1073752072 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CMasterDataPut(i32 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1073752072 to i64*)
ret void
}
void rl_fini_socket(void) {}


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

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

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

LLVM IR (-O2):
define void @rl_fini_socket() {
ret void
}
int strcmp(char const *s1, char const *s2) {
  while (*s1 == *s2) {
    if (*s1 == '\0') {
      return (0);
    }
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x53() {
  Assert_real((isxdigit(83) == 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_isxdigit.c",
              420, ("isxdigit should be 0 for S"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for S\00"
define void @t_isxdigit_0x53() {
%1 = tail call i64 @isxdigit(i32 83)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *appname) {
  fprintf(stderr, "Usage: %s <positive number of keys>\n", appname);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <positive number of keys>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(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 ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <positive number of keys>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int is_odd(int val) { return val % 2 == 1; }


x86 assembly (clang, -O0):
<is_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_odd>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_odd(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x >= 0) {
    x += __VERIFIER_nondet_int();
  }
  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)
jl     1145 <main+0x35>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     112b <main+0x1b>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    %eax,%ebx
jns    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
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
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 (...) @__VERIFIER_nondet_int()
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = add nsw i32 %5, %4
%7 = icmp sgt i32 %6, -1
br i1 %7, label %3, label %8
8: ; preds = %3, %0
ret i32 0
}
int getsize(int num) {
  int i = 0;
  if (num == 0)
    return 1;
  while (num != 0) {
    i++;
    num /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<getsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <getsize+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1155 <getsize+0x55>
jmp    1129 <getsize+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114f <getsize+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1129 <getsize+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsize>:
test   %edi,%edi
je     1133 <getsize+0x33>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <getsize+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getsize(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %11
}
unsigned char cast_char_uchar_fast(char x) { return (unsigned char)x; }


x86 assembly (clang, -O0):
<cast_char_uchar_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @cast_char_uchar_fast(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @cast_char_uchar_fast(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void fopIMM(unsigned char *p) { printf("#$%02X", p[1]); }


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

x86 assembly (clang, -O2):
<fopIMM>:
movzbl 0x1(%rdi),%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"#$%02X\00"
define void @fopIMM(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"#$%02X\00"
define void @fopIMM(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t write_checksum(FILE *fh, uint8_t *checksum) {
  return fwrite(checksum, sizeof(uint8_t), 16, fh);
}


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

x86 assembly (clang, -O2):
<write_checksum>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x10,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i64 @write_checksum(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 = load i32*, i32** %3
%7 = call i64 @fwrite(i32* %5, i32 4, i32 16, i32* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @write_checksum(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fwrite(i32* %1, i32 4, i32 16, i32* %0)
ret i64 %3
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int *allocate_ints(unsigned num) { return (int *)malloc(num * sizeof(int)); }


x86 assembly (clang, -O0):
<allocate_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_ints>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @allocate_ints(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @allocate_ints(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
int countchars(char string[], int limit) {
  int i;
  for (i = 0; i < limit && string[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<countchars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    1138 <countchars+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <countchars+0x48>
jmp    115b <countchars+0x5b>
jmp    114d <countchars+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <countchars+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countchars>:
test   %esi,%esi
jle    1122 <countchars+0x22>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1121 <countchars+0x21>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <countchars+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @countchars(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ %1, %11 ]
ret i32 %17
}
char getBRKflag(char flags[]) { return flags[8 - 5]; }


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

x86 assembly (clang, -O2):
<getBRKflag>:
mov    0x3(%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @getBRKflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getBRKflag(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ILibHashTree_DestroyEnumerator(void *tree_enumerator) {
  free(tree_enumerator);
}


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

x86 assembly (clang, -O2):
<ILibHashTree_DestroyEnumerator>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ILibHashTree_DestroyEnumerator(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ti_tsf_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_tsf_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_tsf_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_tsf_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_tsf_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
int plat_cpu_clock_apply(int cpu_clock) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @plat_cpu_clock_apply(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str && str[i])
    i++;
  write(1, str, i);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1148 <ft_putstr+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1158 <ft_putstr+0x48>
jmp    1166 <ft_putstr+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
test   %rdi,%rdi
je     1136 <ft_putstr+0x26>
mov    $0xffffffff,%edx
mov    %rsi,%rax
add    $0x1,%edx
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1120 <ft_putstr+0x10>
mov    $0x1,%edi
jmp    1030 <write@plt>
xor    %edx,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
%13 = tail call i32 @write(i32 1, i8* %0, i32 %12)
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *dsme_rd_mode_get_flags(void) { return getenv("DSME_RD_FLAGS"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"DSME_RD_FLAGS\00"
define i8* @dsme_rd_mode_get_flags() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"DSME_RD_FLAGS\00"
define i8* @dsme_rd_mode_get_flags() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}