xunge/DecIR huggingface dataset:
/* Variables and functions */
int start(int);
int main() {
  int res = 0;
  res += start(1);
  res += start(2);
  return (res + start(3)) % 128;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <start@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <start@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
call   1030 <start@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
call   1030 <start@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1030 <start@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x3,%edi
call   1030 <start@plt>
mov    %ebx,%ecx
add    %eax,%ecx
lea    0x7f(%rax,%rbx,1),%eax
cmovns %ecx,%eax
and    $0xffffff80,%eax
sub    %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @start(i32 1)
%4 = load i32, i32* %2
%5 = add nsw i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 @start(i32 2)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @start(i32 3)
%11 = add nsw i32 %9, %10
%12 = srem i32 %11, 128
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @start(i32 1)
%2 = tail call i32 @start(i32 2)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @start(i32 3)
%5 = add nsw i32 %3, %4
%6 = srem i32 %5, 128
ret i32 %6
}
/* Variables and functions */
scalar_t__ IsDarkFor(int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int Cnd_IfDark(void) {
  if (IsDarkFor(Me()))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<Cnd_IfDark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <Me@plt>
mov    %eax,%edi
call   1030 <IsDarkFor@plt>
cmp    $0x0,%rax
je     114c <Cnd_IfDark+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <Cnd_IfDark+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_IfDark>:
push   %rax
xor    %eax,%eax
call   1040 <Me@plt>
mov    %eax,%edi
call   1030 <IsDarkFor@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cnd_IfDark() {
%1 = alloca i32
%2 = call i32 (...) @Me()
%3 = call i64 @IsDarkFor(i32 %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @Cnd_IfDark() {
%1 = tail call i32 (...) @Me()
%2 = tail call i64 @IsDarkFor(i32 %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_REPORT_POWER_STATUS;
void cec_msg_report_power_status(struct cec_msg *msg, __u8 pwr_state) {
  msg->len = 3;
  msg->msg[1] = CEC_MSG_REPORT_POWER_STATUS;
  msg->msg[2] = pwr_state;
}


x86 assembly (clang, -O0):
<cec_msg_report_power_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    0x2ecc(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_report_power_status>:
movl   $0x3,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
mov    %esi,0x8(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_POWER_STATUS = global i32 0
define void @cec_msg_report_power_status(%struct.cec_msg* %0, i32 %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32 %1, i32* %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
store i32 3, i32* %6
%7 = load i32, i32* @CEC_MSG_REPORT_POWER_STATUS
%8 = load %struct.cec_msg*, %struct.cec_msg** %3
%9 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %8, i32 0, i32 1
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %7, i32* %11
%12 = load i32, i32* %4
%13 = load %struct.cec_msg*, %struct.cec_msg** %3
%14 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %13, i32 0, i32 1
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_POWER_STATUS = global i32 0
define void @cec_msg_report_power_status(%struct.cec_msg* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 3, i32* %3
%4 = load i32, i32* @CEC_MSG_REPORT_POWER_STATUS
%5 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %4, i32* %7
%8 = getelementptr inbounds i32, i32* %6, i64 2
store i32 %1, i32* %8
ret void
}
void gtk_menu_detach() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_detach() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int sys_link(const char *oldpath, const char *newpath) {
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<sys_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @sys_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EMLINK
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @sys_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
int l2(unsigned int mask) {
  int c = 0;
  while ((mask & 1) == 0) {
    mask >>= 1;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<l2>:
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 <l2+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 <l2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @l2(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 nsw 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 @l2(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 nuw nsw 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
}
/* Variables and functions */
scalar_t__ floor(double);
unsigned long long test2(double x) { return (unsigned long long)floor(x); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define i64 @test2(double %0) {
%2 = tail call i64 @floor(double %0)
ret i64 %2
}
void RTMemPoolFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemPoolFree() {
ret void
}
/* Variables and functions */
unsigned int list_argminmax(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
bool test_list_argminmax_null_params(void) {
  bool pass = false;
  unsigned int res = list_argminmax(NULL, NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_argminmax_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <list_argminmax@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1142 <test_list_argminmax_null_params+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_list_argminmax_null_params() {
%1 = tail call i32 @list_argminmax(i32* null, i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int nullputc(c)
char c;
{
  int t;
  t = ((int)c) & 0xFF;
  return (t);
}


x86 assembly (clang, -O0):
<nullputc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullputc>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @nullputc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = trunc i32 %0 to i8
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @nullputc(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int _citrus_esdb_get_list(char ***, size_t *, int);
int errno;
int __iconv_get_list(char ***rlist, size_t *rsz, bool sorted) {
  int ret;
  ret = _citrus_esdb_get_list(rlist, rsz, sorted);
  if (ret) {
    errno = ret;
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<__iconv_get_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <_citrus_esdb_get_list@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1158 <__iconv_get_list+0x48>
mov    -0x20(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <__iconv_get_list+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iconv_get_list>:
push   %rax
call   1030 <_citrus_esdb_get_list@plt>
test   %eax,%eax
je     112a <__iconv_get_list+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__iconv_get_list(i8*** %0, i64* %1, i32 %2) {
%4 = tail call i32 @_citrus_esdb_get_list(i8*** %0, i64* %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* @errno
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
int de_feat_get_num_devices();
int bsp_disp_feat_get_num_screens(void) { return de_feat_get_num_devices(); }


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

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

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

LLVM IR (-O2):
define i32 @bsp_disp_feat_get_num_screens() {
%1 = tail call i32 (...) @de_feat_get_num_devices()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ *tlog_syslog_facility_to_str(int);
bool tlog_syslog_facility_is_valid(int facility) {
  return tlog_syslog_facility_to_str(facility) != NULL;
}


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

x86 assembly (clang, -O2):
<tlog_syslog_facility_is_valid>:
push   %rax
call   1030 <tlog_syslog_facility_to_str@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tlog_syslog_facility_is_valid(i32 %0) {
%2 = tail call i32* @tlog_syslog_facility_to_str(i32 %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
double maximus(double x, double y) {
  if (x <= y) {
    return y;
  }
  return x;
}


x86 assembly (clang, -O0):
<maximus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1131 <maximus+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <maximus+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximus>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @maximus(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
int myotherthing(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<myotherthing>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @myotherthing(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @myotherthing(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int increinc(int *num) {
  (*num)++;
  return (*num)++;
}


x86 assembly (clang, -O0):
<increinc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increinc>:
mov    (%rdi),%ecx
lea    0x1(%rcx),%eax
add    $0x2,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @increinc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @increinc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
%4 = add nsw i32 %2, 2
store i32 %4, i32* %0
ret i32 %3
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
float mat3_determinant(float *);
__attribute__((always_)) float psmat3_determinant(struct mat3 *m) {
  return mat3_determinant((float *)m);
}


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

x86 assembly (clang, -O2):
<psmat3_determinant>:
jmp    1030 <mat3_determinant@plt>

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define float @psmat3_determinant(%struct.mat3* %0) {
%2 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %2
%3 = load %struct.mat3*, %struct.mat3** %2
%4 = bitcast %struct.mat3* %3 to float*
%5 = call float @mat3_determinant(float* %4)
ret float %5
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define float @psmat3_determinant(%struct.mat3* %0) {
%2 = bitcast %struct.mat3* %0 to float*
%3 = tail call float @mat3_determinant(float* %2)
ret float %3
}
void HalfFloat1Row_Any_NEON() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @log_store_bootup() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_dev;
};
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
dev_t posix_stat_st_dev(const struct stat *st) { return st->st_dev; }


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_dev(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_dev(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
char *bool2str(bool b) { return b ? "true" : "false"; }


x86 assembly (clang, -O0):
<bool2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef4(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool2str>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool2str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool2str(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int is_empty(int row, int col, char board[8][8]) {
  if (board[row][col] == ' ')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    113a <is_empty+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_empty+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
movslq %edi,%rax
movslq %esi,%rcx
lea    (%rdx,%rax,8),%rdx
xor    %eax,%eax
cmpb   $0x20,(%rcx,%rdx,1)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_empty(i32 %0, i32 %1, [8 x i8]* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 %4, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
%9 = zext i1 %8 to i32
ret i32 %9
}
void dwarf_bytesize(void) {}


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

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

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

LLVM IR (-O2):
define void @dwarf_bytesize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x38() {
  Assert_real((isprint(56)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              285, ("isprint should be 1 for 8"));
}


x86 assembly (clang, -O0):
<t_isprint_0x38>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x11d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x38>:
push   %rax
mov    $0x38,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x11d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 8\00"
define void @t_isprint_0x38() {
%1 = call i32 @isprint(i32 56)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 8\00"
define void @t_isprint_0x38() {
%1 = tail call i32 @isprint(i32 56)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 285, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, long, long);
void send_rigg(struct ship *ship, long a, long b, long c, long d) {
  Write(20, ship, a, b, c, d);
}


x86 assembly (clang, -O0):
<send_rigg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x14,%edi
call   1030 <Write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_rigg>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x14,%edi
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_rigg(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.ship*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store %struct.ship* %0, %struct.ship** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load %struct.ship*, %struct.ship** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @Write(i32 20, %struct.ship* %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_rigg(%struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @Write(i32 20, %struct.ship* %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int pow(double, float);
float g1(float xOld) {
  float xNew = 0;
  xNew = pow(2.718281828, xOld / 2) / 2;
  return xNew;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xed6(%rip),%xmm0
divss  %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
call   1030 <pow@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rax
movaps %xmm0,%xmm1
mulss  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @g1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fdiv float %4, 2.000000e+00
%6 = call i32 @pow(double 0x4005BF0A8B04919B, float %5)
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @g1(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call i32 @pow(double 0x4005BF0A8B04919B, float %2)
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int error(const char *str) {
  perror(str);
  return -1;
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void handler(int signo) {
  printf("Wake-up!\n");
  raise(SIGUSR1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <raise@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Wake-up!\0A\00"
@SIGUSR1 = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @raise(i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@str = [9 x i8] c"Wake-up!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @SIGUSR1
%4 = tail call i32 @raise(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ whisperPutc(char);
int whisperPuts(const char *s) {
  while (*s)
    whisperPutc(*s++);
  whisperPutc('\n');
  return 1;
}


x86 assembly (clang, -O0):
<whisperPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <whisperPuts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <whisperPutc@plt>
jmp    111c <whisperPuts+0xc>
mov    $0xa,%edi
call   1030 <whisperPutc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whisperPuts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <whisperPuts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <whisperPutc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <whisperPuts+0x10>
mov    $0xa,%edi
call   1030 <whisperPutc@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @whisperPuts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @whisperPutc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @whisperPutc(i8 signext 10)
ret i32 1
}
void *_sbrk(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @_sbrk() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_sbrk() {
ret i8* null
}
double cbrt(x)
double x;
{
  if (x > 0.0)
    return pow(x, 1.0 / 3.0);
  else
    return -pow(-x, 1.0 / 3.0);
}


x86 assembly (clang, -O0):
<cbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <cbrt+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <cbrt+0x80>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe91(%rip),%xmm1
call   1030 <pow@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrt>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1129 <cbrt+0x19>
movsd  0xeed(%rip),%xmm1
pop    %rax
jmp    1030 <pow@plt>
xorpd  0xecf(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <pow@plt>
xorpd  0xeba(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cbrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double 0x3FD5555555555555)
store double %8, double* %2
br label %14
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
%12 = call double @pow(double %11, double 0x3FD5555555555555)
%13 = fneg double %12
store double %13, double* %2
br label %14
14: ; preds = %9, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @pow(double %0, double 0x3FD5555555555555)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @pow(double %6, double 0x3FD5555555555555)
%8 = fneg double %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Variables and functions */
double P(int, int);
double fact(int);
double C(int n, int r) { return P(n, r) / fact(r); }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <P@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1030 <P@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1040 <fact@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @C(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call double @P(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = call double @fact(i32 %8)
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @C(i32 %0, i32 %1) {
%3 = tail call double @P(i32 %0, i32 %1)
%4 = tail call double @fact(i32 %1)
%5 = fdiv double %3, %4
ret double %5
}
void dummy_io_nemo() {}


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

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

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

LLVM IR (-O2):
define void @dummy_io_nemo() {
ret void
}
int filhoEsquerda(int i) { return 2 * i; }


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

x86 assembly (clang, -O2):
<filhoEsquerda>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @filhoEsquerda(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void check_memory_gf_town_c(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_get_port_polarity(uint8_t port) {
  return get_port(port, 0x02, 0x03);
}


x86 assembly (clang, -O0):
<io_get_port_polarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <get_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_port_polarity>:
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_get_port_polarity(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 2, i32 3)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ redrawwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wnoutrefresh(int /*<<< orphan*/ *);
void update_window_lazy(WINDOW *win) {
  touchwin(win);
  redrawwin(win);
  wnoutrefresh(win);
}


x86 assembly (clang, -O0):
<update_window_lazy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x8(%rbp),%rdi
call   1040 <redrawwin@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wnoutrefresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_window_lazy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <touchwin@plt>
mov    %rbx,%rdi
call   1040 <redrawwin@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wnoutrefresh@plt>

LLVM IR (-O0):
define void @update_window_lazy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @touchwin(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @redrawwin(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @wnoutrefresh(i32* %7)
ret void
}

LLVM IR (-O2):
define void @update_window_lazy(i32* %0) {
%2 = tail call i32 @touchwin(i32* %0)
%3 = tail call i32 @redrawwin(i32* %0)
%4 = tail call i32 @wnoutrefresh(i32* %0)
ret void
}
void sg_cpu_destroy_comp(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gdk_device_set_source() {
ret void
}
void __inc(int *p) { (*p)++; }


x86 assembly (clang, -O0):
<__inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inc>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @__inc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @__inc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
int valid_file_rank(int file, int rank) {
  return ((file >= 1) && (file <= 8) && (rank >= 1) && (rank <= 8));
}


x86 assembly (clang, -O0):
<valid_file_rank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <valid_file_rank+0x41>
xor    %eax,%eax
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jg     1141 <valid_file_rank+0x41>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <valid_file_rank+0x41>
cmpl   $0x8,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_file_rank>:
add    $0xffffffff,%edi
add    $0xffffffff,%esi
or     %edi,%esi
xor    %eax,%eax
cmp    $0x8,%esi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_file_rank(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %1, -1
%5 = or i32 %4, %3
%6 = icmp ult i32 %5, 8
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void useless(void) { printf("I am not used\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"I am not used\00"
define void @useless() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
double cdflib_fifdmin1(double a, double b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<cdflib_fifdmin1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <cdflib_fifdmin1+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <cdflib_fifdmin1+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_fifdmin1>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @cdflib_fifdmin1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int main(void) {
  int *ip;
  *ip = 3;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
store i32 3, i32* %2
ret i32 0
}

LLVM IR (-O2):
__attribute__((always_)) int handle_vm86_trap(struct kernel_vm86_regs *a,
                                              long b, int c) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kernel_vm86_regs = type opaque
define i32 @handle_vm86_trap(%struct.kernel_vm86_regs* %0, i64 %1, i32 %2) {
%4 = alloca %struct.kernel_vm86_regs*
%5 = alloca i64
%6 = alloca i32
store %struct.kernel_vm86_regs* %0, %struct.kernel_vm86_regs** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_vm86_regs = type opaque
define i32 @handle_vm86_trap(%struct.kernel_vm86_regs* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *x_strdup(const char *src) {
  if (src == NULL)
    return NULL;
  int len = strlen(src);
  char *out = calloc(len + 1, sizeof(char));
  strcpy(out, src);
  return out;
}


x86 assembly (clang, -O0):
<x_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <x_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1189 <x_strdup+0x59>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115e <x_strdup+0x2e>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1161 <x_strdup+0x31>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @x_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @calloc(i32 %5, i32 1)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
void pm8921_bms_no_external_accy(void) {}


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

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

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

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