xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void tst_cast(void) {
  signed char c = (signed char)0xaaaaaaaa;
  int r = (unsigned short)c ^ (signed char)0x99999999;
  printf("schar to ushort cast: %x\n", r);
}


x86 assembly (clang, -O0):
<tst_cast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xaa,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movzwl %ax,%eax
xor    $0xffffff99,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_cast>:
lea    0xee9(%rip),%rdi
mov    $0xffff0033,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"schar to ushort cast: %x\0A\00"
define void @tst_cast() {
%1 = alloca i8
%2 = alloca i32
store i8 -86, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i16
%5 = zext i16 %4 to i32
%6 = xor i32 %5, -103
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"schar to ushort cast: %x\0A\00"
define void @tst_cast() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 -65485)
ret void
}
void ajVaroutExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajVaroutExit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int baz(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main() { return baz((bar(), foo())); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    %eax,%edi
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1050 <foo@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <baz@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 (...) @foo()
%4 = call i32 @baz(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 @baz(i32 %2)
ret i32 %3
}
int do_061() { return 61; }


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

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

LLVM IR (-O0):
define i32 @do_061() {
ret i32 61
}

LLVM IR (-O2):
define i32 @do_061() {
ret i32 61
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct epoll_event *, int, int);
int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to) {
  return syscall(256, fd, ev, cnt, to);
}


x86 assembly (clang, -O0):
<epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x100,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_wait>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x100,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.epoll_event*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.epoll_event* %1, %struct.epoll_event** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.epoll_event*, %struct.epoll_event** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 256, i32 %9, %struct.epoll_event* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 256, i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void clear_() { clear(); }


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

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

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

LLVM IR (-O2):
define void @clear_() {
%1 = tail call i32 (...) @clear()
ret void
}
unsigned int MmioUtil_Read32(void *base, const unsigned long offset) {
  return *(volatile unsigned int *)(void *)((char *)(base) + (offset));
}


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

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

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

LLVM IR (-O2):
define i32 @MmioUtil_Read32(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: leave [[+]hhmm]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: leave [[+]hhmm]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: leave [[+]hhmm]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strdup(char const *);
char *my_strdup(const char *s) {
  char *ptr = strdup(s);
  assert(ptr != NULL);
  return (ptr);
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @my_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
void end_rwprep() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gdk_window_constrain_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintNetworkInterfaceInfos();
int main() {
  PrintNetworkInterfaceInfos();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PrintNetworkInterfaceInfos@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <PrintNetworkInterfaceInfos@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @PrintNetworkInterfaceInfos()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("PASS\n");
  return (int)((unsigned long long)argc / argv[0][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    0xed3(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movsbq (%rcx),%rcx
xor    %edx,%edx
div    %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
movslq %ebp,%rax
mov    (%rbx),%rcx
movsbq (%rcx),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1141 <main+0x31>
xor    %edx,%edx
div    %rcx
jmp    1147 <main+0x37>
mov    %ebp,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\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 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i64
%15 = udiv i64 %8, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%4 = sext i32 %0 to i64
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = udiv i64 %4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
int exynos5_bus_mif_put(struct exynos5_bus_mif_handle *handle) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.exynos5_bus_mif_handle = type opaque
define i32 @exynos5_bus_mif_put(%struct.exynos5_bus_mif_handle* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_TYPE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ANY_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_TYPE *ASN1_TYPE_new(void) {
  return (ASN1_TYPE *)ASN1_item_new(&ASN1_ANY_it);
}


x86 assembly (clang, -O0):
<ASN1_TYPE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_TYPE_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ASN1_ANY_it = global i32 0
define i32* @ASN1_TYPE_new() {
%1 = call i64 @ASN1_item_new(i32* @ASN1_ANY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ASN1_ANY_it = global i32 0
define i32* @ASN1_TYPE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_ANY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
void gtk_radio_tool_button_new_from_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_tool_button_new_from_widget() {
ret void
}
int invalid_pointer(void *p) { return p == 0 || p == (void *)-1; }


x86 assembly (clang, -O0):
<invalid_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1129 <invalid_pointer+0x29>
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_pointer>:
test   %rdi,%rdi
sete   %al
cmp    $0xffffffffffffffff,%rdi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @invalid_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, inttoptr (i64 -1 to i8*)
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalid_pointer(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = icmp eq i8* %0, inttoptr (i64 -1 to i8*)
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double pow(double, int);
double speeds_ratio(double maximum_speed, double minimum_speed) {
  double value = 0.0;
  value = maximum_speed / minimum_speed;
  value = pow(value, -5);
  return value;
}


x86 assembly (clang, -O0):
<speeds_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0xfffffffb,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<speeds_ratio>:
divsd  %xmm1,%xmm0
mov    $0xfffffffb,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @speeds_ratio(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @pow(double %9, i32 -5)
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @speeds_ratio(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @pow(double %3, i32 -5)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world from T1 main!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Hello world from T1 main!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Hello world from T1 main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ lgamma(double);
long double lgammal(long double x) { return (long double)lgamma((double)x); }


x86 assembly (clang, -O0):
<lgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <lgamma@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammal>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <lgamma@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @lgamma(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @lgammal(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @lgamma(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char buf[100];
  fgets(buf, 100, stdin);
  printf(buf);
  fgets(buf, 100, stdin);
  printf(buf);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1030 <printf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2eba(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 100, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 100, i32 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @printf(i8* %15)
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}

LLVM IR (-O2):
@stdin = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 100, i32 %5)
%7 = call i32 @printf(i8* %4)
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %4, i32 100, i32 %8)
%10 = call i32 @printf(i8* %4)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
void ffi_cparser_free(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ffi_cparser_free() {
ret void
}
int isprime(int n) {
  int i;
  if (n <= 1)
    return 0;
  if (n == 2)
    return 1;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     111d <isprime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1180 <isprime+0x80>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <isprime+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1180 <isprime+0x80>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1179 <isprime+0x79>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1166 <isprime+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1180 <isprime+0x80>
jmp    116b <isprime+0x6b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <isprime+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <isprime+0xa>
mov    %ecx,%eax
ret
cmp    $0x4,%edi
jae    1115 <isprime+0x15>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <isprime+0x7>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1120 <isprime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i32 %12, %12
%7 = icmp sgt i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %12, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %8 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ has_cpuid();
scalar_t__ is_via_cpu();
int read_via_flags();
int via_rng_test(void) {
  return has_cpuid() && is_via_cpu() &&
         ((read_via_flags() & (0x00000004 | 0x00000008)) ==
          (0x00000004 | 0x00000008));
}


x86 assembly (clang, -O0):
<via_rng_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <has_cpuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     117d <via_rng_test+0x4d>
mov    $0x0,%al
call   1040 <is_via_cpu@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     117d <via_rng_test+0x4d>
mov    $0x0,%al
call   1030 <read_via_flags@plt>
and    $0xc,%eax
cmp    $0xc,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<via_rng_test>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <has_cpuid@plt>
test   %rax,%rax
je     115d <via_rng_test+0x2d>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <is_via_cpu@plt>
test   %rax,%rax
je     115d <via_rng_test+0x2d>
xor    %eax,%eax
call   1030 <read_via_flags@plt>
not    %eax
xor    %ebx,%ebx
test   $0xc,%al
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @via_rng_test() {
%1 = call i64 (...) @has_cpuid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = call i64 (...) @is_via_cpu()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @read_via_flags()
%8 = and i32 %7, 12
%9 = icmp eq i32 %8, 12
br label %10
10: ; preds = %6, %3, %0
%11 = phi i1 [ false, %3 ], [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @via_rng_test() {
%1 = tail call i64 (...) @has_cpuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0
%4 = tail call i64 (...) @is_via_cpu()
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i32 (...) @read_via_flags()
%8 = and i32 %7, 12
%9 = icmp eq i32 %8, 12
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %3, %0
%12 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %10, %6 ]
ret i32 %12
}
double DSQR(double a) {
  if (a == 0.0) {
    return 0.0;
  } else {
    return a * a;
  }
}


x86 assembly (clang, -O0):
<DSQR>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <DSQR+0x2e>
jp     112e <DSQR+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113d <DSQR+0x3d>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSQR>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpeqsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @DSQR(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
7: ; preds = %1
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %2
br label %11
11: ; preds = %7, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @DSQR(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fmul double %0, %0
%4 = select i1 %2, double 0.000000e+00, double %3
ret double %4
}
unsigned long bit_mask(register unsigned long pos) {
  return ((1 << (pos)) - 1);
}


x86 assembly (clang, -O0):
<bit_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_mask>:
mov    %rdi,%rcx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
cltq
ret

LLVM IR (-O0):
define i64 @bit_mask(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @bit_mask(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nsw i32 -1, %2
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int irand();
double rand01() { return (double)(irand() / 2147483647.); }


x86 assembly (clang, -O0):
<rand01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <irand@plt>
cvtsi2sd %eax,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand01>:
push   %rax
xor    %eax,%eax
call   1030 <irand@plt>
cvtsi2sd %eax,%xmm0
divsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand01() {
%1 = call i32 (...) @irand()
%2 = sitofp i32 %1 to double
%3 = fdiv double %2, 0x41DFFFFFFFC00000
ret double %3
}

LLVM IR (-O2):
define double @rand01() {
%1 = tail call i32 (...) @irand()
%2 = sitofp i32 %1 to double
%3 = fdiv double %2, 0x41DFFFFFFFC00000
ret double %3
}
/* Type definitions */
struct bladerf {
  int dummy;
};

/* Variables and functions */
int lms_txvga1_set_gain(struct bladerf *, int);
int lms_txvga2_set_gain(struct bladerf *, int);
int set_tx_gain_combo(struct bladerf *dev, int txvga1, int txvga2) {
  int status;
  status = lms_txvga1_set_gain(dev, txvga1);
  if (status == 0) {
    status = lms_txvga2_set_gain(dev, txvga2);
  }
  return status;
}


x86 assembly (clang, -O0):
<set_tx_gain_combo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <lms_txvga1_set_gain@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115a <set_tx_gain_combo+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <lms_txvga2_set_gain@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tx_gain_combo>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1040 <lms_txvga1_set_gain@plt>
test   %eax,%eax
je     1138 <set_tx_gain_combo+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lms_txvga2_set_gain@plt>

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

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @set_tx_gain_combo(%struct.bladerf* %0, i32 %1, i32 %2) {
%4 = tail call i32 @lms_txvga1_set_gain(%struct.bladerf* %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @lms_txvga2_set_gain(%struct.bladerf* %0, i32 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
void video_unbind_context(struct host *base) {}


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

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

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

LLVM IR (-O2):
%struct.host = type opaque
define void @video_unbind_context(%struct.host* nocapture %0) {
ret void
}
int test_imm_4Dint8_reg(signed char val) {
  return ((val) & (0x4D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Dint8_reg(i8 signext %0) {
%2 = and i8 %0, 77
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRSETPOLYFILLMODE_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 1, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRSETPOLYFILLMODE_swap>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

LLVM IR (-O0):
define void @U_WMRSETPOLYFILLMODE_swap(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 @U_WMRCORE_N16_swap(i8* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRSETPOLYFILLMODE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 1, i32 %1)
ret void
}
void printfUINT(unsigned int number) {}


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

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

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

LLVM IR (-O2):
define void @printfUINT(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
const char *ucs_symbol(unsigned int i) {
  static char buf[11 + 1];
  sprintf(buf, (i < 0x10000 ? "<U%04X>" : "<U%08X>"), i);
  return buf;
}


x86 assembly (clang, -O0):
<ucs_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee3(%rip),%rsi
lea    0xed4(%rip),%rax
cmp    $0x10000,%ecx
cmovb  %rax,%rsi
mov    -0x4(%rbp),%edx
lea    0x2ee9(%rip),%rdi
call   1030 <sprintf@plt>
lea    0x2edd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucs_symbol>:
push   %rbx
mov    %edi,%edx
cmp    $0x10000,%edi
lea    0xee0(%rip),%rax
lea    0xee1(%rip),%rsi
cmovb  %rax,%rsi
lea    0x2ef7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ucs_symbol.buf = internal global [12 x i8] zeroinitializer
@.str = [8 x i8] c"<U%04X>\00"
@.str.1 = [8 x i8] c"<U%08X>\00"
define i8* @ucs_symbol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 65536
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @ucs_symbol.buf, i64 0, i64 0), i8* %6, i32 %7)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @ucs_symbol.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@ucs_symbol.buf = internal global [12 x i8] zeroinitializer
@.str = [8 x i8] c"<U%04X>\00"
@.str.1 = [8 x i8] c"<U%08X>\00"
define i8* @ucs_symbol(i32 %0) {
%2 = icmp ult i32 %0, 65536
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @ucs_symbol.buf, i64 0, i64 0), i8* dereferenceable(1) %3, i32 %0)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @ucs_symbol.buf, i64 0, i64 0)
}
/* Type definitions */
struct avl_table {
  int dummy;
};

/* Variables and functions */
void **avl_probe(struct avl_table *, void *);
void *avl_replace(struct avl_table *table, void *item) {
  void **p = avl_probe(table, item);
  if (p == NULL || *p == item)
    return NULL;
  else {
    void *r = *p;
    *p = item;
    return r;
  }
}


x86 assembly (clang, -O0):
<avl_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <avl_probe@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <avl_replace+0x3d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    115a <avl_replace+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1178 <avl_replace+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avl_replace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <avl_probe@plt>
test   %rax,%rax
je     112e <avl_replace+0x1e>
mov    %rax,%rcx
mov    (%rax),%rax
cmp    %rbx,%rax
je     112e <avl_replace+0x1e>
mov    %rbx,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.avl_table = type { i32 }
define i8* @avl_replace(%struct.avl_table* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.avl_table*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store %struct.avl_table* %0, %struct.avl_table** %4
store i8* %1, i8** %5
%8 = load %struct.avl_table*, %struct.avl_table** %4
%9 = load i8*, i8** %5
%10 = call i8** @avl_probe(%struct.avl_table* %8, i8* %9)
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = icmp eq i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %25
19: ; preds = %13
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %6
store i8* %22, i8** %23
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.avl_table = type { i32 }
define i8* @avl_replace(%struct.avl_table* %0, i8* %1) {
%3 = tail call i8** @avl_probe(%struct.avl_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* %1, i8** %3
br label %9
9: ; preds = %2, %5, %8
%10 = phi i8* [ %6, %8 ], [ null, %5 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ execute_word(char *, void *);
scalar_t__ init_forth();
int /*<<< orphan*/ init_io();
main() {
  void *up;
  init_io();
  up = (void *)init_forth();
  execute_word("app", up);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init_io@plt>
mov    $0x0,%al
call   1050 <init_forth@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <execute_word@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_io@plt>
xor    %eax,%eax
call   1050 <init_forth@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1030 <execute_word@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"app\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i32 (...) @init_io()
%3 = call i64 (...) @init_forth()
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @execute_word(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"app\00"
define i32 @main() {
%1 = tail call i32 (...) @init_io()
%2 = tail call i64 (...) @init_forth()
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @execute_word(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int match(char *str, char *pat) {
  int match1(char *, char *);
  if (*str == '.' && *pat != '.')
    return 0;
  return match1(str, pat);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    114c <match+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     114c <match+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115c <match+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <match1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
cmpb   $0x2e,(%rdi)
jne    111a <match+0xa>
cmpb   $0x2e,(%rsi)
jne    111f <match+0xf>
jmp    1030 <match1@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 @match1(i8* %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 0, %5 ]
ret i32 %11
}
__attribute__((always_)) void octave_fin(char *file, char *a, char *q) {}


x86 assembly (clang, -O0):
<octave_fin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @octave_fin(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hey, Buddy!\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hey, Buddy!\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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hey, Buddy!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int open_nomap_nolog(const char *pathname, int flags, mode_t mode) {
  return open(pathname, flags, mode);
}


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

x86 assembly (clang, -O2):
<open_nomap_nolog>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @open_nomap_nolog(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @open(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @open_nomap_nolog(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int isbugged();
int main() { return isbugged(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <isbugged@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @isbugged()
ret i32 %1
}
/* Variables and functions */
int dbar(double, double);
int sb(double, double);
int ubar(double, double);
int uv(double, double);
double F2_cc_nu_n(double xx, double Q2) {
  return 2 * (uv(xx, Q2) + sb(xx, Q2) + dbar(xx, Q2) + ubar(xx, Q2));
}


x86 assembly (clang, -O0):
<F2_cc_nu_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <uv@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <ubar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F2_cc_nu_n>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <uv@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <sb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <dbar@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <ubar@plt>
add    %ebx,%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @F2_cc_nu_n(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 i32 @uv(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 @sb(double %8, double %9)
%11 = add nsw i32 %7, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @dbar(double %12, double %13)
%15 = add nsw i32 %11, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = call i32 @ubar(double %16, double %17)
%19 = add nsw i32 %15, %18
%20 = mul nsw i32 2, %19
%21 = sitofp i32 %20 to double
ret double %21
}

LLVM IR (-O2):
define double @F2_cc_nu_n(double %0, double %1) {
%3 = tail call i32 @uv(double %0, double %1)
%4 = tail call i32 @sb(double %0, double %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @dbar(double %0, double %1)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @ubar(double %0, double %1)
%9 = add nsw i32 %7, %8
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
ret double %11
}
/* Variables and functions */
int M_PI;
double degree(double radian) { return radian * (180. / M_PI); }


x86 assembly (clang, -O0):
<degree>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
cvtsi2sdl (%rax),%xmm2
movsd  0xedf(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree>:
mov    0x2ee1(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xeed(%rip),%xmm2
divsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @degree(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.800000e+02, %5
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @degree(double %0) {
%2 = load i32, i32* @M_PI
%3 = sitofp i32 %2 to double
%4 = fdiv double 1.800000e+02, %3
%5 = fmul double %4, %0
ret double %5
}