xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ msend(int, int, int, int, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void mouse_move(int dx, int dy, int dz, int rep) {
  msend(dx, dy, dz, rep, 0, 0);
}


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

x86 assembly (clang, -O2):
<mouse_move>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <msend@plt>

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

LLVM IR (-O2):
define void @mouse_move(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @msend(i32 %0, i32 %1, i32 %2, i32 %3, i32 0, i32 0)
ret void
}
int board_dhcp() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @board_dhcp() {
ret i32 0
}
/* Variables and functions */
scalar_t__ _gettemp(char *, int *, int /*<<< orphan*/, int, int /*<<< orphan*/);
int mkstemps(char *path, int slen) {
  int fd;
  return (_gettemp(path, &fd, 0, slen, 0) ? fd : -1);
}


x86 assembly (clang, -O0):
<mkstemps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
call   1030 <_gettemp@plt>
cmp    $0x0,%rax
je     114a <mkstemps+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <mkstemps+0x47>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <mkstemps+0x47>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemps>:
push   %rax
mov    %esi,%ecx
lea    0x4(%rsp),%rsi
xor    %edx,%edx
xor    %r8d,%r8d
call   1030 <_gettemp@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @_gettemp(i8* %0, i32* %3, i32 0, i32 %1, i32 0)
%6 = icmp eq i64 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
float d(float a) {
  printf("d() called\n");
  return a * 5;
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
movss  0xecf(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm0
mulss  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"d() called\0A\00"
define float @d(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load float, float* %2
%5 = fmul float %4, 5.000000e+00
ret float %5
}

LLVM IR (-O2):
@str = [11 x i8] c"d() called\00"
define float @d(float %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = fmul float %0, 5.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fun_should_not_be_called() {
  printf("fun_should_not_be_called\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"fun_should_not_be_called\00"
define void @fun_should_not_be_called() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ line_reversal(void *, int, int, int);
void rgb565_line_reversal(void *p565, int w, int h) {
  line_reversal(p565, w, h, 16);
}


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

x86 assembly (clang, -O2):
<rgb565_line_reversal>:
mov    $0x10,%ecx
jmp    1030 <line_reversal@plt>

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

LLVM IR (-O2):
define void @rgb565_line_reversal(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @line_reversal(i8* %0, i32 %1, i32 %2, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void SystemSettingsRequestUpdate() {
  UAVObjRequestUpdate(SystemSettingsHandle());
}


x86 assembly (clang, -O0):
<SystemSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SystemSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <SystemSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @SystemSettingsRequestUpdate() {
%1 = call i32 (...) @SystemSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SystemSettingsRequestUpdate() {
%1 = tail call i32 (...) @SystemSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) { fprintf(stderr, "Usage: psfile filename\n"); }


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: psfile filename\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: psfile filename\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int Xtolower(int c) { return (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c; }


x86 assembly (clang, -O0):
<Xtolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <Xtolower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <Xtolower+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <Xtolower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xtolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @Xtolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 97
br label %14
12: ; preds = %5, %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @Xtolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printer(char *);
void *func2(void *arg) {
  char *p = "world";
  printer(p);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <printer@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define noalias i8* @func2(i8* nocapture readnone %0) {
%2 = tail call i32 @printer(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int Read_Status_Register();
void Wait_Busy() {
  while (Read_Status_Register() == 0x03)
    Read_Status_Register();
}


x86 assembly (clang, -O0):
<Wait_Busy>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <Wait_Busy+0x9>
mov    $0x0,%al
call   1030 <Read_Status_Register@plt>
cmp    $0x3,%eax
jne    1135 <Wait_Busy+0x25>
mov    $0x0,%al
call   1030 <Read_Status_Register@plt>
jmp    1119 <Wait_Busy+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait_Busy>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Read_Status_Register@plt>
cmp    $0x3,%eax
jne    1135 <Wait_Busy+0x25>
xor    %eax,%eax
call   1030 <Read_Status_Register@plt>
jmp    1120 <Wait_Busy+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @Wait_Busy() {
br label %1
1: ; preds = %4, %0
%2 = call i32 (...) @Read_Status_Register()
%3 = icmp eq i32 %2, 3
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @Read_Status_Register()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @Wait_Busy() {
%1 = tail call i32 (...) @Read_Status_Register()
%2 = icmp eq i32 %1, 3
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @Read_Status_Register()
%5 = tail call i32 (...) @Read_Status_Register()
%6 = icmp eq i32 %5, 3
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
void cmap_validate(void) {}


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

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

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

LLVM IR (-O2):
define void @cmap_validate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ action_servo(int, int);
void camera_down(void) { action_servo(19, 30); }


x86 assembly (clang, -O0):
<camera_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0x13,%edi
mov    $0x1e,%esi
call   1030 <action_servo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<camera_down>:
mov    $0x13,%edi
mov    $0x1e,%esi
jmp    1030 <action_servo@plt>

LLVM IR (-O0):
define void @camera_down() {
%1 = call i32 @action_servo(i32 19, i32 30)
ret void
}

LLVM IR (-O2):
define void @camera_down() {
%1 = tail call i32 @action_servo(i32 19, i32 30)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int encoding_is_wchar;
};
typedef TYPE_1__ XIMText;

/* Variables and functions */
void set_XIMText_encoding_is_wchar(void *_p, int _v) {
  ((XIMText *)_p)->encoding_is_wchar = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XIMText_encoding_is_wchar>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XIMText_encoding_is_wchar(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void call_fclose(void *arg) {
  if (arg != NULL)
    fclose(arg);
}


x86 assembly (clang, -O0):
<call_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <call_fclose+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_fclose>:
test   %rdi,%rdi
je     111a <call_fclose+0xa>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @call_fclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @fclose(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @call_fclose(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c))
    return c - ('a' - 'A');
  else
    return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void postInputProcessing() {}


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

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

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

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

/* Variables and functions */
int l2tp_test_get_1_svc(void *, struct svc_req *);
int _l2tp_test_get_1(void *argp, void *result, struct svc_req *rqstp) {
  return (l2tp_test_get_1_svc(result, rqstp));
}


x86 assembly (clang, -O0):
<_l2tp_test_get_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <l2tp_test_get_1_svc@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_test_get_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_test_get_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_test_get_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_test_get_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
int check_color(int color) {
  if (color > 255)
    color = 255;
  if (color < 0)
    color = 0;
  return color;
}


x86 assembly (clang, -O0):
<check_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    111b <check_color+0x1b>
movl   $0xff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <check_color+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_color>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check_color(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__16__IO__set();
void OscilloscopeC__IOC0__set(void) { HplAtm128GeneralIOPinP__16__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @OscilloscopeC__IOC0__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__16__IO__set()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t __swapbits64(uint64_t p, uint64_t m, int k) {
  uint64_t q = ((p >> k) ^ p) & m;
  return p ^ q ^ (q << k);
}


x86 assembly (clang, -O0):
<__swapbits64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swapbits64>:
mov    %edx,%ecx
mov    %edi,%eax
sar    %cl,%eax
xor    %edi,%eax
and    %esi,%eax
xor    %eax,%edi
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @__swapbits64(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
%9 = load i32, i32* %6
%10 = ashr i32 %8, %9
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
%13 = load i32, i32* %5
%14 = and i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %7
%17 = xor i32 %15, %16
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = shl i32 %18, %19
%21 = xor i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @__swapbits64(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %0, %2
%5 = xor i32 %4, %0
%6 = and i32 %5, %1
%7 = xor i32 %6, %0
%8 = shl i32 %6, %2
%9 = xor i32 %7, %8
ret i32 %9
}
int double_cmp(const void *a, const void *b) {
  const double *fa = a, *fb = b;
  if (*fa < *fb)
    return -1;
  else if (*fa > *fb)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<double_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <double_cmp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <double_cmp+0x70>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <double_cmp+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <double_cmp+0x70>
jmp    1169 <double_cmp+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @double_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_set_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc(618, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_set_quaddobl_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26a,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_set_quaddobl_target>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movabs $0x100000002,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26a,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_set_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 2, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 618, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_set_quaddobl_target(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 2, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 618, i32* %6, i32* %3, double* %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ monitor();
int /*<<< orphan*/ my_thread1();
int /*<<< orphan*/ my_thread2();
int main(void) {
__CPROVER_ASYNC_01:
  monitor();
  while (1) {
  __CPROVER_ASYNC_02:
    my_thread1();
  __CPROVER_ASYNC_03:
    my_thread2();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <monitor@plt>
jmp    114b <main+0x1b>
mov    $0x0,%al
call   1030 <my_thread1@plt>
mov    $0x0,%al
call   1040 <my_thread2@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <monitor@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <my_thread1@plt>
xor    %eax,%eax
call   1040 <my_thread2@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 (...) @monitor()
br label %4
4: ; preds = %2, %7
br label %5
5: ; preds = %4
%6 = call i32 (...) @my_thread1()
br label %7
7: ; preds = %5
%8 = call i32 (...) @my_thread2()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @monitor()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @my_thread1()
%4 = tail call i32 (...) @my_thread2()
br label %2
}
void RTStrGetCpExInternal(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void put_uint16(void *p, uint16_t x) { memcpy(p, (const void *)&x, sizeof(x)); }


x86 assembly (clang, -O0):
<put_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_uint16>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @put_uint16(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void run_test(char *out, char *in) {
  int i = 0;
  for (i = 0; i < 102400; i++) {
    memcpy(out, in, (1024 * 4));
  }
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x19000,-0x14(%rbp)
jge    115b <run_test+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <run_test+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x19000,%ebp
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1000,%edx
call   1030 <memcpy@plt>
add    $0xffffffff,%ebp
jne    1120 <run_test+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @run_test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 102400
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 4096)
br label %13
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @run_test(i8* %0, i8* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 4096)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 102400
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
int fn(void) { return 0x80; }


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

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

LLVM IR (-O0):
define i32 @fn() {
ret i32 128
}

LLVM IR (-O2):
define i32 @fn() {
ret i32 128
}
/* Variables and functions */
int /*<<< orphan*/ PrBar(char *);
int /*<<< orphan*/ sprintf(char *, char *, long, long);
void PrintDataBar(long st, long en) {
  char buf[256];
  sprintf(buf, "Samples: %ld->%ld", st < 0 ? 0 : st, en);
  PrBar(buf);
}


x86 assembly (clang, -O0):
<PrintDataBar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    115a <PrintDataBar+0x3a>
xor    %eax,%eax
mov    %rax,-0x120(%rbp)
jmp    1165 <PrintDataBar+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x118(%rbp),%rdi
mov    -0x120(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe82(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <PrBar@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintDataBar>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rcx
xor    %edx,%edx
test   %rdi,%rdi
cmovns %rdi,%rdx
lea    0xec5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <PrBar@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Samples: %ld->%ld\00"
define void @PrintDataBar(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [256 x i8]
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %9
%13 = phi i64 [ 0, %9 ], [ %11, %10 ]
%14 = load i64, i64* %4
%15 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%17 = call i32 @PrBar(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Samples: %ld->%ld\00"
define void @PrintDataBar(i64 %0, i64 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i64 %0, 0
%6 = select i1 %5, i64 %0, i64 0
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %1)
%8 = call i32 @PrBar(i8* %4)
ret void
}
/* Type definitions */
struct vmfile {
  int dummy;
};

/* Variables and functions */
int vmfile_resize_no_check(struct vmfile *, size_t);
size_t vmfile_wavail(struct vmfile *);
int vmfile_resize_if_less(struct vmfile *vmb, size_t desired_size) {
  size_t wa = vmfile_wavail(vmb);
  if (desired_size <= wa)
    return 0;
  return vmfile_resize_no_check(vmb, desired_size);
}


x86 assembly (clang, -O0):
<vmfile_resize_if_less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <vmfile_wavail@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     1157 <vmfile_resize_if_less+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <vmfile_resize_if_less+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vmfile_resize_no_check@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmfile_resize_if_less>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <vmfile_wavail@plt>
cmp    %r14,%rax
jae    1146 <vmfile_resize_if_less+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <vmfile_resize_no_check@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.vmfile = type { i32 }
define i32 @vmfile_resize_if_less(%struct.vmfile* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.vmfile*
%5 = alloca i64
%6 = alloca i64
store %struct.vmfile* %0, %struct.vmfile** %4
store i64 %1, i64* %5
%7 = load %struct.vmfile*, %struct.vmfile** %4
%8 = call i64 @vmfile_wavail(%struct.vmfile* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = icmp ule i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %17
13: ; preds = %2
%14 = load %struct.vmfile*, %struct.vmfile** %4
%15 = load i64, i64* %5
%16 = call i32 @vmfile_resize_no_check(%struct.vmfile* %14, i64 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.vmfile = type { i32 }
define i32 @vmfile_resize_if_less(%struct.vmfile* %0, i64 %1) {
%3 = tail call i64 @vmfile_wavail(%struct.vmfile* %0)
%4 = icmp ult i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @vmfile_resize_no_check(%struct.vmfile* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int s;
  scanf("%d", &s);
  printf("%d:%d:%d\n", (s / 3600), ((s % 3600) / 60), (s % 60));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0xc(%rbp),%edx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rcx
imul   $0xffffffff91a2b3c5,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0xb,%esi
add    %eax,%esi
imul   $0xe10,%esi,%eax
mov    %ecx,%edx
sub    %eax,%edx
movswl %dx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %edx,%eax
movzwl %ax,%eax
movswl %ax,%edx
shr    $0xf,%eax
sar    $0x5,%edx
add    %eax,%edx
movswl %dx,%edx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edi
shr    $0x1f,%edi
sar    $0x5,%eax
add    %edi,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%ecx
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d:%d:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 3600
%6 = srem i32 %4, 3600
%7 = trunc i32 %6 to i16
%8 = sdiv i16 %7, 60
%9 = sext i16 %8 to i32
%10 = srem i32 %4, 60
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgstorlw(int n) { ngen("%s\t%%eax,%d(%%ebp)", "movl", n); }


x86 assembly (clang, -O0):
<cgstorlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorlw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s\09%%eax,%d(%%ebp)\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgstorlw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s\09%%eax,%d(%%ebp)\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgstorlw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int param_get_byte(char *buffer, struct kernel_param *kp) { return 0; }


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define i32 @param_get_byte(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_get_byte(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
int test_imm_E0int8_reg(signed char val) {
  return ((val) & (0xE0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E0int8_reg>:
cmp    $0x20,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E0int8_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, 224
%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_E0int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 32
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void telaAjuda1() { printf("f1"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"f1\00"
define void @telaAjuda1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void sys_file_close(FILE *fp) {
  if (!fp) {
    return;
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<sys_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <sys_file_close+0x1c>
jmp    1135 <sys_file_close+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_file_close>:
test   %rdi,%rdi
je     111a <sys_file_close+0xa>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @sys_file_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @sys_file_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct msgbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct msgbuf *);
int /*<<< orphan*/ msgbuf_uninit(struct msgbuf *);
void msgbuf_delete(struct msgbuf *b) {
  if (b) {
    msgbuf_uninit(b);
    free(b);
  }
}


x86 assembly (clang, -O0):
<msgbuf_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <msgbuf_delete+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <msgbuf_uninit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgbuf_delete>:
test   %rdi,%rdi
je     1137 <msgbuf_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <msgbuf_uninit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.msgbuf = type { i32 }
define void @msgbuf_delete(%struct.msgbuf* %0) {
%2 = alloca %struct.msgbuf*
store %struct.msgbuf* %0, %struct.msgbuf** %2
%3 = load %struct.msgbuf*, %struct.msgbuf** %2
%4 = icmp ne %struct.msgbuf* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.msgbuf*, %struct.msgbuf** %2
%7 = call i32 @msgbuf_uninit(%struct.msgbuf* %6)
%8 = load %struct.msgbuf*, %struct.msgbuf** %2
%9 = call i32 @free(%struct.msgbuf* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.msgbuf = type { i32 }
define void @msgbuf_delete(%struct.msgbuf* %0) {
%2 = icmp eq %struct.msgbuf* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @msgbuf_uninit(%struct.msgbuf* %0)
%5 = tail call i32 @free(%struct.msgbuf* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void display(char *test) {
  char coredump = test[0];
  printf("%c\n", coredump);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
lea    0xed4(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @display(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_fail();
void *calloc(size_t, size_t);
void *sdb_calloc(size_t count, size_t size) {
  void *p;
  p = calloc(count, size);
  if (p == NULL)
    alloc_fail();
  return p;
}


x86 assembly (clang, -O0):
<sdb_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <sdb_calloc+0x33>
mov    $0x0,%al
call   1030 <alloc_fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdb_calloc>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <sdb_calloc+0x15>
xor    %eax,%eax
call   1030 <alloc_fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @sdb_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @alloc_fail()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_node_child() { exit(1); }


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

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

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

LLVM IR (-O2):
define void @caml_js_node_child() {
%1 = tail call i32 @exit(i32 1)
unreachable
}