xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test1();
int main() {
  test1();
  printf("pid %u\n", getpid());
  fflush(stdout);
  sleep(-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0xffffffff,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0xffffffff,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pid %u\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @sleep(i32 -1)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"pid %u\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i32 -1)
ret i32 0
}
three() { return (3); }


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

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

LLVM IR (-O0):
define i32 @three() {
ret i32 3
}

LLVM IR (-O2):
define i32 @three() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ intervalTimer_start(int /*<<< orphan*/);
void TimerHardware_StartTimer() { intervalTimer_start(0); }


x86 assembly (clang, -O0):
<TimerHardware_StartTimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <intervalTimer_start@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TimerHardware_StartTimer() {
%1 = call i32 @intervalTimer_start(i32 0)
ret void
}

LLVM IR (-O2):
define void @TimerHardware_StartTimer() {
%1 = tail call i32 @intervalTimer_start(i32 0)
ret void
}
unsigned invert(unsigned x, int p, int n) {
  unsigned target_mask;
  target_mask = (~(~0 << n) << p);
  return (target_mask ^ x);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
ret i32 %7
}
void ppq() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @INIT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Tui_Gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
void Tui_Clrscr(void) {
  printf("\x1b[2J");
  Tui_Gotoxy(1, 1);
}


x86 assembly (clang, -O0):
<Tui_Clrscr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <Tui_Gotoxy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tui_Clrscr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <Tui_Gotoxy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @Tui_Clrscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Tui_Gotoxy(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @Tui_Clrscr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Tui_Gotoxy(i32 1, i32 1)
ret void
}
void *shift(int *mem) { return mem + 20; }


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

x86 assembly (clang, -O2):
<shift>:
lea    0x50(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @shift(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 20
%3 = bitcast i32* %2 to i8*
ret i8* %3
}
/* Variables and functions */
scalar_t__ getlongpass(char const *, char *, int);
char *getpass(const char *prompt) {
  static char password_buffer[9];
  if (getlongpass(prompt, password_buffer, 9) < 0)
    return 0;
  return password_buffer;
}


x86 assembly (clang, -O0):
<getpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x2f02(%rip),%rsi
mov    $0x9,%edx
call   1030 <getlongpass@plt>
cmp    $0x0,%rax
jge    1148 <getpass+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1153 <getpass+0x43>
lea    0x2eda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpass>:
push   %rbx
lea    0x2f11(%rip),%rbx
mov    %rbx,%rsi
mov    $0x9,%edx
call   1030 <getlongpass@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@getpass.password_buffer = internal global [9 x i8] zeroinitializer
define i8* @getpass(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @getlongpass(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getpass.password_buffer, i64 0, i64 0), i32 9)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getpass.password_buffer, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@getpass.password_buffer = internal global [9 x i8] zeroinitializer
define i8* @getpass(i8* %0) {
%2 = tail call i64 @getlongpass(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getpass.password_buffer, i64 0, i64 0), i32 9)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @getpass.password_buffer, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ HalCC2430RadioP__InterruptFIFOP__fired();
void HplCC2430InterruptsC__InterruptFIFOP__fired(void) {
  HalCC2430RadioP__InterruptFIFOP__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplCC2430InterruptsC__InterruptFIFOP__fired() {
%1 = tail call i32 (...) @HalCC2430RadioP__InterruptFIFOP__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adcimm(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_rors_imm(int, int, int);
void emit_rotrsr(int t, int sr) {
  emit_andimm(sr, ~1, sr);
  emit_rors_imm(t, 1, t);
  emit_adcimm(sr, 0, sr);
}


x86 assembly (clang, -O0):
<emit_rotrsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_rors_imm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1040 <emit_adcimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_rotrsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1030 <emit_rors_imm@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_adcimm@plt>

LLVM IR (-O0):
define void @emit_rotrsr(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* %4
%7 = call i32 @emit_andimm(i32 %5, i32 -2, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_rors_imm(i32 %8, i32 1, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @emit_adcimm(i32 %11, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @emit_rotrsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %1, i32 -2, i32 %1)
%4 = tail call i32 @emit_rors_imm(i32 %0, i32 1, i32 %0)
%5 = tail call i32 @emit_adcimm(i32 %1, i32 0, i32 %1)
ret void
}
struct device_node *
of_find_matching_node_and_match(struct device_node *from,
                                const struct of_device_id *matches,
                                const struct of_device_id **match) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<of_find_matching_node_and_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_node = type opaque
%struct.of_device_id = type opaque
define %struct.device_node* @of_find_matching_node_and_match(%struct.device_node* %0, %struct.of_device_id* %1, %struct.of_device_id** %2) {
%4 = alloca %struct.device_node*
%5 = alloca %struct.of_device_id*
%6 = alloca %struct.of_device_id**
store %struct.device_node* %0, %struct.device_node** %4
store %struct.of_device_id* %1, %struct.of_device_id** %5
store %struct.of_device_id** %2, %struct.of_device_id*** %6
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
%struct.of_device_id = type opaque
define noalias %struct.device_node* @of_find_matching_node_and_match(%struct.device_node* nocapture readnone %0, %struct.of_device_id* nocapture readnone %1, %struct.of_device_id** nocapture readnone %2) {
ret %struct.device_node* null
}
unsigned char gdbserv_to_hex(int c) {
  static const unsigned char hexchars[] = "0123456789abcdef";
  return hexchars[c & 0xf];
}


x86 assembly (clang, -O0):
<gdbserv_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@gdbserv_to_hex.hexchars = internal constant [17 x i8] c"0123456789abcdef\00"
define zeroext i8 @gdbserv_to_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @gdbserv_to_hex.hexchars, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@gdbserv_to_hex.hexchars = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define zeroext i8 @gdbserv_to_hex(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @gdbserv_to_hex.hexchars, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ log_string(int, char *, char *);
void usage(char *program_name) {
  log_string(3,
             "Usage: %s [-n host (192.168.1.100)] [-p port (31337)] [-v "
             "verbosity (0)]",
             program_name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xed4(%rip),%rsi
call   1030 <log_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x3,%edi
jmp    1030 <log_string@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: %s [-n host (192.168.1.100)] [-p port (31337)] [-v verbosity (0)]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_string(i32 3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage: %s [-n host (192.168.1.100)] [-p port (31337)] [-v verbosity (0)]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @log_string(i32 3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sub(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regi_op();
void arm_sub_regi() { arm_arith_sub(arm_data_regi_op()); }


x86 assembly (clang, -O0):
<arm_sub_regi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_sub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sub_regi>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_sub@plt>

LLVM IR (-O0):
define void @arm_sub_regi() {
%1 = call i32 (...) @arm_data_regi_op()
%2 = call i32 @arm_arith_sub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sub_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_sub(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least64_t;

/* Variables and functions */
size_t fmt_uint64_base(char *, int /*<<< orphan*/, int);
size_t fmt_uint64(char *ptr, uint_least64_t val) {
  return fmt_uint64_base(ptr, val, 10);
}


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

x86 assembly (clang, -O2):
<fmt_uint64>:
mov    $0xa,%edx
jmp    1030 <fmt_uint64_base@plt>

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

LLVM IR (-O2):
define i64 @fmt_uint64(i8* %0, i32 %1) {
%3 = tail call i64 @fmt_uint64_base(i8* %0, i32 %1, i32 10)
ret i64 %3
}
int sm_request_login(char *text, char *login, char *password, int len) {
  return 0;
}


x86 assembly (clang, -O0):
<sm_request_login>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sm_request_login(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @sm_request_login(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((weak)) void foo(void) { printf("pr19553b\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"pr19553b\0A\00"
define weak void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"pr19553b\00"
define weak void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void inspect_fw_phexdec(char *label, uint32_t val) {
  printf("%-23s: 0x%08x / %8u bytes\n", label, val, val);
}


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

x86 assembly (clang, -O2):
<inspect_fw_phexdec>:
mov    %esi,%ecx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"%-23s: 0x%08x / %8u bytes\0A\00"
define void @inspect_fw_phexdec(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSC_BITSET_BW50(unsigned char *data) {
  switch_on_bits(data, (0x80 | 0x40 | 0x20));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSC_BITSET_BW50>:
mov    $0xe0,%esi
jmp    1030 <switch_on_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSC_BITSET_BW50(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 224)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x05() {
  Assert_real((iscntrl(5)),
              "/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_iscntrl.c",
              30, ("iscntrl should be 1 for 0x05"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x05>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x05>:
push   %rax
mov    $0x5,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1e,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x05\00"
define void @t_iscntrl_0x05() {
%1 = call i32 @iscntrl(i32 5)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x05\00"
define void @t_iscntrl_0x05() {
%1 = tail call i32 @iscntrl(i32 5)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 0;
  for (int i = 0; i < 10000; i++) {
    x += 1;
  }
  printf("%d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10000)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmpcasenosensitive_internal(char const *, char const *);
extern int unzStringFileNameCompare(const char *fileName1,
                                    const char *fileName2,
                                    int iCaseSensitivity) {
  if (iCaseSensitivity == 0) {
    iCaseSensitivity = 1;
  }
  if (iCaseSensitivity == 1) {
    return strcmp(fileName1, fileName2);
  }
  return strcmpcasenosensitive_internal(fileName1, fileName2);
}


x86 assembly (clang, -O0):
<unzStringFileNameCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1144 <unzStringFileNameCompare+0x24>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    1163 <unzStringFileNameCompare+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <unzStringFileNameCompare+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmpcasenosensitive_internal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unzStringFileNameCompare>:
cmp    $0x1,%edx
ja     112a <unzStringFileNameCompare+0xa>
jmp    1040 <strcmp@plt>
jmp    1030 <strcmpcasenosensitive_internal@plt>

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

LLVM IR (-O2):
define i32 @unzStringFileNameCompare(i8* %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @strcmpcasenosensitive_internal(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int firstblank(char *str) {
  int i = 0;
  while (strncmp(str, " ", 1)) {
    str++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<firstblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     115c <firstblank+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <firstblank+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstblank>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xee1(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     115c <firstblank+0x4c>
add    $0x1,%r14
xor    %ebx,%ebx
lea    0xec5(%rip),%r15
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1140 <firstblank+0x30>
jmp    115e <firstblank+0x4e>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @firstblank(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
unsigned int random();
unsigned int rnd_next() { return random(); }


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

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

LLVM IR (-O0):
define i32 @rnd_next() {
%1 = call i32 (...) @random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @rnd_next() {
%1 = tail call i32 (...) @random()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int lp_free(int fd) {
  close(fd);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @lp_free(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *ecmgcw_get_cw(uint8_t *p_param) { return p_param + 2; }


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

x86 assembly (clang, -O2):
<ecmgcw_get_cw>:
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @ecmgcw_get_cw(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ some_func();
int main(void) {
  some_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @some_func()
ret i32 0
}
int main() {
  int length = 10;
  int x[length];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 10, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *my_queue_mutex_impl_type(void) { return ("pthread mutex"); }


x86 assembly (clang, -O0):
<my_queue_mutex_impl_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_queue_mutex_impl_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"pthread mutex\00"
define i8* @my_queue_mutex_impl_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"pthread mutex\00"
define i8* @my_queue_mutex_impl_type() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void Vector_Scale(float vectorOut[3], float vectorIn[3], float scale2) {
  for (int c = 0; c < 3; c++) {
    vectorOut[c] = vectorIn[c] * scale2;
  }
}


x86 assembly (clang, -O0):
<Vector_Scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    114f <Vector_Scale+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <Vector_Scale+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Scale>:
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @Vector_Scale(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(int /*<<< orphan*/ *, size_t);
int my_pthread_attr_setstacksize(pthread_attr_t *__attr, size_t stack_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_setstacksize(realattr, stack_size);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setstacksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_attr_setstacksize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setstacksize>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_setstacksize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setstacksize(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64, i64* %4
%12 = call i32 @pthread_attr_setstacksize(i32* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setstacksize(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setstacksize(i32* %5, i64 %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arg_df(void) { printf("df\n"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"df\0A\00"
define void @arg_df() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"df\00"
define void @arg_df() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eighth_function();
int main() {
  eighth_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @eighth_function()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_uint16(uint8_t *buf) {
  uint16_t res;
  res = buf[0] << 8 | buf[1];
  return res;
}


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_uint16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = or i32 %7, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_uint16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cache_wait(int, int);
void cache_sync(void) {
  (*((volatile unsigned *)(0xC4200000 + 0x730)) = 0);
  cache_wait((0xC4200000 + 0x730), 1);
}


x86 assembly (clang, -O0):
<cache_sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc4200730,%eax
movl   $0x0,(%rax)
mov    $0xc4200730,%edi
mov    $0x1,%esi
call   1030 <cache_wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_sync>:
mov    $0xc4200730,%eax
movl   $0x0,(%rax)
mov    $0xc4200730,%edi
mov    $0x1,%esi
jmp    1030 <cache_wait@plt>

LLVM IR (-O0):
define void @cache_sync() {
store volatile i32 0, i32* inttoptr (i64 3290433328 to i32*)
%1 = call i32 @cache_wait(i32 -1004533968, i32 1)
ret void
}

LLVM IR (-O2):
define void @cache_sync() {
store volatile i32 0, i32* inttoptr (i64 3290433328 to i32*)
%1 = tail call i32 @cache_wait(i32 -1004533968, i32 1)
ret void
}
void copyString(char *o, char *c) {
  int i;
  for (i = 0; i < 32; i++) {
    c[i] = o[i];
    if (o[i] == '\0')
      break;
  }
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1160 <copyString+0x60>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    114d <copyString+0x4d>
jmp    1160 <copyString+0x60>
jmp    1152 <copyString+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copyString+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     112a <copyString+0x2a>
lea    0x1(%rax),%rcx
cmp    $0x1f,%rax
mov    %rcx,%rax
jne    1110 <copyString+0x10>
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %6, i8* %7
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 32
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %3
13: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_WR;
int /*<<< orphan*/ close(int);
int opensocket();
int recvreply(int);
int /*<<< orphan*/ sendcmd(int, char const *);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
int runcmd(const char *cmd) {
  int fd;
  int r = 0;
  fd = opensocket();
  sendcmd(fd, cmd);
  shutdown(fd, SHUT_WR);
  r = recvreply(fd);
  close(fd);
  return r;
}


x86 assembly (clang, -O0):
<runcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <opensocket@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1070 <sendcmd@plt>
mov    -0xc(%rbp),%edi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1050 <shutdown@plt>
mov    -0xc(%rbp),%edi
call   1040 <recvreply@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runcmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <opensocket@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1070 <sendcmd@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1050 <shutdown@plt>
mov    %ebp,%edi
call   1040 <recvreply@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1060 <close@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SHUT_WR = global i32 0
define i32 @runcmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = call i32 (...) @opensocket()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i8*, i8** %2
%8 = call i32 @sendcmd(i32 %6, i8* %7)
%9 = load i32, i32* %3
%10 = load i32, i32* @SHUT_WR
%11 = call i32 @shutdown(i32 %9, i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @recvreply(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @close(i32 %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@SHUT_WR = global i32 0
define i32 @runcmd(i8* %0) {
%2 = tail call i32 (...) @opensocket()
%3 = tail call i32 @sendcmd(i32 %2, i8* %0)
%4 = load i32, i32* @SHUT_WR
%5 = tail call i32 @shutdown(i32 %2, i32 %4)
%6 = tail call i32 @recvreply(i32 %2)
%7 = tail call i32 @close(i32 %2)
ret i32 %6
}
void setBRKflag(char flags[]) { flags[8 - 5] = '1'; }


x86 assembly (clang, -O0):
<setBRKflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x31,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBRKflag>:
movb   $0x31,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @setBRKflag(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
store i8 49, i8* %2
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ buffer_write(struct buffer *, float *, int);
void buffer_write_float(struct buffer *__restrict buf, float data) {
  buffer_write(buf, &data, sizeof(data));
}


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

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

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_write_float(%struct.buffer* noalias %0, float %1) {
%3 = alloca %struct.buffer*
%4 = alloca float
store %struct.buffer* %0, %struct.buffer** %3
store float %1, float* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buffer_write(%struct.buffer* %5, float* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_write_float(%struct.buffer* noalias %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i32 @buffer_write(%struct.buffer* %0, float* %3, i32 4)
ret void
}
void ff_hevc_put_hevc_uni_epel_v4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v4_10_sse4() {
ret void
}
int dash(char c) { return c == '-'; }


x86 assembly (clang, -O0):
<dash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dash>:
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @dash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dash(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = zext i1 %2 to i32
ret i32 %3
}