xunge/DecIR huggingface dataset:
/* Variables and functions */
char *fcitx_utils_get_ascii_partn(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
__attribute__((visibility("default"))) char *
fcitx_utils_get_ascii_part(char *string) {
  if (!string)
    return NULL;
  return fcitx_utils_get_ascii_partn(string, strlen(string));
}


x86 assembly (clang, -O0):
<fcitx_utils_get_ascii_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <fcitx_utils_get_ascii_part+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <fcitx_utils_get_ascii_part+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <fcitx_utils_get_ascii_partn@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_get_ascii_part>:
test   %rdi,%rdi
je     1139 <fcitx_utils_get_ascii_part+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fcitx_utils_get_ascii_partn@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @fcitx_utils_get_ascii_part(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @fcitx_utils_get_ascii_partn(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
void cdrom() {}


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

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

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

LLVM IR (-O2):
define void @cdrom() {
ret void
}
/* Variables and functions */
double __ocml_mul_rtz_f64(double, double);
double __dmul_rz(double x, double y) { return __ocml_mul_rtz_f64(x, y); }


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

x86 assembly (clang, -O2):
<__dmul_rz>:
jmp    1030 <__ocml_mul_rtz_f64@plt>

LLVM IR (-O0):
define double @__dmul_rz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_mul_rtz_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dmul_rz(double %0, double %1) {
%3 = tail call double @__ocml_mul_rtz_f64(double %0, double %1)
ret double %3
}
void *segv_thread(void *ptr) { *(int *)ptr = 0; }


x86 assembly (clang, -O0):
<segv_thread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<segv_thread>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @segv_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
store i32 0, i32* %5
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @segv_thread(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
ret i8* undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t topology_rackname_hash(char *rackname) {
  uint8_t p;
  uint32_t result = 55821;
  while ((p = *rackname) != 0) {
    rackname++;
    result = result * 33 + p;
  }
  return result;
}


x86 assembly (clang, -O0):
<topology_rackname_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xda0d,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113d <topology_rackname_hash+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
imul   $0x21,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <topology_rackname_hash+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<topology_rackname_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <topology_rackname_hash+0x38>
add    $0x1,%rdi
mov    $0xda0d,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <topology_rackname_hash+0x20>
ret
mov    $0xda0d,%eax
ret

LLVM IR (-O0):
define i32 @topology_rackname_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 55821, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 33
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @topology_rackname_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 55821, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul nsw i32 %6, 33
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 55821, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
void assert_int_equals(int expected, int actual) {
  if (expected != actual) {
    printf("Expected: %d, but was %d\n", expected, actual);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assert_int_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     115a <assert_int_equals+0x3a>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_int_equals>:
mov    %esi,%edx
cmp    %esi,%edi
jne    1127 <assert_int_equals+0x7>
ret
push   %rax
mov    %edi,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Expected: %d, but was %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_int_equals(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Expected: %d, but was %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_int_equals(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret void
}
short fun_call_ret_3() { return 255 * 4; }


x86 assembly (clang, -O0):
<fun_call_ret_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fc,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_ret_3>:
mov    $0x3fc,%ax
ret

LLVM IR (-O0):
define signext i16 @fun_call_ret_3() {
ret i16 1020
}

LLVM IR (-O2):
define signext i16 @fun_call_ret_3() {
ret i16 1020
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int32_t pow5bits(const int32_t e) {
  assert(e >= 0);
  assert(e <= 3528);
  return (int32_t)(((((uint32_t)e) * 1217359) >> 19) + 1);
}


x86 assembly (clang, -O0):
<pow5bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0xdc8,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   $0x12934f,-0x4(%rbp),%eax
sar    $0x13,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow5bits>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0xdc9,%ebx
setl   %dil
call   1030 <assert@plt>
imul   $0x12934f,%ebx,%eax
sar    $0x13,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pow5bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 3528
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 1217359
%13 = ashr i32 %12, 19
%14 = add nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @pow5bits(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 3529
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = mul nsw i32 %0, 1217359
%9 = ashr i32 %8, 19
%10 = add nsw i32 %9, 1
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME_ENTRY;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_ENTRY_it;
void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it);
}


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

x86 assembly (clang, -O2):
<X509_NAME_ENTRY_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@X509_NAME_ENTRY_it = global i32 0
define void @X509_NAME_ENTRY_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_NAME_ENTRY_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sticky() { printf("sticky, peanutbutter.so\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"sticky, peanutbutter.so\00"
define void @sticky() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int GLOB_LLD_Flash_Init();
int GLOB_LLD_Read_Device_ID();
int GLOB_FTL_Flash_Init(void) {
  int status = 1;
  if ((status = GLOB_LLD_Flash_Init()) != 0)
    return status;
  status = GLOB_LLD_Read_Device_ID();
  return status;
}


x86 assembly (clang, -O0):
<GLOB_FTL_Flash_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <GLOB_LLD_Flash_Init@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114d <GLOB_FTL_Flash_Init+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <GLOB_FTL_Flash_Init+0x3d>
mov    $0x0,%al
call   1030 <GLOB_LLD_Read_Device_ID@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLOB_FTL_Flash_Init>:
push   %rax
xor    %eax,%eax
call   1040 <GLOB_LLD_Flash_Init@plt>
test   %eax,%eax
je     112e <GLOB_FTL_Flash_Init+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <GLOB_LLD_Read_Device_ID@plt>

LLVM IR (-O0):
define i32 @GLOB_FTL_Flash_Init() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = call i32 (...) @GLOB_LLD_Flash_Init()
store i32 %3, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %2
store i32 %6, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 (...) @GLOB_LLD_Read_Device_ID()
store i32 %8, i32* %2
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @GLOB_FTL_Flash_Init() {
%1 = tail call i32 (...) @GLOB_LLD_Flash_Init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @GLOB_LLD_Read_Device_ID()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
void inclass_element2ESC() {}


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

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

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

LLVM IR (-O2):
define void @inclass_element2ESC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printf1();
int main(int argc, char *argv[]) {
  printf("hello make world\n");
  printf("PI=%lf\n", 3.1415926);
  printf1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
movsd  0xead(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printf1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <printf1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"hello make world\0A\00"
@.str.1 = [8 x i8] c"PI=%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB4D12D84A)
%8 = call i32 (...) @printf1()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"PI=%lf\0A\00"
@str = [17 x i8] c"hello make world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB4D12D84A)
%5 = tail call i32 (...) @printf1()
ret i32 0
}
int strlen_g(const char *string) {
  int i;
  i = 0;
  while (*string++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen_g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen_g+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen_g+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_g>:
cmpb   $0x0,(%rdi)
je     111c <strlen_g+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen_g+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen_g(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 i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int cal_bucket_cnt(int total_node_cnt) {
  int cnt = total_node_cnt / 4;
  if (cnt > 2048) {
    cnt = 2048;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<cal_bucket_cnt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x800,-0x8(%rbp)
jle    1129 <cal_bucket_cnt+0x29>
movl   $0x800,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal_bucket_cnt>:
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
cmp    $0x800,%ecx
mov    $0x800,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cal_bucket_cnt(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = icmp slt i32 %2, 2048
%4 = select i1 %3, i32 %2, i32 2048
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mexPrintf(char *, char *);
int glpkmex_print_hook(void *info, char *msg) {
  mexPrintf("%s\n", msg);
  return 1;
}


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

x86 assembly (clang, -O2):
<glpkmex_print_hook>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <mexPrintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @glpkmex_print_hook(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @mexPrintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bbb();
void aaa(void) { bbb(); }


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

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

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

LLVM IR (-O2):
define void @aaa() {
%1 = tail call i32 (...) @bbb()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glScissor(int, int, int, int);
void glaserl_util_set_scissor(int x, int y, int w, int h) {
  glScissor(x, y, w, h);
}


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

x86 assembly (clang, -O2):
<glaserl_util_set_scissor>:
jmp    1030 <glScissor@plt>

LLVM IR (-O0):
define void @glaserl_util_set_scissor(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 @glScissor(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @execute_bdflush() {
ret i32 0
}
int aotoi(char *str) {
  register int num;
  num = 0;
  while ('0' <= *str && *str <= '7') {
    num *= 8;
    num += (*str++) - '0';
  }
  return (num);
}


x86 assembly (clang, -O0):
<aotoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jg     1138 <aotoi+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <aotoi+0x48>
jmp    1171 <aotoi+0x71>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <aotoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aotoi>:
mov    (%rdi),%cl
mov    %ecx,%edx
and    $0xf8,%dl
xor    %eax,%eax
cmp    $0x30,%dl
jne    113a <aotoi+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1120 <aotoi+0x20>
ret

LLVM IR (-O0):
define i32 @aotoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sle i32 48, %7
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 55
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %26
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 8
store i32 %18, i32* %3
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
%21 = load i8, i8* %19
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
%24 = load i32, i32* %3
%25 = add nsw i32 %24, %23
store i32 %25, i32* %3
br label %4
26: ; preds = %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @aotoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -8
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = shl nsw i32 %7, 3
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = and i8 %14, -8
%16 = icmp eq i8 %15, 48
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ log(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_log(void) { lua_pushnumber(log(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_log>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <log@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_log>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <log@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_log() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @log(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_log() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @log(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
int do_339() { return 339; }


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

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

LLVM IR (-O0):
define i32 @do_339() {
ret i32 339
}

LLVM IR (-O2):
define i32 @do_339() {
ret i32 339
}
/* Variables and functions */
int /*<<< orphan*/ absolutey();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcAbsy8(void) { sbc8(readmem65816(absolutey())); }


x86 assembly (clang, -O0):
<sbcAbsy8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutey@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1040 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcAbsy8>:
push   %rax
xor    %eax,%eax
call   1030 <absolutey@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sbc8@plt>

LLVM IR (-O0):
define void @sbcAbsy8() {
%1 = call i32 (...) @absolutey()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcAbsy8() {
%1 = tail call i32 (...) @absolutey()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
int main(void) { return (((1 - sizeof(int)) >> 16) >> 16); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
float _celsius_to_kelvin(float input) { return input + 273.15; }


x86 assembly (clang, -O0):
<_celsius_to_kelvin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_celsius_to_kelvin>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @_celsius_to_kelvin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 2.731500e+02
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @_celsius_to_kelvin(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 2.731500e+02
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int AF_INET;
int /*<<< orphan*/ EAFNOSUPPORT;
int /*<<< orphan*/ errno;
int sa_inet_pton(int family, const char *strptr, void *addrptr) {
  struct in_addr in_val;
  if (family == AF_INET) {
  }
  errno = EAFNOSUPPORT;
  return 0;
}


x86 assembly (clang, -O0):
<sa_inet_pton>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
cmp    (%rcx),%eax
jne    1126 <sa_inet_pton+0x26>
jmp    1126 <sa_inet_pton+0x26>
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea2(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_inet_pton>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @sa_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.in_addr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i32, i32* @AF_INET
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* @EAFNOSUPPORT
store i32 %13, i32* @errno
ret i32 0
}

LLVM IR (-O2):
@AF_INET = global i32 0
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @sa_inet_pton(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @EAFNOSUPPORT
store i32 %4, i32* @errno
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BLE_bless_isr_Enable();
void CyBleHal_EnableGlobalInterrupts(void) { BLE_bless_isr_Enable(); }


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

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

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

LLVM IR (-O2):
define void @CyBleHal_EnableGlobalInterrupts() {
%1 = tail call i32 (...) @BLE_bless_isr_Enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("%s <name>\n", name);
  printf("  name - the file/directory to search for.\n");
  printf("Searches go up the current directory tree, in the\n");
  printf("  same way git searches for it's config directory.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s <name>\0A\00"
@.str.1 = [44 x i8] c" name - the file/directory to search for.\0A\00"
@.str.2 = [51 x i8] c"Searches go up the current directory tree, in the\0A\00"
@.str.3 = [52 x i8] c" same way git searches for it's config directory.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s <name>\0A\00"
@str = [43 x i8] c" name - the file/directory to search for.\00"
@str.4 = [50 x i8] c"Searches go up the current directory tree, in the\00"
@str.5 = [51 x i8] c" same way git searches for it's config directory.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int equation_of_time(int);
int LAT(int time_std, int day, double longitude, double long_std) {
  int lat = 0;
  lat =
      time_std + (int)(240.0 * (long_std - longitude)) + equation_of_time(day);
  return lat;
}


x86 assembly (clang, -O0):
<LAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <equation_of_time@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LAT>:
push   %rbx
subsd  %xmm0,%xmm1
mulsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%ebx
add    %edi,%ebx
mov    %esi,%edi
call   1030 <equation_of_time@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LAT(i32 %0, i32 %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = load double, double* %8
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = fmul double 2.400000e+02, %13
%15 = fptosi double %14 to i32
%16 = add nsw i32 %10, %15
%17 = load i32, i32* %6
%18 = call i32 @equation_of_time(i32 %17)
%19 = add nsw i32 %16, %18
store i32 %19, i32* %9
%20 = load i32, i32* %9
ret i32 %20
}

LLVM IR (-O2):
define i32 @LAT(i32 %0, i32 %1, double %2, double %3) {
%5 = fsub double %3, %2
%6 = fmul double %5, 2.400000e+02
%7 = fptosi double %6 to i32
%8 = add nsw i32 %7, %0
%9 = tail call i32 @equation_of_time(i32 %1)
%10 = add nsw i32 %8, %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ isdigit(char);
unsigned int isFloat(char c) { return (isdigit(c) || c == '.'); }


x86 assembly (clang, -O0):
<isFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <isFloat+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFloat>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x2e,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isFloat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isFloat(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
double ddmm2degrees(double pcx_val) {
  double minutes;
  signed int deg;
  deg = (signed int)(pcx_val / 100.0);
  minutes = (((pcx_val / 100.0) - deg) * 100.0) / 60.0;
  return (double)deg + minutes;
}


x86 assembly (clang, -O0):
<ddmm2degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddmm2degrees>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ddmm2degrees(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.000000e+02
%7 = fptosi double %6 to i32
store i32 %7, i32* %4
%8 = load double, double* %2
%9 = fdiv double %8, 1.000000e+02
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fsub double %9, %11
%13 = fmul double %12, 1.000000e+02
%14 = fdiv double %13, 6.000000e+01
store double %14, double* %3
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = load double, double* %3
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @ddmm2degrees(double %0) {
%2 = fdiv double %0, 1.000000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fsub double %2, %4
%6 = fmul double %5, 1.000000e+02
%7 = fdiv double %6, 6.000000e+01
%8 = fadd double %7, %4
ret double %8
}
int is_valid(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_valid+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_valid(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_valid(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void __attribute__((nomips16)) foo32(float x) { printf("in foo32: %f \n", x); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"in foo32: %f \0A\00"
define void @foo32(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
void *http_malloc(unsigned int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<http_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @http_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
int isprime(int n) {
  for (int i = 2; i < n / 2; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    115b <isprime+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <isprime+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <isprime+0x62>
jmp    114d <isprime+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%eax
cmp    $0x6,%edi
jl     115b <isprime+0x5b>
mov    %edi,%r8d
shr    $0x1f,%r8d
add    %edi,%r8d
sar    %r8d
cmp    $0x4,%r8d
mov    $0x3,%esi
mov    $0x3,%r9d
cmovge %r8d,%r9d
xor    %eax,%eax
test   $0x1,%dil
je     115b <isprime+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%ecx
cmp    %esi,%r9d
je     1153 <isprime+0x53>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%esi
test   %edx,%edx
jne    1140 <isprime+0x40>
xor    %eax,%eax
cmp    %r8d,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = icmp sgt i32 %0, 5
br i1 %3, label %4, label %18
4: ; preds = %1
%5 = call i32 @llvm.smax.i32(i32 %2, i32 3)
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %4, %11
%9 = phi i32 [ %14, %11 ], [ 3, %4 ]
%10 = icmp eq i32 %9, %5
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = srem i32 %0, %9
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i32 %9, 1
br i1 %13, label %15, label %8
15: ; preds = %8, %11
%16 = icmp sge i32 %9, %2
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %15, %4, %1
%19 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %17, %15 ]
ret i32 %19
}
int main() {
  int x[5];
  return x[5];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 5
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
void foo10() {}


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

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

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

LLVM IR (-O2):
define void @foo10() {
ret void
}
int GCD(int x, int y) { return x % y == 0 ? y : GCD(y, x % y); }


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1139 <GCD+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <GCD+0x3d>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <GCD@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <GCD+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GCD(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
br label %17
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = srem i32 %13, %14
%16 = call i32 @GCD(i32 %12, i32 %15)
br label %17
17: ; preds = %11, %9
%18 = phi i32 [ %10, %9 ], [ %16, %11 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
int gesf2(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<gesf2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gesf2>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @gesf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gesf2(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ChipInfo_GetMinorHwRev(void) {
  uint32_t minorRev =
      (((*((volatile unsigned long *)(0x50001000 + 0x000000A0))) &
        0x000000FF) >>
       0);
  if (minorRev >= 0x80) {
    minorRev = 0;
  }
  return (minorRev);
}


x86 assembly (clang, -O0):
<ChipInfo_GetMinorHwRev>:
push   %rbp
mov    %rsp,%rbp
mov    $0x500010a0,%eax
mov    (%rax),%rax
and    $0xff,%rax
shr    $0x0,%rax
mov    %eax,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jl     112d <ChipInfo_GetMinorHwRev+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChipInfo_GetMinorHwRev>:
mov    0x500010a0,%rax
50
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x7f,%ecx
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ChipInfo_GetMinorHwRev() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1342181536 to i64*)
%3 = and i64 %2, 255
%4 = lshr i64 %3, 0
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp sge i32 %6, 128
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @ChipInfo_GetMinorHwRev() {
%1 = load volatile i64, i64* inttoptr (i64 1342181536 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 255
%4 = icmp ugt i32 %3, 127
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcharacterarray(char *x, int n) { lookNarray(x, (unsigned int)n); }


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

x86 assembly (clang, -O2):
<lookcharacterarray>:
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcharacterarray(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 = load i32, i32* %4
%7 = call i32 @lookNarray(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @lookcharacterarray(i8* %0, i32 %1) {
%3 = tail call i32 @lookNarray(i8* %0, i32 %1)
ret void
}