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

/* Variables and functions */
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
void st_i16_be(void *x, int16_t i) { ((int16_t *)x)[0] = htobe16(i); }


x86 assembly (clang, -O0):
<st_i16_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htobe16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_i16_be>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @st_i16_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htobe16(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %6, i32* %9
ret void
}

LLVM IR (-O2):
define void @st_i16_be(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe16(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
SP_CASE(imacro, imetamacro_exprify) {
  SP_TRUE(1);
  ilog("((1, 2, 3), true)");
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <ilog@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <SP_TRUE@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <ilog@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"((1, 2, 3), true)\00"
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @ilog to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"((1, 2, 3), true)\00"
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ilog to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *shell_quote_copy(char *, char const *);
size_t shell_quote_length(char const *);
scalar_t__ xmalloc(size_t);
char *shell_quote(const char *string) {
  size_t length = shell_quote_length(string);
  char *quoted = (char *)xmalloc(length + 1);
  char *p = shell_quote_copy(quoted, string);
  *p = '\0';
  return quoted;
}


x86 assembly (clang, -O0):
<shell_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <shell_quote_length@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <shell_quote_copy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_quote>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <shell_quote_length@plt>
lea    0x1(%rax),%rdi
call   1030 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <shell_quote_copy@plt>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @shell_quote(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @shell_quote_length(i8* %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add i64 %8, 1
%10 = call i64 @xmalloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = call i8* @shell_quote_copy(i8* %12, i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
store i8 0, i8* %15
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @shell_quote(i8* %0) {
%2 = tail call i64 @shell_quote_length(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i64 @xmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @shell_quote_copy(i8* %5, i8* %0)
store i8 0, i8* %6
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test(char *ab) { printf("%s", ab); }


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

x86 assembly (clang, -O2):
<test>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @test(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void transfer_RGB888_to_BGR8888(unsigned char *(*output),
                                unsigned char *input) {
  *(*output)++ = input[2];
  *(*output)++ = input[1];
  *(*output)++ = input[0];
  (*output)++;
}


x86 assembly (clang, -O0):
<transfer_RGB888_to_BGR8888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_RGB888_to_BGR8888>:
mov    0x2(%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    0x1(%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    (%rsi),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
addq   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @transfer_RGB888_to_BGR8888(i8** nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 2
%4 = load i8, i8* %3
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %0
store i8 %4, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
store i8 %8, i8* %9
%11 = load i8, i8* %1
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %0
store i8 %11, i8* %12
%14 = load i8*, i8** %0
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_UART_TXD1_PIN() { set_io_bit(0x43, 3); }


x86 assembly (clang, -O0):
<TOSH_SET_UART_TXD1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_UART_TXD1_PIN>:
mov    $0x43,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_UART_TXD1_PIN() {
%1 = call i32 @set_io_bit(i32 67, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_UART_TXD1_PIN() {
%1 = tail call i32 @set_io_bit(i32 67, i32 3)
ret void
}
TOSH_INTERRUPT(SIG_UART0_RECV) {}


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

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

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

LLVM IR (-O2):
define i32 @TOSH_INTERRUPT(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos4s(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) {
  glRasterPos4s(x, y, z, w);
}


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

x86 assembly (clang, -O2):
<RasterPos4s>:
jmp    1030 <glRasterPos4s@plt>

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

LLVM IR (-O2):
define void @RasterPos4s(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glRasterPos4s(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void signal_handler(int sig) {
  if (signal(SIGINT, SIG_IGN) == SIG_ERR) {
    fprintf(stderr, "cannot set signal handler to SIG_IGN\n");
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <signal_handler+0x47>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    115a <signal_handler+0x3a>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@stderr = global i32 0
@.str = [38 x i8] c"cannot set signal handler to SIG_IGN\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* @SIG_IGN
%5 = call i64 @signal(i32 %3, i32 %4)
%6 = load i64, i64* @SIG_ERR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@stderr = global i32 0
@.str = [38 x i8] c"cannot set signal handler to SIG_IGN\0A\00"
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = load i32, i32* @SIG_IGN
%4 = tail call i64 @signal(i32 %2, i32 %3)
%5 = load i64, i64* @SIG_ERR
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_fragment_flush() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_fragment_flush>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_fragment_flush>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_fragment_flush() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_fragment_flush() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void set16le(uint8_t *bytes, uint16_t x) {
  bytes[0] = (uint8_t)x;
  bytes[1] = (uint8_t)(x >> 8);
}


x86 assembly (clang, -O0):
<set16le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set16le>:
movslq %esi,%rax
mov    %rax,(%rdi)
sar    $0x8,%eax
cltq
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @set16le(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
ret void
}

LLVM IR (-O2):
define void @set16le(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = ashr i32 %1, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
ret void
}
char *ltrim(char *str) {
  while (*str == ' ')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <ltrim+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ltrim+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <ltrim+0x10>
ret

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

LLVM IR (-O2):
define i8* @ltrim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, World");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
short smax(short, short);
short smin(short, short);
short sClip3(short low, short high, short x) {
  x = smax(x, low);
  x = smin(x, high);
  return x;
}


x86 assembly (clang, -O0):
<sClip3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
movswl %ax,%edi
movswl -0x2(%rbp),%esi
call   1040 <smax@plt>
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <smin@plt>
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sClip3>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    %edx,%edi
call   1040 <smax@plt>
movswl %ax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <smin@plt>

LLVM IR (-O0):
define signext i16 @sClip3(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %6
%8 = load i16, i16* %4
%9 = call signext i16 @smax(i16 signext %7, i16 signext %8)
store i16 %9, i16* %6
%10 = load i16, i16* %6
%11 = load i16, i16* %5
%12 = call signext i16 @smin(i16 signext %10, i16 signext %11)
store i16 %12, i16* %6
%13 = load i16, i16* %6
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @sClip3(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = tail call signext i16 @smax(i16 signext %2, i16 signext %0)
%5 = tail call signext i16 @smin(i16 signext %4, i16 signext %1)
ret i16 %5
}
int execute_timer_create() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_timer_create() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_showmem(char *, int);
int main(void) {
  my_showmem("abcde..........", 15);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"abcde..........\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @my_showmem(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"abcde..........\00"
define i32 @main() {
%1 = tail call i32 @my_showmem(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fabsd(int s, int d) {
  assert(s == 31);
  assert(d == 31);
  assem_debug("fabsd d%d,d%d", d, s);
  output_w32(0x1e60c000 | s << 5 | d);
}


x86 assembly (clang, -O0):
<emit_fabsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x4(%rbp),%edi
shl    $0x5,%edi
or     $0x1e60c000,%edi
or     -0x8(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fabsd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1f,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e60c000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fabsd d%d,d%d\00"
define void @emit_fabsd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 31
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %3
%17 = shl i32 %16, 5
%18 = or i32 509657088, %17
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = call i32 @output_w32(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fabsd d%d,d%d\00"
define void @emit_fabsd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 31
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%10 = shl i32 %0, 5
%11 = or i32 %10, %1
%12 = or i32 %11, 509657088
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
/* Variables and functions */
char *TR_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *TR_strdup(const char *src) {
  char *dup;
  if (NULL == src) {
    return NULL;
  }
  dup = TR_malloc(strlen(src) + 1);
  strcpy(dup, src);
  return dup;
}


x86 assembly (clang, -O0):
<TR_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1155 <TR_strdup+0x25>
movq   $0x0,-0x8(%rbp)
jmp    1183 <TR_strdup+0x53>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <TR_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TR_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <TR_strdup+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <TR_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <TR_strdup+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @TR_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i8* @TR_malloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %8, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @TR_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @TR_malloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
void mov(p, s, sz) struct h8_opcode *p;
char *s;
int sz;
{ printf("dst = srca;\n"); }


x86 assembly (clang, -O0):
<mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [13 x i8] c"dst = srca;\0A\00"
define void @mov(%struct.h8_opcode* %0, i8* %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i8*
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@str = [12 x i8] c"dst = srca;\00"
define void @mov(%struct.h8_opcode* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void simple_print(const void *msg) { printf("%s", (const char *)msg); }


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

x86 assembly (clang, -O2):
<simple_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

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


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

x86 assembly (clang, -O2):
<list>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [2 x i8] c"1\00"
@str = [5 x i8] c"list\00"
define i8* @list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
}
long mine(const long a, const long b) {
  if (a > b) {
    return b;
  } else if (b > a) {
    return a;
  } else if (b == a) {
    return a;
  }
}


x86 assembly (clang, -O0):
<mine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <mine+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <mine+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1142 <mine+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <mine+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    115d <mine+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <mine+0x67>
jmp    1162 <mine+0x62>
jmp    1167 <mine+0x67>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mine>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @mine(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
OP(dd, d1) {
  illegal_1();
  op_d1();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <illegal_1@plt>
mov    $0x0,%al
call   1030 <op_d1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d1()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void EraseScrFromCur() { WRITETEST("\033[J"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[J\00"
define void @EraseScrFromCur() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void ARGB4444ToARGBRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGB4444ToARGBRow_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2(int, int);
int main() {
  func2(1111, 2222);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func2(i32 1111, i32 2222)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
scalar_t__ __gettemp(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
char *mktemp(char *path) {
  _DIAGASSERT(path != NULL);
  return __gettemp(path, NULL, 0) ? path : NULL;
}


x86 assembly (clang, -O0):
<mktemp>:
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 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <__gettemp@plt>
cmp    $0x0,%rax
je     1164 <mktemp+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <mktemp+0x4f>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    116f <mktemp+0x4f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <__gettemp@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mktemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @__gettemp(i8* %7, i32* null, i32 0)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i8*, i8** %2
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %10
%14 = phi i8* [ %11, %10 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @mktemp(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i64 @__gettemp(i8* %0, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* null, i8* %0
ret i8* %7
}
/* Variables and functions */
int rom_present(char *);
int xtide_ps2_available() { return rom_present("roms/ide_at_1_1_5.bin"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"roms/ide_at_1_1_5.bin\00"
define i32 @xtide_ps2_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [22 x i8] c"roms/ide_at_1_1_5.bin\00"
define i32 @xtide_ps2_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) {
  zend_bailout();
  ZEND_VM_NEXT_OPCODE();
}


x86 assembly (clang, -O0):
<ZEND_EXIT_SPEC_TMP_HANDLER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <zend_bailout@plt>
mov    $0x0,%al
call   1040 <ZEND_VM_NEXT_OPCODE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ZEND_EXIT_SPEC_TMP_HANDLER(i32 %0) {
%2 = tail call i32 (...) @zend_bailout()
%3 = tail call i32 (...) @ZEND_VM_NEXT_OPCODE()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
char *strchr(char *, char);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *time2string(void) {
  time_t t;
  char *date;
  time(&t);
  date = ctime(&t);
  if (date != NULL) {
    char *cr = strchr(date, '\n');
    if (cr != NULL) {
      cr[0] = '\t';
    }
  }
  return date;
}


x86 assembly (clang, -O0):
<time2string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1182 <time2string+0x52>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <time2string+0x4d>
mov    -0x18(%rbp),%rax
movb   $0x9,(%rax)
jmp    1182 <time2string+0x52>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time2string>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1167 <time2string+0x37>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1167 <time2string+0x37>
movb   $0x9,(%rax)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @time2string() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 @time(i32* %1)
%5 = call i8* @ctime(i32* %1)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %17
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i8* @strchr(i8* %9, i8 signext 10)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 9, i8* %15
br label %16
16: ; preds = %13, %8
br label %17
17: ; preds = %16, %0
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @time2string() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = call i8* @strchr(i8* %4, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6
store i8 9, i8* %7
br label %10
10: ; preds = %6, %9, %0
ret i8* %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat statbuf;
  if (stat(path, &statbuf) == 0)
    return S_ISDIR(statbuf.st_mode) != 0;
  return 0;
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115f <is_dir+0x3f>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <is_dir+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_dir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void test(jmp_buf *env) {
  printf("1....\n");
  longjmp(*env, 10);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
mov    $0xa,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"1....\0A\00"
define void @test(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @longjmp(i32 %5, i32 10)
unreachable
}

LLVM IR (-O2):
@str = [6 x i8] c"1....\00"
define void @test(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = tail call i32 @longjmp(i32 %3, i32 10)
unreachable
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ freakout(char *);
void fork_program() {
  pid_t program_pid;
  program_pid = fork();
  if (program_pid == -1)
    freakout("Unable to fork program.");
  if (program_pid != 0)
    exit(0);
}


x86 assembly (clang, -O0):
<fork_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1158 <fork_program+0x28>
lea    0xead(%rip),%rdi
call   1030 <freakout@plt>
cmpl   $0x0,-0x4(%rbp)
je     1169 <fork_program+0x39>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_program>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
jne    113e <fork_program+0xe>
pop    %rax
ret
cmp    $0xffffffff,%eax
jne    114f <fork_program+0x1f>
lea    0xeb6(%rip),%rdi
call   1030 <freakout@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Unable to fork program.\00"
define void @fork_program() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @freakout(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unable to fork program.\00"
define void @fork_program() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %4 [
i32 -1, label %2
i32 0, label %6
]
2: ; preds = %0
%3 = tail call i32 @freakout(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %0
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int __infer_nondet_int();
int getrusage(int who, struct rusage *r_usage) {
  int ret;
  if (r_usage == 0)
    while (1)
      ;
  ret = __infer_nondet_int();
  if (ret < -1 || ret > 0)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<getrusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <getrusage+0x24>
jmp    112f <getrusage+0x1f>
jmp    112f <getrusage+0x1f>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jl     1152 <getrusage+0x42>
cmpl   $0x0,-0x14(%rbp)
jle    115c <getrusage+0x4c>
jmp    1157 <getrusage+0x47>
jmp    1157 <getrusage+0x47>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrusage>:
test   %rsi,%rsi
je     1140 <getrusage+0x30>
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0xfffffffd,%ecx
lea    0x8(%rsp),%rsp
ja     1142 <getrusage+0x32>
nopw   0x0(%rax,%rax,1)
jmp    1130 <getrusage+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1140 <getrusage+0x30>
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* %1) {
%3 = alloca i32
%4 = alloca %struct.rusage*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.rusage* %1, %struct.rusage** %4
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = icmp eq %struct.rusage* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
br label %9
9: ; preds = %8, %9
br label %9
10: ; preds = %2
%11 = call i32 (...) @__infer_nondet_int()
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14, %10
br label %18
18: ; preds = %17, %18
br label %18
19: ; preds = %14
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* readnone %1) {
%3 = icmp eq %struct.rusage* %1, null
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
%6 = tail call i32 (...) @__infer_nondet_int()
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, -2
br i1 %8, label %9, label %10
9: ; preds = %5, %9
br label %9
10: ; preds = %5
ret i32 %6
}
int is_prime(int *numb) {
  int counter;
  for (counter = 0; counter <= *numb / 2; counter++) {
    if (counter * counter == *numb) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jg     1162 <is_prime+0x62>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    114f <is_prime+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1169 <is_prime+0x69>
jmp    1154 <is_prime+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_prime+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    (%rdi),%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
jl     1130 <is_prime+0x30>
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
add    $0x1,%edx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
mov    %esi,%edi
imul   %esi,%edi
cmp    %ecx,%edi
je     1131 <is_prime+0x31>
add    $0x1,%esi
cmp    %esi,%edx
jne    1120 <is_prime+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, -1
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = sdiv i32 %2, 2
br label %9
6: ; preds = %9
%7 = add nuw nsw i32 %10, 1
%8 = icmp eq i32 %10, %5
br i1 %8, label %13, label %9
9: ; preds = %4, %6
%10 = phi i32 [ %7, %6 ], [ 0, %4 ]
%11 = mul nsw i32 %10, %10
%12 = icmp eq i32 %11, %2
br i1 %12, label %13, label %6
13: ; preds = %9, %6, %1
%14 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 0, %9 ]
ret i32 %14
}