xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: nos-tun -t tunnel -s source -d destination -p "
                  "protocol_number [source] target\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [86 x i8] c"usage: nos-tun -t tunnel -s source -d destination -p protocol_number [source] target\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [86 x i8] c"usage: nos-tun -t tunnel -s source -d destination -p protocol_number [source] target\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void init_chess(void) {}


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

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

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

LLVM IR (-O2):
define void @init_chess() {
ret void
}
char igsp(txt)
char *txt;
{
  char c;
  while (isspace(c = *txt++))
    ;
  return c;
}


x86 assembly (clang, -O0):
<igsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
je     1146 <igsp+0x36>
jmp    111c <igsp+0xc>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igsp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
movzbl (%rbx),%ebp
add    $0x1,%rbx
movsbl %bpl,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <igsp+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @igsp(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = tail call i32 @isspace(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ELOOP;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *file = fopen("/sandbox/subdir/loop1", "r");
  assert(file == NULL);
  assert(errno == ELOOP);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1040 <fopen@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e95(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/sandbox/subdir/loop1\00"
@.str.1 = [2 x i8] c"r\00"
@errno = global i64 0
@ELOOP = global i64 0
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* @errno
%8 = load i64, i64* @ELOOP
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/sandbox/subdir/loop1\00"
@.str.1 = [2 x i8] c"r\00"
@errno = global i64 0
@ELOOP = global i64 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ELOOP
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
void emitSaveArgs(int parametersCount) {}


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

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

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

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

/* Variables and functions */
int fnv_32a_str(char *, int /*<<< orphan*/);
unsigned int badHash(char *key) {
  return (fnv_32a_str(key, ((u_int32_t)0x811c9dc5))) % 10009;
}


x86 assembly (clang, -O0):
<badHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x811c9dc5,%esi
call   1030 <fnv_32a_str@plt>
mov    $0x2719,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badHash>:
push   %rax
mov    $0x811c9dc5,%esi
call   1030 <fnv_32a_str@plt>
cltq
imul   $0x1a30da1f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x2719,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @badHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fnv_32a_str(i8* %3, i32 -2128831035)
%5 = srem i32 %4, 10009
ret i32 %5
}

LLVM IR (-O2):
define i32 @badHash(i8* %0) {
%2 = tail call i32 @fnv_32a_str(i8* %0, i32 -2128831035)
%3 = srem i32 %2, 10009
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void bad_dispatch() { panic("BAD Dispatch, went to NOT_YET_TRANSLATED\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"BAD Dispatch, went to NOT_YET_TRANSLATED\0A\00"
define void @bad_dispatch() {
%1 = call i32 @panic(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"BAD Dispatch, went to NOT_YET_TRANSLATED\0A\00"
define void @bad_dispatch() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_INT2_INPUT() { clear_io_bit(0x45, 2); }


x86 assembly (clang, -O0):
<TOSH_MAKE_INT2_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_INT2_INPUT>:
mov    $0x45,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_INT2_INPUT() {
%1 = call i32 @clear_io_bit(i32 69, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_INT2_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 69, i32 2)
ret void
}
int cairo_code_draw_casbg_get_height() { return 600; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casbg_get_height() {
ret i32 600
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casbg_get_height() {
ret i32 600
}
int test_imm_B0int64_lowword_mem(long long *val) {
  return ((*val) & (0xB0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B0int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int urange(int mincheck, int check, int maxcheck) {
  if (check < mincheck)
    return mincheck;
  if (check > maxcheck)
    return maxcheck;
  return check;
}


x86 assembly (clang, -O0):
<urange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <urange+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <urange+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <urange+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <urange+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<urange>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @urange(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int CRYPTO_push_info_(const char *info, const char *file, int line) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @CRYPTO_push_info_(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ _isdigit(char const);
unsigned int _atou(const char **p) {
  unsigned int v = 0;
  while (_isdigit(**p)) {
    v *= 10;
    v += (**p - '0');
    (*p)++;
  }
  return v;
}


x86 assembly (clang, -O0):
<_atou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <_isdigit@plt>
cmp    $0x0,%rax
je     1169 <_atou+0x59>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <_atou+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_atou>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <_isdigit@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1154 <_atou+0x44>
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%eax
mov    (%r14),%rcx
movsbl (%rcx),%edx
lea    (%rdx,%rax,2),%ebx
add    $0xffffffd0,%ebx
lea    0x1(%rcx),%rax
mov    %rax,(%r14)
movsbl 0x1(%rcx),%edi
call   1030 <_isdigit@plt>
test   %rax,%rax
jne    1130 <_atou+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @_atou(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @_isdigit(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %13, %6 ], [ 0, %1 ]
%8 = mul i32 %7, 10
%9 = load i8*, i8** %0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add i32 %8, -48
%13 = add i32 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = tail call i64 @_isdigit(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void atexit2(void) { printf("atexit2 executed\n"); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @dINT() {
%1 = tail call i32 (...) @dint()
ret void
}
/* Variables and functions */
int __api(int, int /*<<< orphan*/);
int rt_exit(void) { return (__api(2, 0) == 1) ? 0 : 1; }


x86 assembly (clang, -O0):
<rt_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_exit>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rt_exit() {
%1 = call i32 @__api(i32 2, i32 0)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @rt_exit() {
%1 = tail call i32 @__api(i32 2, i32 0)
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ hypot(double, double);
int /*<<< orphan*/ link_failure_hypot();
void test_hypot(double d1, double d2) {
  if (hypot(d1, d2) != hypot(d1, d2))
    link_failure_hypot();
}


x86 assembly (clang, -O0):
<test_hypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <hypot@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <hypot@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_hypot+0x4b>
mov    $0x0,%al
call   1030 <link_failure_hypot@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hypot>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <hypot@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <hypot@plt>
cmp    %rax,%rbx
jne    1153 <test_hypot+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_hypot@plt>

LLVM IR (-O0):
define void @test_hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @hypot(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @hypot(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_hypot()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_hypot(double %0, double %1) {
%3 = tail call i64 @hypot(double %0, double %1)
%4 = tail call i64 @hypot(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_hypot()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void u16_to_u8array(uint8_t *item, int offset, uint16_t value) {
  item[offset] = (uint8_t)value;
  item[offset + 1] = (uint8_t)(value >> 8);
}


x86 assembly (clang, -O0):
<u16_to_u8array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @u16_to_u8array(i64* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 %5
store i64 %4, i64* %6
%7 = ashr i32 %2, 8
%8 = sext i32 %7 to i64
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %0, i64 %10
store i64 %8, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ save_cb();
void exit_cb(void) { save_cb(); }


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

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

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

LLVM IR (-O2):
define void @exit_cb() {
%1 = tail call i32 (...) @save_cb()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;
struct TYPE_4__ {
  int /*<<< orphan*/ *win;
};
typedef TYPE_1__ PANEL;

/* Variables and functions */
int /*<<< orphan*/ del_panel(TYPE_1__ *);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
void rmpanel(PANEL *pan) {
  WINDOW *win = pan->win;
  del_panel(pan);
  delwin(win);
}


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

x86 assembly (clang, -O2):
<rmpanel>:
push   %rbx
mov    (%rdi),%rbx
call   1030 <del_panel@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <delwin@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32* }
define void @rmpanel(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
%3 = alloca i32*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%4 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = load i32*, i32** %5
store i32* %6, i32** %3
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%8 = call i32 @del_panel(%struct.TYPE_4__* %7)
%9 = load i32*, i32** %3
%10 = call i32 @delwin(i32* %9)
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32* }
define void @rmpanel(%struct.TYPE_4__* %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = tail call i32 @del_panel(%struct.TYPE_4__* %0)
%5 = tail call i32 @delwin(i32* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int int32_t;

/* Variables and functions */
int32_t uint64p_comparator(const void *pl, const void *pr) {
  uint64_t lv = *(const uint64_t *)pl;
  uint64_t rv = *(const uint64_t *)pr;
  if (lv < rv)
    return -1;
  else if (lv == rv)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<uint64p_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <uint64p_comparator+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <uint64p_comparator+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <uint64p_comparator+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <uint64p_comparator+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64p_comparator>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uint64p_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ srand(size_t);
int /*<<< orphan*/ test(int, int);
scalar_t__ time(int /*<<< orphan*/);
int main() {
  srand((size_t)time(0));
  test(10, 13);
  test(56, 101);
  test(8218, 10007);
  test(8219, 10007);
  test(331575, 1000003);
  test(665165880, 1000000007);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rdi
call   1030 <srand@plt>
mov    $0xa,%edi
mov    $0xd,%esi
call   1050 <test@plt>
mov    $0x38,%edi
mov    $0x65,%esi
call   1050 <test@plt>
mov    $0x201a,%edi
mov    $0x2717,%esi
call   1050 <test@plt>
mov    $0x201b,%edi
mov    $0x2717,%esi
call   1050 <test@plt>
mov    $0x50f37,%edi
mov    $0xf4243,%esi
call   1050 <test@plt>
mov    $0x27a5a038,%edi
mov    $0x3b9aca07,%esi
call   1050 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rdi
call   1030 <srand@plt>
mov    $0xa,%edi
mov    $0xd,%esi
call   1050 <test@plt>
mov    $0x38,%edi
mov    $0x65,%esi
call   1050 <test@plt>
mov    $0x201a,%edi
mov    $0x2717,%esi
call   1050 <test@plt>
mov    $0x201b,%edi
mov    $0x2717,%esi
call   1050 <test@plt>
mov    $0x50f37,%edi
mov    $0xf4243,%esi
call   1050 <test@plt>
mov    $0x27a5a038,%edi
mov    $0x3b9aca07,%esi
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32 0)
%3 = call i32 @srand(i64 %2)
%4 = call i32 @test(i32 10, i32 13)
%5 = call i32 @test(i32 56, i32 101)
%6 = call i32 @test(i32 8218, i32 10007)
%7 = call i32 @test(i32 8219, i32 10007)
%8 = call i32 @test(i32 331575, i32 1000003)
%9 = call i32 @test(i32 665165880, i32 1000000007)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32 0)
%2 = tail call i32 @srand(i64 %1)
%3 = tail call i32 @test(i32 10, i32 13)
%4 = tail call i32 @test(i32 56, i32 101)
%5 = tail call i32 @test(i32 8218, i32 10007)
%6 = tail call i32 @test(i32 8219, i32 10007)
%7 = tail call i32 @test(i32 331575, i32 1000003)
%8 = tail call i32 @test(i32 665165880, i32 1000000007)
ret i32 0
}
int shift_string_left(char *string_input, int number) {
  char *copy = string_input;
  while (*copy != '\0') {
    *(copy - number) = *copy;
    copy++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<shift_string_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <shift_string_left+0x4a>
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rsi
xor    %ecx,%ecx
sub    %rsi,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <shift_string_left+0x13>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_string_left>:
mov    (%rdi),%al
test   %al,%al
je     111f <shift_string_left+0x1f>
movslq %esi,%rcx
neg    %rcx
add    $0x1,%rdi
mov    %al,-0x1(%rdi,%rcx,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <shift_string_left+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @shift_string_left(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = sub nsw i64 0, %6
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %13, %8 ]
%10 = phi i8* [ %0, %5 ], [ %12, %8 ]
%11 = getelementptr inbounds i8, i8* %10, i64 %7
store i8 %9, i8* %11
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int raw_set_pos_rel(void *id, int64_t delta, int mode) { return 0; }


x86 assembly (clang, -O0):
<raw_set_pos_rel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @raw_set_pos_rel(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int main(void) {
  char cadena[80 + 1];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ indirecty();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc16(int /*<<< orphan*/);
void sbcIndirecty16(void) { sbc16(readmemw65816(indirecty())); }


x86 assembly (clang, -O0):
<sbcIndirecty16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <sbc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirecty16>:
push   %rax
xor    %eax,%eax
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1040 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sbc16@plt>

LLVM IR (-O0):
define void @sbcIndirecty16() {
%1 = call i32 (...) @indirecty()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @sbc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirecty16() {
%1 = tail call i32 (...) @indirecty()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @sbc16(i32 %2)
ret void
}
int isspace(int c) { return (c == 0x20 || (c >= 0x09 && c <= 0x0D)); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1135 <isspace+0x35>
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     112f <isspace+0x2f>
cmpl   $0xd,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 9
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 13
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br label %13
13: ; preds = %11, %1
%14 = phi i1 [ true, %1 ], [ %12, %11 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_D9int8_reg(signed char val) {
  return ((val) & (0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xd9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D9int8_reg(i8 signext %0) {
%2 = and i8 %0, -39
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *allocate(unsigned long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *allocate_clear(unsigned long bytes) {
  void *ptr = allocate(bytes);
  memset(ptr, 0, bytes);
  return ptr;
}


x86 assembly (clang, -O0):
<allocate_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_clear>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @allocate_clear(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @allocate(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @allocate_clear(i64 %0) {
%2 = tail call i8* @allocate(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t size) {
  void *ret;
  if ((ret = malloc(size)) == NULL) {
    perror("malloc");
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116d <xmalloc+0x3d>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
int lock_term(char *name) {
  char lbuf[1024 + 1];
  pid_t pid;
  pid = getpid();
}


x86 assembly (clang, -O0):
<lock_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x424(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lock_term(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1025 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i32 (...) @getpid()
store i32 %6, i32* %5
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @lock_term(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getpid()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int mask(int /*<<< orphan*/, int);
int bitpos(int64_t hash, int shift) { return 1 << mask(hash, shift); }


x86 assembly (clang, -O0):
<bitpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mask@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpos>:
push   %rax
call   1030 <mask@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
mov    %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bitpos(i32 %0, i32 %1) {
%3 = tail call i32 @mask(i32 %0, i32 %1)
%4 = shl nuw i32 1, %3
ret i32 %4
}
void wifi_rsp_ethernet_set_dataroute(
    const struct wifi_msg_ethernet_set_dataroute_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_ethernet_set_dataroute_rsp_t = type opaque
define void @wifi_rsp_ethernet_set_dataroute(%struct.wifi_msg_ethernet_set_dataroute_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int inline_read(int volatile *);
int foo_read(volatile int *mem) { return inline_read(mem); }


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

x86 assembly (clang, -O2):
<foo_read>:
jmp    1030 <inline_read@plt>

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

LLVM IR (-O2):
define i32 @foo_read(i32* %0) {
%2 = tail call i32 @inline_read(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_urole(char *urole) { write("csv-task.csv", "%s\n", urole); }


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

x86 assembly (clang, -O2):
<function_urole>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @function_urole(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
double h_0(double roh_air, double rah, double dtair) {
  if (rah < 0.01)
    rah = 0.01;
  return (roh_air * 1004 * dtair / rah);
}


x86 assembly (clang, -O0):
<h_0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1133 <h_0+0x33>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_0>:
movsd  0xef8(%rip),%xmm3
maxsd  %xmm1,%xmm3
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @h_0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = fcmp olt double %7, 1.000000e-02
br i1 %8, label %9, label %10
9: ; preds = %3
store double 1.000000e-02, double* %5
br label %10
10: ; preds = %9, %3
%11 = load double, double* %4
%12 = fmul double %11, 1.004000e+03
%13 = load double, double* %6
%14 = fmul double %12, %13
%15 = load double, double* %5
%16 = fdiv double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @h_0(double %0, double %1, double %2) {
%4 = fcmp olt double %1, 1.000000e-02
%5 = select i1 %4, double 1.000000e-02, double %1
%6 = fmul double %0, 1.004000e+03
%7 = fmul double %6, %2
%8 = fdiv double %7, %5
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void term_all_processes() {
  kill(-1, SIGKILL);
  signal(SIGALRM, SIG_IGN);
}


x86 assembly (clang, -O0):
<term_all_processes>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
call   1040 <kill@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_all_processes>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
call   1040 <kill@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
define void @term_all_processes() {
%1 = load i32, i32* @SIGKILL
%2 = call i32 @kill(i32 -1, i32 %1)
%3 = load i32, i32* @SIGALRM
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
define void @term_all_processes() {
%1 = load i32, i32* @SIGKILL
%2 = tail call i32 @kill(i32 -1, i32 %1)
%3 = load i32, i32* @SIGALRM
%4 = load i32, i32* @SIG_IGN
%5 = tail call i32 @signal(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void exit_usage(const char *progname) {
  fprintf(stderr, "Usage : %s <n> [seed]\n", progname);
  fprintf(stderr, "\tn    : number of iterations\n");
  fprintf(stderr, "\tseed : random seed\n");
  exit(2);
}


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

x86 assembly (clang, -O2):
<exit_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage : %s <n> [seed]\0A\00"
@.str.1 = [30 x i8] c"\09n : number of iterations\0A\00"
@.str.2 = [21 x i8] c"\09seed : random seed\0A\00"
define void @exit_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage : %s <n> [seed]\0A\00"
@.str.1 = [30 x i8] c"\09n : number of iterations\0A\00"
@.str.2 = [21 x i8] c"\09seed : random seed\0A\00"
define void @exit_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 2)
unreachable
}
void RSA_print_fp(void) {}


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

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

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

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