xunge/DecIR huggingface dataset:
int my_isnum(char c) {
  if (c == '-' || c == '+' || (c >= '0' && c <= '9'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<my_isnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     113e <my_isnum+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     113e <my_isnum+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     114a <my_isnum+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     114a <my_isnum+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <my_isnum+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isnum>:
mov    $0x1,%eax
cmp    $0x2b,%dil
je     1111 <my_isnum+0x11>
cmp    $0x2d,%dil
jne    1112 <my_isnum+0x12>
ret
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @my_isnum(i8 signext %0) {
switch i8 %0, label %2 [
i8 45, label %6
i8 43, label %6
]
2: ; preds = %1
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %1
%7 = phi i32 [ 1, %1 ], [ 1, %1 ], [ %5, %2 ]
ret i32 %7
}
int test_imm_F2uint16_reg(unsigned short val) {
  return ((val) & (-0xF2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F2uint16_reg>:
test   $0xff0e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F2uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -242
%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_F2uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -242
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int i = 3;
  puts("Hello World");
  printf("test print %d\n", i);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [15 x i8] c"test print %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [15 x i8] c"test print %d\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
int mult(int n, int m) {
  if (m < 0) {
    return -1 * mult(n, -m);
  }
  if (m == 0) {
    return 0;
  }
  return n + mult(n, m - 1);
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1143 <mult+0x33>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <mult@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <mult+0x67>
cmpl   $0x0,-0xc(%rbp)
jne    1159 <mult+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1177 <mult+0x67>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <mult@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
mov    %esi,%eax
test   %esi,%esi
js     111a <mult+0xa>
imul   %edi,%eax
ret
push   %rax
neg    %eax
mov    %eax,%esi
call   1030 <mult@plt>
neg    %eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = mul i32 %1, %0
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %11, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = sub nsw i32 0, %1
%10 = tail call i32 @mult(i32 %0, i32 %9)
%11 = sub i32 0, %10
br label %6
}
unsigned char cstylecast_0(unsigned int x) { return (unsigned char)x; }


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

x86 assembly (clang, -O2):
<cstylecast_0>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @cstylecast_0(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int PTRACE_O_TRACECLONE;
int PTRACE_O_TRACEEXEC;
int PTRACE_O_TRACEFORK;
int PTRACE_O_TRACESYSGOOD;
int PTRACE_O_TRACEVFORK;
int /*<<< orphan*/ PTRACE_SETOPTIONS;
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int);
void trace_set_options(pid_t tid) {
  ptrace(PTRACE_SETOPTIONS, tid, 0,
         PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACECLONE | PTRACE_O_TRACEFORK |
             PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC);
}


x86 assembly (clang, -O0):
<trace_set_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    0x2e79(%rip),%rax
or     (%rax),%ecx
mov    0x2e80(%rip),%rax
or     (%rax),%ecx
mov    0x2eaf(%rip),%rax
or     (%rax),%ecx
mov    0x2e7e(%rip),%rax
or     (%rax),%ecx
xor    %edx,%edx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_set_options>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    0x2e90(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    0x2ead(%rip),%rax
mov    0x2e8e(%rip),%rdx
or     (%rdx),%ecx
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
or     (%rax),%ecx
mov    0x2e8a(%rip),%rax
or     (%rax),%ecx
xor    %edx,%edx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_SETOPTIONS = global i32 0
@PTRACE_O_TRACESYSGOOD = global i32 0
@PTRACE_O_TRACECLONE = global i32 0
@PTRACE_O_TRACEFORK = global i32 0
@PTRACE_O_TRACEVFORK = global i32 0
@PTRACE_O_TRACEEXEC = global i32 0
define void @trace_set_options(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_SETOPTIONS
%4 = load i32, i32* %2
%5 = load i32, i32* @PTRACE_O_TRACESYSGOOD
%6 = load i32, i32* @PTRACE_O_TRACECLONE
%7 = or i32 %5, %6
%8 = load i32, i32* @PTRACE_O_TRACEFORK
%9 = or i32 %7, %8
%10 = load i32, i32* @PTRACE_O_TRACEVFORK
%11 = or i32 %9, %10
%12 = load i32, i32* @PTRACE_O_TRACEEXEC
%13 = or i32 %11, %12
%14 = call i32 @ptrace(i32 %3, i32 %4, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
@PTRACE_SETOPTIONS = global i32 0
@PTRACE_O_TRACESYSGOOD = global i32 0
@PTRACE_O_TRACECLONE = global i32 0
@PTRACE_O_TRACEFORK = global i32 0
@PTRACE_O_TRACEVFORK = global i32 0
@PTRACE_O_TRACEEXEC = global i32 0
define void @trace_set_options(i32 %0) {
%2 = load i32, i32* @PTRACE_SETOPTIONS
%3 = load i32, i32* @PTRACE_O_TRACESYSGOOD
%4 = load i32, i32* @PTRACE_O_TRACECLONE
%5 = or i32 %4, %3
%6 = load i32, i32* @PTRACE_O_TRACEFORK
%7 = or i32 %5, %6
%8 = load i32, i32* @PTRACE_O_TRACEVFORK
%9 = or i32 %7, %8
%10 = load i32, i32* @PTRACE_O_TRACEEXEC
%11 = or i32 %9, %10
%12 = tail call i32 @ptrace(i32 %2, i32 %0, i32 0, i32 %11)
ret void
}
/* Variables and functions */
int date_get_day();
int is_day_of_star(void) { return date_get_day() % 5 == 0; }


x86 assembly (clang, -O0):
<is_day_of_star>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <date_get_day@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_day_of_star>:
push   %rax
xor    %eax,%eax
call   1030 <date_get_day@plt>
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
xor    %eax,%eax
cmp    $0x33333333,%ecx
setb   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_day_of_star() {
%1 = call i32 (...) @date_get_day()
%2 = srem i32 %1, 5
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_day_of_star() {
%1 = tail call i32 (...) @date_get_day()
%2 = srem i32 %1, 5
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
void abort_message(char *text, char *file, int line) {
  fprintf(stderr, "%s \n", text);
  fprintf(stderr, "Aborting in file %s, line %i ...\n", file, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<abort_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort_message>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [34 x i8] c"Aborting in file %s, line %i ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @abort_message(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
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s \0A\00"
@.str.1 = [34 x i8] c"Aborting in file %s, line %i ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @abort_message(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_fmadd_ps(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_ps(float);
__m128 _fma_ff_vec(__m128 *veca, __m128 *vecb, float C) {
  __m128 vecc = _mm_set1_ps(C);
  return _mm_fmadd_ps(*veca, *vecb, vecc);
}


x86 assembly (clang, -O0):
<_fma_ff_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <_mm_set1_ps@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%edx
call   1030 <_mm_fmadd_ps@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fma_ff_vec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <_mm_set1_ps@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_mm_fmadd_ps@plt>

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

LLVM IR (-O2):
define i32 @_fma_ff_vec(i32* nocapture %0, i32* nocapture %1, float %2) {
%4 = tail call i32 @_mm_set1_ps(float %2)
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @_mm_fmadd_ps(i32 %5, i32 %6, i32 %4)
ret i32 %7
}
void INT_Excep_CMT3_CMI3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMT3_CMI3() {
ret void
}
/* Variables and functions */
long random();
long int lrand48(void) { return random(); }


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

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

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

LLVM IR (-O2):
define i64 @lrand48() {
%1 = tail call i64 (...) @random()
ret i64 %1
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
wint_t btowc(int x) { return x; }


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

x86 assembly (clang, -O2):
<btowc>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @btowc(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ assert_context_process();
long nondet_long();
long schedule_timeout(long timeout___0) {
  long tmp;
  {
    assert_context_process();
    tmp = nondet_long();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<schedule_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <assert_context_process@plt>
mov    $0x0,%al
call   1030 <nondet_long@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @schedule_timeout(i64 %0) {
%2 = tail call i32 (...) @assert_context_process()
%3 = tail call i64 (...) @nondet_long()
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ dologout(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void sigquit(int signo) {
  syslog(LOG_ERR, "got signal %d", signo);
  dologout(-1);
}


x86 assembly (clang, -O0):
<sigquit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <syslog@plt>
mov    $0xffffffff,%edi
call   1030 <dologout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigquit>:
push   %rax
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <syslog@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <dologout@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"got signal %d\00"
define void @sigquit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_ERR
%4 = load i32, i32* %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @dologout(i32 -1)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"got signal %d\00"
define void @sigquit(i32 %0) {
%2 = load i32, i32* @LOG_ERR
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @dologout(i32 -1)
ret void
}
void instrumentProcess(void) {}


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

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

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

LLVM IR (-O2):
define void @instrumentProcess() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void sleep_us(unsigned int time) { usleep(time); }


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

x86 assembly (clang, -O2):
<sleep_us>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @sleep_us(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
unsigned char __asm_utils_in8(int);
unsigned char ps2_read() { return __asm_utils_in8(0x60); }


x86 assembly (clang, -O0):
<ps2_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60,%edi
call   1030 <__asm_utils_in8@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2_read>:
mov    $0x60,%edi
jmp    1030 <__asm_utils_in8@plt>

LLVM IR (-O0):
define zeroext i8 @ps2_read() {
%1 = call zeroext i8 @__asm_utils_in8(i32 96)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @ps2_read() {
%1 = tail call zeroext i8 @__asm_utils_in8(i32 96)
ret i8 %1
}
int test_imm_69int8_reg(signed char val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69int8_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, 105
%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_69int8_reg(i8 signext %0) {
%2 = and i8 %0, 105
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc6(int status, void *arg) {
  printf("Executing exitfunc6 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc6>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Executing exitfunc6 (status=%d, arg=%d)\0A\00"
define void @exitfunc6(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Executing exitfunc6 (status=%d, arg=%d)\0A\00"
define void @exitfunc6(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
void Q_strchrrepl(char *string, char torepl, char repl) {
  for (; *string != 0x00; string++) {
    if (*string == torepl) {
      *string = repl;
    }
  }
}


x86 assembly (clang, -O0):
<Q_strchrrepl>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <Q_strchrrepl+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <Q_strchrrepl+0x3f>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1144 <Q_strchrrepl+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <Q_strchrrepl+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strchrrepl>:
mov    (%rdi),%al
test   %al,%al
je     1125 <Q_strchrrepl+0x25>
add    $0x1,%rdi
jmp    111b <Q_strchrrepl+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <Q_strchrrepl+0x25>
cmp    %sil,%al
jne    1110 <Q_strchrrepl+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <Q_strchrrepl+0x10>
ret

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

LLVM IR (-O2):
define void @Q_strchrrepl(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S "
      "replsize]]\n"
      "             [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n"
      "             [-s size] [utility [argument ...]]\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 = [196 x i8] c"usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]\0A [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\0A [-s size] [utility [argument ...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [196 x i8] c"usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]\0A [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\0A [-s size] [utility [argument ...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t get_u16(uint8_t *ptr) { return *(uint16_t *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @get_u16(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void SteamAPI_ISteamUser_StopVoiceRecording(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamUser_StopVoiceRecording>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_StopVoiceRecording = [39 x i8] c"SteamAPI_ISteamUser_StopVoiceRecording\00"
define void @SteamAPI_ISteamUser_StopVoiceRecording(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__func__.SteamAPI_ISteamUser_StopVoiceRecording, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_StopVoiceRecording = [39 x i8] c"SteamAPI_ISteamUser_StopVoiceRecording\00"
define void @SteamAPI_ISteamUser_StopVoiceRecording(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__func__.SteamAPI_ISteamUser_StopVoiceRecording, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ eb128_compose_264(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
bool eb128i_less_264(const uint64_t alo, const int64_t ahi, const uint64_t blo,
                     const int64_t bhi) {
  return eb128_compose_264(alo, ahi) < eb128_compose_264(blo, bhi);
}


x86 assembly (clang, -O0):
<eb128i_less_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
call   1030 <eb128_compose_264@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128i_less_264>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <eb128_compose_264@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <eb128_compose_264@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setl   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eb128i_less_264(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 = call i64 @eb128_compose_264(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @eb128_compose_264(i32 %12, i32 %13)
%15 = icmp slt i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eb128i_less_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @eb128_compose_264(i32 %0, i32 %1)
%6 = tail call i64 @eb128_compose_264(i32 %2, i32 %3)
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
display(const char *words) { printf("%s\n", words); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @display(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
void azbox_init(void) {}


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

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

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

LLVM IR (-O2):
define void @azbox_init() {
ret void
}
int max3(int x, int y, int z) {
  int max = x;
  if (y > max)
    max = y;
  if (z > max)
    max = z;
  return (max);
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1125 <max3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <max3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void nseel_asm_stack_peek_int(void) {
  __asm__("movl $0xfefefefe, %edi\n"
          "movl (%edi), %eax\n"
          "movl $0xfefefefe, %edx\n"
          "subl %edx, %eax\n"
          "andl $0xfefefefe, %eax\n"
          "orl $0xfefefefe, %eax\n");
}


x86 assembly (clang, -O0):
<nseel_asm_stack_peek_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfefefefe,%edi
mov    (%edi),%eax
mov    $0xfefefefe,%edx
sub    %edx,%eax
and    $0xfefefefe,%eax
or     $0xfefefefe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_stack_peek_int>:
mov    $0xfefefefe,%edi
mov    (%edi),%eax
mov    $0xfefefefe,%edx
sub    %edx,%eax
and    $0xfefefefe,%eax
or     $0xfefefefe,%eax
ret

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

LLVM IR (-O2):
define void @nseel_asm_stack_peek_int() {
tail call void asm sideeffect "movl $$0xfefefefe, %edi\0Amovl (%edi), %eax\0Amovl $$0xfefefefe, %edx\0Asubl %edx, %eax\0Aandl $$0xfefefefe, %eax\0Aorl $$0xfefefefe, %eax\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
double _get_int(const char *data, size_t pos) {
  int *buf = (int *)data;
  return ((double)buf[pos]);
}


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

x86 assembly (clang, -O2):
<_get_int>:
cvtsi2sdl (%rdi,%rsi,4),%xmm0
ret

LLVM IR (-O0):
define double @_get_int(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_int(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 %1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
ret double %6
}
void SSMR3PutGCUInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCUInt() {
ret void
}
void getcpo_(ix, iy) short *ix, *iy;
{ getcpos(ix, iy); }


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

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

LLVM IR (-O0):
define void @getcpo_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16*, i16** %4
%7 = call i32 (i16*, i16*, ...) bitcast (i32 (...)* @getcpos to i32 (i16*, i16*, ...)*)(i16* %5, i16* %6)
ret void
}

LLVM IR (-O2):
define void @getcpo_(i16* %0, i16* %1) {
%3 = tail call i32 (i16*, i16*, ...) bitcast (i32 (...)* @getcpos to i32 (i16*, i16*, ...)*)(i16* %0, i16* %1)
ret void
}
/* Variables and functions */
double log(double);
__attribute__((__weak__, __always___)) double softboundcets_log(double x) {
  return log(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_log>:
jmp    1030 <log@plt>

LLVM IR (-O0):
define weak double @softboundcets_log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundcets_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
void sleep(int speed) {
  clock_t c1 = clock(), c2;
  do {
    if ((c2 = clock()) == (clock_t)-1)
      break;
  } while (1000 * (c2 - c1) / CLOCKS_PER_SEC < speed);
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    113d <sleep+0x2d>
jmp    1161 <sleep+0x51>
jmp    1142 <sleep+0x32>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   $0x3e8,%eax,%eax
mov    0x2e93(%rip),%rcx
cltd
idivl  (%rcx)
cmp    -0x4(%rbp),%eax
jl     1125 <sleep+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ebp
mov    0x2ec2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
cmp    $0xffffffff,%eax
je     114c <sleep+0x3c>
sub    %ebp,%eax
imul   $0x3e8,%eax,%eax
cltd
idivl  (%r14)
cmp    %ebx,%eax
jl     1130 <sleep+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @clock()
store i32 %5, i32* %3
br label %6
6: ; preds = %11, %1
%7 = call i32 (...) @clock()
store i32 %7, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %6
br label %20
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 1000, %14
%16 = load i32, i32* @CLOCKS_PER_SEC
%17 = sdiv i32 %15, %16
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %6, label %20
20: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @sleep(i32 %0) {
%2 = tail call i32 (...) @clock()
br label %3
3: ; preds = %6, %1
%4 = tail call i32 (...) @clock()
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = sub nsw i32 %4, %2
%8 = mul nsw i32 %7, 1000
%9 = load i32, i32* @CLOCKS_PER_SEC
%10 = sdiv i32 %8, %9
%11 = icmp slt i32 %10, %0
br i1 %11, label %3, label %12
12: ; preds = %3, %6
ret void
}
int division(int a, int b) {
  if (b == 0)
    return 0;
  return a / b;
}


x86 assembly (clang, -O0):
<division>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <division+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112a <division+0x2a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<division>:
test   %esi,%esi
je     110a <division+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @division(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
int raw_irqs_disabled_flags(unsigned long flags) { return flags != 0; }


x86 assembly (clang, -O0):
<raw_irqs_disabled_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_irqs_disabled_flags>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @raw_irqs_disabled_flags(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int dtoa_calcsign(char *p, int str_size) {
  if (p[0] == '-') {
    strncpy(p, p + 1, str_size - 1);
    return (1 == 1);
  } else
    return (1 == 0);
}


x86 assembly (clang, -O0):
<dtoa_calcsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1152 <dtoa_calcsign+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
movl   $0x1,-0x4(%rbp)
jmp    1159 <dtoa_calcsign+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtoa_calcsign>:
push   %rax
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    112b <dtoa_calcsign+0x1b>
mov    %esi,%edx
lea    0x1(%rdi),%rsi
add    $0xffffffff,%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dtoa_calcsign(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = add nsw i32 %1, -1
%8 = tail call i32 @strncpy(i8* %0, i8* %6, i32 %7)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int cgdb_close(int fd) {
  int ret;
cgdb_close_start:
  if ((ret = close(fd)) == -1 && errno == EINTR)
    goto cgdb_close_start;
  else if (ret == -1)
    exit(-1);
  return 0;
}


x86 assembly (clang, -O0):
<cgdb_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    115e <cgdb_close+0x3e>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    115e <cgdb_close+0x3e>
jmp    112b <cgdb_close+0xb>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1172 <cgdb_close+0x52>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    1177 <cgdb_close+0x57>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdb_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2eb2(%rip),%r14
mov    0x2ea3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    115e <cgdb_close+0x3e>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1140 <cgdb_close+0x20>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @cgdb_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %4
13: ; preds = %8, %4
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %13
br label %19
19: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @cgdb_close(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret i32 0
}
unsigned number_of_lowest_bit(register unsigned v) {
  register unsigned r = 0;
  while ((v & 0x01) == 0) {
    v >>= 1;
    r++;
  };
  return r;
}


x86 assembly (clang, -O0):
<number_of_lowest_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1134 <number_of_lowest_bit+0x34>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <number_of_lowest_bit+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_lowest_bit>:
xor    %eax,%eax
test   $0x1,%dil
jne    111d <number_of_lowest_bit+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax)
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <number_of_lowest_bit+0x10>
ret

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

LLVM IR (-O2):
define i32 @number_of_lowest_bit(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = lshr i32 %6, 1
%8 = add i32 %5, 1
%9 = and i32 %6, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}