xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
int /*<<< orphan*/ wifi_pm_gpio_ctrl(char *, int /*<<< orphan*/);
void sif_platform_target_poweroff(void) {
  wifi_pm_gpio_ctrl("esp_wl_rst", 0);
  mdelay(100);
  wifi_pm_gpio_ctrl("esp_wl_chip_en", 0);
  mdelay(100);
}


x86 assembly (clang, -O0):
<sif_platform_target_poweroff>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sif_platform_target_poweroff>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
call   1030 <mdelay@plt>
lea    0xecb(%rip),%rdi
xor    %esi,%esi
call   1040 <wifi_pm_gpio_ctrl@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"esp_wl_rst\00"
@.str.1 = [15 x i8] c"esp_wl_chip_en\00"
define void @sif_platform_target_poweroff() {
%1 = call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @mdelay(i32 100)
%3 = call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = call i32 @mdelay(i32 100)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"esp_wl_rst\00"
@.str.1 = [15 x i8] c"esp_wl_chip_en\00"
define void @sif_platform_target_poweroff() {
%1 = tail call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @mdelay(i32 100)
%3 = tail call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = tail call i32 @mdelay(i32 100)
ret void
}
int in8(unsigned short port) {
  char byte;
  __asm__ volatile("inb %1, %0" : "=a"(byte) : "d"(port));
  return byte;
}


x86 assembly (clang, -O0):
<in8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in8>:
mov    %edi,%edx
in     (%dx),%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @in8(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @in8(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = sext i8 %2 to i32
ret i32 %3
}
void iarch(void) {}


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

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

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

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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ alloc_mtf(int);
int /*<<< orphan*/ free_mtf_table();
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ mtf(int);
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void mtf_list_encode(FILE *in, FILE *out) {
  int c;
  alloc_mtf(256);
  while ((c = getc(in)) != EOF) {
    putc(mtf(c), out);
  }
  free_mtf_table();
}


x86 assembly (clang, -O0):
<mtf_list_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x100,%edi
call   1030 <alloc_mtf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%eax
je     119d <mtf_list_encode+0x4d>
mov    -0x14(%rbp),%edi
call   1040 <mtf@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <putc@plt>
jmp    116a <mtf_list_encode+0x1a>
mov    $0x0,%al
call   1060 <free_mtf_table@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtf_list_encode>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x100,%edi
call   1030 <alloc_mtf@plt>
mov    %rbx,%rdi
call   1070 <getc@plt>
mov    0x2e74(%rip),%r15
cmp    (%r15),%eax
je     119e <mtf_list_encode+0x4e>
nopl   0x0(%rax)
mov    %eax,%edi
call   1040 <mtf@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <putc@plt>
mov    %rbx,%rdi
call   1070 <getc@plt>
cmp    (%r15),%eax
jne    1180 <mtf_list_encode+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <free_mtf_table@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @mtf_list_encode(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @alloc_mtf(i32 256)
br label %7
7: ; preds = %12, %2
%8 = load i32*, i32** %3
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %5
%14 = call i32 @mtf(i32 %13)
%15 = load i32*, i32** %4
%16 = call i32 @putc(i32 %14, i32* %15)
br label %7
17: ; preds = %7
%18 = call i32 (...) @free_mtf_table()
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @mtf_list_encode(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @alloc_mtf(i32 256)
%4 = tail call i32 @getc(i32* %0)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ %4, %2 ]
%9 = tail call i32 @mtf(i32 %8)
%10 = tail call i32 @putc(i32 %9, i32* %1)
%11 = tail call i32 @getc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %7
14: ; preds = %7, %2
%15 = tail call i32 (...) @free_mtf_table()
ret void
}
/* Variables and functions */
int example_3_entry(int, char **);
int main(int argc, char **argv) { return example_3_entry(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <example_3_entry@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @example_3_entry(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help() {
  printf("Usage: %s [OPTIONS] [FILE]\n", "mled");
  printf("Sends a message from stdin as morsecode to your CAPS LOCK led\n");
  printf("\n  -v                       verbose output\n  -t                    "
         "   show time instead of reading from stdin\n  -h                     "
         "  show help\n\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: %s [OPTIONS] [FILE]\0A\00"
@.str.1 = [5 x i8] c"mled\00"
@.str.2 = [63 x i8] c"Sends a message from stdin as morsecode to your CAPS LOCK led\0A\00"
@.str.3 = [149 x i8] c"\0A -v verbose output\0A -t show time instead of reading from stdin\0A -h show help\0A\0A\00"
define void @help() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: %s [OPTIONS] [FILE]\0A\00"
@.str.1 = [5 x i8] c"mled\00"
@str = [62 x i8] c"Sends a message from stdin as morsecode to your CAPS LOCK led\00"
@str.4 = [148 x i8] c"\0A -v verbose output\0A -t show time instead of reading from stdin\0A -h show help\0A\00"
define void @help() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([148 x i8], [148 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ up(int);
void cleanStop(int sig) {
  up(350);
  fprintf(stdout, "[DISPLAY] \t*** Display process stopped ***\n");
  exit(0);
}


x86 assembly (clang, -O0):
<cleanStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x15e,%edi
call   1030 <up@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<cleanStop>:
push   %rax
mov    $0x15e,%edi
call   1030 <up@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [44 x i8] c"[DISPLAY] \09*** Display process stopped ***\0A\00"
define void @cleanStop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @up(i32 350)
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [44 x i8] c"[DISPLAY] \09*** Display process stopped ***\0A\00"
define void @cleanStop(i32 %0) {
%2 = tail call i32 @up(i32 350)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test14(void) {
  return test_sat_parser_should_fail("(a or -bc) andd (-a or c)");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"(a or -bc) andd (-a or c)\00"
define i32 @test14() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i8] c"(a or -bc) andd (-a or c)\00"
define i32 @test14() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
int get_XReparentEvent_send_event(void *_p) {
  return (int)((XReparentEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XReparentEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XReparentEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ libtu_vasprintf(char **, char const *, int /*<<< orphan*/);
char *errmsg_v(const char *p, va_list args) {
  char *res;
  libtu_vasprintf(&res, p, args);
  return res;
}


x86 assembly (clang, -O0):
<errmsg_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1030 <libtu_vasprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errmsg_v>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <libtu_vasprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @errmsg_v(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
%7 = load i32, i32* %4
%8 = call i32 @libtu_vasprintf(i8** %5, i8* %6, i32 %7)
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @errmsg_v(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @libtu_vasprintf(i8** %3, i8* %0, i32 %1)
%6 = load i8*, i8** %3
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help() {
  printf("\n");
  printf("Usage: iceuncompr [input-file [output-file]]\n");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xf01(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [46 x i8] c"Usage: iceuncompr [input-file [output-file]]\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [45 x i8] c"Usage: iceuncompr [input-file [output-file]]\00"
define void @help() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int UartCharPresent(int /*<<< orphan*/);
int char_present(void) { return UartCharPresent(0); }


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

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

LLVM IR (-O0):
define i32 @char_present() {
%1 = call i32 @UartCharPresent(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @char_present() {
%1 = tail call i32 @UartCharPresent(i32 0)
ret i32 %1
}
float point_side_of_line(float px, float py, float x1, float y1, float x2,
                         float y2) {
  return (y2 - y1) * px + (x1 - x2) * py + (x2 * y1 - x1 * y2);
}


x86 assembly (clang, -O0):
<point_side_of_line>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
subss  -0x14(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm3
movss  -0xc(%rbp),%xmm2
mulss  -0x18(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_side_of_line>:
movaps %xmm2,%xmm6
subss  %xmm4,%xmm6
xorps  0xef2(%rip),%xmm2
unpcklps %xmm2,%xmm6
unpcklps %xmm5,%xmm1
subss  %xmm3,%xmm5
mulps  %xmm1,%xmm6
unpcklps %xmm4,%xmm5
unpcklps %xmm3,%xmm0
mulps  %xmm5,%xmm0
addps  %xmm6,%xmm0
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @point_side_of_line(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %12
%14 = load float, float* %10
%15 = fsub float %13, %14
%16 = load float, float* %7
%17 = load float, float* %9
%18 = load float, float* %11
%19 = fsub float %17, %18
%20 = load float, float* %8
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %15, float %16, float %21)
%23 = load float, float* %11
%24 = load float, float* %10
%25 = load float, float* %9
%26 = load float, float* %12
%27 = fmul float %25, %26
%28 = fneg float %27
%29 = call float @llvm.fmuladd.f32(float %23, float %24, float %28)
%30 = fadd float %22, %29
ret float %30
}

LLVM IR (-O2):
define float @point_side_of_line(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fsub float %5, %3
%8 = fsub float %2, %4
%9 = fneg float %2
%10 = insertelement <2 x float> poison, float %8, i64 0
%11 = insertelement <2 x float> %10, float %9, i64 1
%12 = insertelement <2 x float> poison, float %1, i64 0
%13 = insertelement <2 x float> %12, float %5, i64 1
%14 = fmul <2 x float> %11, %13
%15 = insertelement <2 x float> poison, float %4, i64 1
%16 = insertelement <2 x float> %15, float %7, i64 0
%17 = insertelement <2 x float> poison, float %0, i64 0
%18 = insertelement <2 x float> %17, float %3, i64 1
%19 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %16, <2 x float> %18, <2 x float> %14)
%20 = shufflevector <2 x float> %19, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%21 = fadd <2 x float> %19, %20
%22 = extractelement <2 x float> %21, i64 0
ret float %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main(int argc, char *argv[]) {
  char *firstString = "Mark";
  char *secondString = "Lassoff";
  printf("The first string is %X characters long. \n", strlen(firstString));
  printf("The second string is %x characters long.", strlen(secondString));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <strlen@plt>
lea    0xee9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Mark\00"
@.str.1 = [8 x i8] c"Lassoff\00"
@.str.2 = [42 x i8] c"The first string is %X characters long. \0A\00"
@.str.3 = [41 x i8] c"The second string is %x characters long.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Mark\00"
@.str.1 = [8 x i8] c"Lassoff\00"
@.str.2 = [42 x i8] c"The first string is %X characters long. \0A\00"
@.str.3 = [41 x i8] c"The second string is %x characters long.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %5)
ret i32 0
}
void startup_modem(void) {}


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

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

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

LLVM IR (-O2):
define void @startup_modem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init();
int /*<<< orphan*/ play();
scalar_t__ play_again();
int /*<<< orphan*/ printf(char *);
int main(void) {
  init();
  do {
    play();
  } while (play_again());
  printf("\nIt's been fun! So long Admiral!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1050 <play@plt>
mov    $0x0,%al
call   1040 <play_again@plt>
cmp    $0x0,%rax
jne    1166 <main+0x16>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <play@plt>
xor    %eax,%eax
call   1040 <play_again@plt>
test   %rax,%rax
jne    1160 <main+0x10>
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AIt's been fun! So long Admiral!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
br label %3
3: ; preds = %5, %0
%4 = call i32 (...) @play()
br label %5
5: ; preds = %3
%6 = call i64 (...) @play_again()
%7 = icmp ne i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"\0AIt's been fun! So long Admiral!\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @play()
%4 = tail call i64 (...) @play_again()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
GetBytes(rgDst, cbDst, iError) char rgDst[];
int cbDst;
int iError;
{
  int iDst;
  for (iDst = 0; iDst < cbDst; iDst++)
    rgDst[iDst] = GetByte(iError);
}


x86 assembly (clang, -O0):
<GetBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <GetBytes+0x4a>
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1030 <GetByte@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <GetBytes+0x19>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBytes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <GetBytes+0x37>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <GetByte@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <GetBytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @GetBytes(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @GetByte to i32 (i32, ...)*)(i32 %2)
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void admin_code() { printf("Admin code executed!\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Admin code executed!\0A\00"
define void @admin_code() {
%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"Admin code executed!\00"
define void @admin_code() {
%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 */
float sin(float);
float _sin(float s) { return sin(s); }


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

x86 assembly (clang, -O2):
<_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @_sin(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
int sas_parse_mcot(char *Temperature) {
  if ((Temperature[10] == 0) && (Temperature[11] == 1))
    return Temperature[15];
  else
    return 0;
}


x86 assembly (clang, -O0):
<sas_parse_mcot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0xa(%rax),%eax
cmp    $0x0,%eax
jne    113a <sas_parse_mcot+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0xb(%rax),%eax
cmp    $0x1,%eax
jne    113a <sas_parse_mcot+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0xf(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <sas_parse_mcot+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_parse_mcot>:
xor    %eax,%eax
cmpb   $0x0,0xa(%rdi)
je     1109 <sas_parse_mcot+0x9>
ret
cmpb   $0x1,0xb(%rdi)
jne    1108 <sas_parse_mcot+0x8>
movsbl 0xf(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sas_parse_mcot(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 10
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 11
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 15
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %1, %5, %9
%14 = phi i32 [ %12, %9 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int roll(void) {
  int roll;
  float number;
  number = (float)rand() / ((float)RAND_MAX);
  number = number * 6.0;
  roll = (int)number;
  roll++;
  return roll;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ebd(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  0xecb(%rip),%xmm0
cvttss2si %xmm0,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @roll() {
%1 = alloca i32
%2 = alloca float
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
store float %7, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %9, 6.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %2
%12 = load float, float* %2
%13 = fptosi float %12 to i32
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @roll() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
%6 = fmul float %5, 6.000000e+00
%7 = fptosi float %6 to i32
%8 = add nsw i32 %7, 1
ret i32 %8
}
tolower(c) char c;
{ return ((c >= 'A' && c <= 'Z') ? c += '\040' : c); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1139 <tolower+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1139 <tolower+0x39>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <tolower+0x40>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    0x20(%rdi),%ecx
movsbl %dil,%eax
mov    %edi,%edx
shl    $0x18,%edx
add    $0xbfffffff,%edx
cmp    $0x1affffff,%edx
movzbl %cl,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = sext i8 %15 to i32
br label %20
17: ; preds = %7, %1
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
br label %20
20: ; preds = %17, %11
%21 = phi i32 [ %16, %11 ], [ %19, %17 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = add i32 %0, 32
%6 = and i32 %5, 255
%7 = ashr exact i32 %2, 24
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

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


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

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

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

LLVM IR (-O2):
define i32 @hidpp_get_unaligned_le_u16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %0
%6 = or i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ wyrand();
uint32_t wyrand_cast32(void) { return (uint32_t)wyrand(); }


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

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

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

LLVM IR (-O2):
define i32 @wyrand_cast32() {
%1 = tail call i32 (...) @wyrand()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ calculate_the_maximum(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  calculate_the_maximum(n, k);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @calculate_the_maximum(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @calculate_the_maximum(i32 %6, i32 %7)
ret i32 0
}
void RTSemMutexCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemMutexCreate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void print_greetings_patched(void) {
  while (1) {
    printf("Hello. This a PATCHED version!\n");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<print_greetings_patched>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <print_greetings_patched+0x9>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1129 <print_greetings_patched+0x9>

x86 assembly (clang, -O2):
<print_greetings_patched>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <print_greetings_patched+0x10>

LLVM IR (-O0):
@.str = [32 x i8] c"Hello. This a PATCHED version!\0A\00"
define void @print_greetings_patched() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
@str = [31 x i8] c"Hello. This a PATCHED version!\00"
define void @print_greetings_patched() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
int /*<<< orphan*/ __coverity_mark_as_afm_freed__(void *, char *);
void H5Fclose(void *id) {
  __coverity_free__(id);
  __coverity_mark_as_afm_freed__(id, "H5Fclose");
}


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

x86 assembly (clang, -O2):
<H5Fclose>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__coverity_free__@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__coverity_mark_as_afm_freed__@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"H5Fclose\00"
define void @H5Fclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__coverity_free__(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @__coverity_mark_as_afm_freed__(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Fclose\00"
define void @H5Fclose(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
%3 = tail call i32 @__coverity_mark_as_afm_freed__(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
double clamp(double min, double max, double val) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <clamp+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <clamp+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <clamp+0x5f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minsd  %xmm2,%xmm1
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %5
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %7
%15 = load double, double* %6
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %6
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %7
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @clamp(double %0, double %1, double %2) {
%4 = fcmp olt double %2, %0
%5 = fcmp ogt double %2, %1
%6 = select i1 %5, double %1, double %2
%7 = select i1 %4, double %0, double %6
ret double %7
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
scalar_t__ tcgetattr(int, struct termios *);
int isatty(int fd) {
  struct termios t;
  return tcgetattr(fd, &t) == 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    %rsp,%rsi
call   1030 <tcgetattr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @tcgetattr(i32 %4, %struct.termios* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = call i64 @tcgetattr(i32 %0, %struct.termios* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void __attribute__((__no__)) load_fpr(long *a, long *b) {
  long c = *a;
  __asm__("# fpr, reg = %0" : "+d"(c));
  *b = c;
}


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

x86 assembly (clang, -O2):
<load_fpr>:
mov    (%rdi),%rdx
mov    %rdx,(%rsi)
ret

LLVM IR (-O0):
define void @load_fpr(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = call i64 asm "# fpr, reg = $0", "={dx},0,~{dirflag},~{fpsr},~{flags}"(i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64*, i64** %4
store i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
define void @load_fpr(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = tail call i64 asm "# fpr, reg = $0", "={dx},0,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %1
ret void
}
/* Type definitions */
typedef int len;

/* Variables and functions */
size_t h2o_base64_encode_capacity(size_t len) {
  return (((len) + 2) / 3 * 4 + 1);
}


x86 assembly (clang, -O0):
<h2o_base64_encode_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_base64_encode_capacity>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @h2o_base64_encode_capacity(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = udiv i64 %4, 3
%6 = mul i64 %5, 4
%7 = add i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @h2o_base64_encode_capacity(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = or i64 %4, 1
ret i64 %5
}
int _default_poly_count(void *self) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_default_poly_count(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t __get_unaligned_le32(const uint8_t *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

x86 assembly (clang, -O2):
<__get_unaligned_le32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__get_unaligned_le32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}