xunge/DecIR huggingface dataset:
/* Variables and functions */
int yas_l3g4200d_read_reg(unsigned char, unsigned char *, int);
int yas_l3g4200d_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_l3g4200d_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_l3g4200d_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_l3g4200d_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_l3g4200d_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_l3g4200d_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_l3g4200d_read_reg_byte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
%6 = load i8, i8* %3
%7 = call i32 @yas_l3g4200d_read_reg(i8 zeroext %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_l3g4200d_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_l3g4200d_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
int test_imm_F7int16_reg(short val) {
  return ((val) & (0xF7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xf7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F7int16_reg(i16 signext %0) {
%2 = and i16 %0, 247
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ nocbreak();
void display_close() {
  nocbreak();
  endwin();
}


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

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

LLVM IR (-O0):
define void @display_close() {
%1 = call i32 (...) @nocbreak()
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @display_close() {
%1 = tail call i32 (...) @nocbreak()
%2 = tail call i32 (...) @endwin()
ret void
}
int test_imm_4Fint16_reg(short val) {
  return ((val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x4f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Fint16_reg(i16 signext %0) {
%2 = and i16 %0, 79
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_set_volume_func() {
  printf("NOT IMPLEMENTED:"
         "pa_set_volume_func"
         "\n");
}


x86 assembly (clang, -O0):
<pa_set_volume_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_set_volume_func\0A\00"
define i32 @pa_set_volume_func() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_set_volume_func\00"
define i32 @pa_set_volume_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int hex2bin(unsigned char *hbuf, int hlen, unsigned char **bbuf, int *blen) {
  return 0;
}


x86 assembly (clang, -O0):
<hex2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hex2bin(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PCI_DEV(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ set_nbmisc_enable_bits(int /*<<< orphan*/, int, int, int);
void enable_rs690_dev8(void) {
  set_nbmisc_enable_bits(PCI_DEV(0, 0, 0), 0x00, 1 << 6, 1 << 6);
}


x86 assembly (clang, -O0):
<enable_rs690_dev8>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <PCI_DEV@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x40,%ecx
mov    %ecx,%edx
call   1030 <set_nbmisc_enable_bits@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_rs690_dev8>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <PCI_DEV@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0x40,%edx
mov    $0x40,%ecx
pop    %rax
jmp    1030 <set_nbmisc_enable_bits@plt>

LLVM IR (-O0):
define void @enable_rs690_dev8() {
%1 = call i32 @PCI_DEV(i32 0, i32 0, i32 0)
%2 = call i32 @set_nbmisc_enable_bits(i32 %1, i32 0, i32 64, i32 64)
ret void
}

LLVM IR (-O2):
define void @enable_rs690_dev8() {
%1 = tail call i32 @PCI_DEV(i32 0, i32 0, i32 0)
%2 = tail call i32 @set_nbmisc_enable_bits(i32 %1, i32 0, i32 64, i32 64)
ret void
}
int bar(char c) { return c == '|'; }


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

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

LLVM IR (-O0):
define i32 @bar(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, 124
%6 = zext i1 %5 to i32
ret i32 %6
}

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


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

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

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

LLVM IR (-O2):
define void @set_eth_frame_mac_spoofing() {
ret void
}
int rand_hash2(int r) {
  r = 1664525 * r ^ 1013904223;
  r = 1664525 * r ^ 1013904223;
  return r;
}


x86 assembly (clang, -O0):
<rand_hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x19660d,-0x4(%rbp),%eax
xor    $0x3c6ef35f,%eax
mov    %eax,-0x4(%rbp)
imul   $0x19660d,-0x4(%rbp),%eax
xor    $0x3c6ef35f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_hash2>:
imul   $0x19660d,%edi,%eax
xor    $0x3c6ef35f,%eax
imul   $0x19660d,%eax,%eax
xor    $0x3c6ef35f,%eax
ret

LLVM IR (-O0):
define i32 @rand_hash2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1664525, %3
%5 = xor i32 %4, 1013904223
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 1664525, %6
%8 = xor i32 %7, 1013904223
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_hash2(i32 %0) {
%2 = mul nsw i32 %0, 1664525
%3 = xor i32 %2, 1013904223
%4 = mul nsw i32 %3, 1664525
%5 = xor i32 %4, 1013904223
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_accept_cloexec() {
  printf("NOT IMPLEMENTED:"
         "pa_accept_cloexec"
         "\n");
}


x86 assembly (clang, -O0):
<pa_accept_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_accept_cloexec\0A\00"
define i32 @pa_accept_cloexec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_accept_cloexec\00"
define i32 @pa_accept_cloexec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int ac_test_run();
int /*<<< orphan*/ printf(char *);
int main() {
  int r;
  printf("starting test\n\n");
  r = ac_test_run();
  return r ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ac_test_run@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <ac_test_run@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"starting test\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @ac_test_run()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
@str = [15 x i8] c"starting test\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @ac_test_run()
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *prog) {
  fprintf(stderr,
          "Usage: %s [options] <gcode-file> [<gcode-file> ..]\n"
          "Options:\n"
          "\t-m <max-feedrate> : Maximum feedrate in mm/s\n"
          "\t-f <factor>       : Speedup-factor for print\n"
          "\t-H                : Toggle print header line\n"
          "Use filename '-' for stdin.\n",
          prog);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [227 x i8] c"Usage: %s [options] <gcode-file> [<gcode-file> ..]\0AOptions:\0A\09-m <max-feedrate> : Maximum feedrate in mm/s\0A\09-f <factor> : Speedup-factor for print\0A\09-H : Toggle print header line\0AUse filename '-' for stdin.\0A\00"
define i32 @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 ([227 x i8], [227 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [227 x i8] c"Usage: %s [options] <gcode-file> [<gcode-file> ..]\0AOptions:\0A\09-m <max-feedrate> : Maximum feedrate in mm/s\0A\09-f <factor> : Speedup-factor for print\0A\09-H : Toggle print header line\0AUse filename '-' for stdin.\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
void draw_stats_border() {}


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

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

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

LLVM IR (-O2):
define void @draw_stats_border() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strdup(char const *);
char *Strdup(const char *s) {
  char *retval;
  assert(s != NULL);
  retval = strdup(s);
  if (retval == NULL)
    Sys_failure("strdup");
  return retval;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <Strdup+0x42>
lea    0xe93(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <Strdup+0x2e>
lea    0xea7(%rip),%rdi
call   1040 <Sys_failure@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @Strdup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @strdup(i8* %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ omb_utils_save(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void omb_utils_save_int(const char *key, int value) {
  char tmp[255];
  sprintf(tmp, "%d", value);
  omb_utils_save(key, tmp);
}


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

x86 assembly (clang, -O2):
<omb_utils_save_int>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <omb_utils_save@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @omb_utils_save_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @omb_utils_save(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @omb_utils_save_int(i8* %0, i32 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @omb_utils_save(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int OK;
int PDC_set_ctrl_break(bool setting) { return (OK); }


x86 assembly (clang, -O0):
<PDC_set_ctrl_break>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_set_ctrl_break>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_set_ctrl_break(i32 %0) {
%2 = load i32, i32* @OK
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float fast_sqrt(float a) {
  union fu32_u {
    float f;
    uint32_t u;
  };
  union fu32_u x;
  x.f = a;
  x.u += 0x7f << 23;
  x.u >>= 1;
  return x.f;
}


x86 assembly (clang, -O0):
<fast_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3f800000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_sqrt>:
movd   %xmm0,%eax
add    $0x3f800000,%eax
sar    %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.fu32_u = type { float }
define float @fast_sqrt(float %0) {
%2 = alloca float
%3 = alloca %union.fu32_u
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.fu32_u* %3 to float*
store float %4, float* %5
%6 = bitcast %union.fu32_u* %3 to i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1065353216
store i32 %8, i32* %6
%9 = bitcast %union.fu32_u* %3 to i32*
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
store i32 %11, i32* %9
%12 = bitcast %union.fu32_u* %3 to float*
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
define float @fast_sqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = add nsw i32 %2, 1065353216
%4 = ashr i32 %3, 1
%5 = bitcast i32 %4 to float
ret float %5
}
int get_pattern(int y, int x) {
  switch (x % 3) {
  case 0:
    return 1;
    break;
  case 1:
    return 2;
    break;
  case 2:
    return 3;
    break;
  };
  return 1;
}


x86 assembly (clang, -O0):
<get_pattern>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    %ecx,%eax
imul   $0x55555556,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
je     115b <get_pattern+0x5b>
jmp    1139 <get_pattern+0x39>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1167 <get_pattern+0x67>
jmp    114a <get_pattern+0x4a>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1173 <get_pattern+0x73>
jmp    117f <get_pattern+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    1186 <get_pattern+0x86>
movl   $0x2,-0x4(%rbp)
jmp    1186 <get_pattern+0x86>
movl   $0x3,-0x4(%rbp)
jmp    1186 <get_pattern+0x86>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pattern>:
movslq %esi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    $0x1,%ecx
cmp    $0x2,%eax
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_pattern(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 3
switch i32 %7, label %11 [
i32 0, label %8
i32 1, label %9
i32 2, label %10
]
8: ; preds = %2
store i32 1, i32* %3
br label %12
9: ; preds = %2
store i32 2, i32* %3
br label %12
10: ; preds = %2
store i32 3, i32* %3
br label %12
11: ; preds = %2
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10, %9, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_pattern(i32 %0, i32 %1) {
%3 = srem i32 %1, 3
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i32 2, i32 1
%6 = icmp eq i32 %3, 2
%7 = select i1 %6, i32 3, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyVec4_init(void) {
  _hmt_register_covercase("HMM_MultiplyVec4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_MultiplyVec4_init>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HMM_MultiplyVec4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec4_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HMM_MultiplyVec4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_func(void) { printf("test_func: version 1\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"test_func: version 1\00"
define void @test_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ptn_free();
int /*<<< orphan*/ ptn_stop_station();
void ptn_end(int sig) {
  ptn_stop_station();
  ptn_free();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<ptn_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ptn_stop_station@plt>
mov    $0x0,%al
call   1030 <ptn_free@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ptn_end>:
push   %rax
xor    %eax,%eax
call   1040 <ptn_stop_station@plt>
xor    %eax,%eax
call   1030 <ptn_free@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @ptn_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ptn_stop_station()
%4 = call i32 (...) @ptn_free()
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @ptn_end(i32 %0) {
%2 = tail call i32 (...) @ptn_stop_station()
%3 = tail call i32 (...) @ptn_free()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void zapit(s, n) float *s;
int n;
{
  while (n--) {
    s[0] = 0.0;
    s++;
  }
}


x86 assembly (clang, -O0):
<zapit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113b <zapit+0x3b>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <zapit+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zapit>:
test   %esi,%esi
je     1126 <zapit+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zapit(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float 0.000000e+00, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i32 1
store float* %13, float** %3
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @zapit(float* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
double outer_radius(double, double *, double *);
double radius_effective(int mode, double fp_n_shells, double thickness[],
                        double interface[]) {
  return outer_radius(fp_n_shells, thickness, interface);
}


x86 assembly (clang, -O0):
<radius_effective>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <outer_radius@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_effective>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <outer_radius@plt>

LLVM IR (-O0):
define double @radius_effective(i32 %0, double %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %6
%10 = load double*, double** %7
%11 = load double*, double** %8
%12 = call double @outer_radius(double %9, double* %10, double* %11)
ret double %12
}

LLVM IR (-O2):
define double @radius_effective(i32 %0, double %1, double* %2, double* %3) {
%5 = tail call double @outer_radius(double %1, double* %2, double* %3)
ret double %5
}
int test_imm_BAuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xBA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BAuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 798863917056
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void socket_close(int sockfd) { close(sockfd); }


x86 assembly (clang, -O0):
<socket_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):
<socket_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @socket_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 @socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void hexdump(void *addr, int len) {
  unsigned char *c = addr;
  while (len > 0) {
    printf(" %02x", *c);
    c++;
    len--;
  }
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115e <hexdump+0x4e>
mov    -0x18(%rbp),%rax
lea    0xec4(%rip),%rdi
movzbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <hexdump+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <hexdump+0x37>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <hexdump+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c" %02x\00"
define void @hexdump(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = add nsw i32 %6, -1
%11 = icmp ugt i32 %6, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ pexit(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
void deleteSharedMem(int id) {
  if (shmctl(id, IPC_RMID, NULL) == -1)
    pexit("shmctl");
}


x86 assembly (clang, -O0):
<deleteSharedMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1155 <deleteSharedMem+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <pexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteSharedMem>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1138 <deleteSharedMem+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <pexit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define void @deleteSharedMem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define void @deleteSharedMem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_buttons();
int /*<<< orphan*/ update_slide();
int /*<<< orphan*/ update_sound();
void update_input() {
  update_buttons();
  update_slide();
  update_sound();
}


x86 assembly (clang, -O0):
<update_input>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <update_buttons@plt>
mov    $0x0,%al
call   1050 <update_slide@plt>
mov    $0x0,%al
call   1040 <update_sound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_input>:
push   %rax
xor    %eax,%eax
call   1030 <update_buttons@plt>
xor    %eax,%eax
call   1050 <update_slide@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_sound@plt>

LLVM IR (-O0):
define void @update_input() {
%1 = call i32 (...) @update_buttons()
%2 = call i32 (...) @update_slide()
%3 = call i32 (...) @update_sound()
ret void
}

LLVM IR (-O2):
define void @update_input() {
%1 = tail call i32 (...) @update_buttons()
%2 = tail call i32 (...) @update_slide()
%3 = tail call i32 (...) @update_sound()
ret void
}
int CPhidgetManager_areEqual(void *arg1, void *arg2) {
  if (arg1 == arg2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CPhidgetManager_areEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <CPhidgetManager_areEqual+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <CPhidgetManager_areEqual+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPhidgetManager_areEqual>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @CPhidgetManager_areEqual(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Fatorial de 5: %d", fatorial(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <fatorial@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Fatorial de 5: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fatorial(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Fatorial de 5: %d\00"
define i32 @main() {
%1 = tail call i32 @fatorial(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void ff_print_debug_info2() {}


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

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

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

LLVM IR (-O2):
define void @ff_print_debug_info2() {
ret void
}
double F_modeShapeQuad(int p, int i, double *L) { return 0.0; }


x86 assembly (clang, -O0):
<F_modeShapeQuad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_modeShapeQuad>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @F_modeShapeQuad(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @F_modeShapeQuad(i32 %0, i32 %1, double* nocapture readnone %2) {
ret double 0.000000e+00
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_36(uint64_t x) {
  __asm__("rolq $36, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_36>:
mov    %rdi,%rax
rol    $0x24,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_36(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$36, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_36(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$36, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int lrand();
int rand(void) { return lrand() & 0x7fff; }


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lrand@plt>
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
push   %rax
xor    %eax,%eax
call   1030 <lrand@plt>
and    $0x7fff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand() {
%1 = call i32 (...) @lrand()
%2 = and i32 %1, 32767
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i32 (...) @lrand()
%2 = and i32 %1, 32767
ret i32 %2
}
/* Variables and functions */
bool nrf53_errata_110(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_110() {
ret i32 0
}
void __DELETE_java_lang_System(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_System(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_System(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *g(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @g(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @g(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int test_imm_2Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x2F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 201863462912
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void LK_Key1_init(void) {}


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

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

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

LLVM IR (-O2):
define void @LK_Key1_init() {
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_write_cmd(struct flashrom_flashctx *, int, int, unsigned int,
                  int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int spi_block_erase_81(struct flashrom_flashctx *flash, unsigned int addr,
                       unsigned int blocklen) {
  return spi_write_cmd(flash, 0x81, false, addr, NULL, 0, 1 * 1000);
}


x86 assembly (clang, -O0):
<spi_block_erase_81>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x81,%esi
xor    %r9d,%r9d
xor    %eax,%eax
mov    %eax,%r8d
mov    %r9d,%edx
movl   $0x3e8,(%rsp)
call   1030 <spi_write_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_block_erase_81>:
push   %rax
mov    %esi,%ecx
movl   $0x3e8,(%rsp)
mov    $0x81,%esi
xor    %edx,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <spi_write_cmd@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_81(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca %struct.flashrom_flashctx*
%5 = alloca i32
%6 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %4
%8 = load i32, i32* %5
%9 = call i32 @spi_write_cmd(%struct.flashrom_flashctx* %7, i32 129, i32 0, i32 %8, i32* null, i32 0, i32 1000)
ret i32 %9
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_block_erase_81(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = tail call i32 @spi_write_cmd(%struct.flashrom_flashctx* %0, i32 129, i32 0, i32 %1, i32* null, i32 0, i32 1000)
ret i32 %4
}
char *strtolower(char *str) {
  char *s = str;
  while (*s) {
    if (*s >= 'A' && *s <= 'Z')
      *s += ('a' - 'A');
    ++s;
  }
  return str;
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strtolower+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <strtolower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <strtolower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strtolower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strtolower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strtolower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strtolower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strtolower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strtolower+0x10>
ret

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

LLVM IR (-O2):
define i8* @strtolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}