xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int triangularNumber = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
  printf("The eight triangular number is %i\n", triangularNumber);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x24,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0x24,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The eight triangular number is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 36, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The eight triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 36)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void mutter(void) {
  fprintf(stderr,
          "This mount was compiled without loop support. Please recompile.\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"This mount was compiled without loop support. Please recompile.\0A\00"
define void @mutter() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"This mount was compiled without loop support. Please recompile.\0A\00"
define void @mutter() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}
int applyF(int (*f)(int, int), int x, int y) { return f(x, y); }


x86 assembly (clang, -O0):
<applyF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyF>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @applyF(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
__attribute__((always_)) void early_reserve_e820_mpc_new(void) {}


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

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

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

LLVM IR (-O2):
define void @early_reserve_e820_mpc_new() {
ret void
}
int Cyc_Tcutil_substitute_vars_stmt(struct Cyc_List_List *subst,
                                    struct Cyc_Absyn_Stmt *e) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.Cyc_List_List = type opaque
%struct.Cyc_Absyn_Stmt = type opaque
define i32 @Cyc_Tcutil_substitute_vars_stmt(%struct.Cyc_List_List* nocapture readnone %0, %struct.Cyc_Absyn_Stmt* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t betoh32(uint8_t *buffer) {
  return ((uint32_t)buffer[0] << 24 | (uint32_t)buffer[1] << 16 |
          (uint32_t)buffer[2] << 8 | (uint32_t)buffer[3]);
}


x86 assembly (clang, -O0):
<betoh32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<betoh32>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @betoh32(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 2
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i64*, i64** %2
%21 = getelementptr inbounds i64, i64* %20, i64 3
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @betoh32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void CRYPTO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *month_name(int);
  char *n = month_name(9);
  printf("%s\n", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1040 <month_name@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @month_name(i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
void sleepy_sanders(int num) {
  int i;
  for (i = 0; i < num; i++)
    ;
}


x86 assembly (clang, -O0):
<sleepy_sanders>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <sleepy_sanders+0x2d>
jmp    111f <sleepy_sanders+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sleepy_sanders+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sleepy_sanders(i32 %0) {
ret void
}
void cam_init(void) {}


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

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

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

LLVM IR (-O2):
define void @cam_init() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != -1) {
    if (c != '\n')
      putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     1160 <main+0x40>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     115b <main+0x3b>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1130 <main+0x10>
cmp    $0xff,%al
je     1149 <main+0x29>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %2
%13 = call i32 @putchar(i8 signext %12)
br label %14
14: ; preds = %11, %7
br label %3
15: ; preds = %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %3, %0
%2 = tail call signext i8 (...) @getchar()
switch i8 %2, label %4 [
i8 -1, label %6
i8 10, label %3
]
3: ; preds = %1, %4
br label %1
4: ; preds = %1
%5 = tail call i32 @putchar(i8 signext %2)
br label %3
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int u_long;

/* Variables and functions */
u_long hash(char *str) {
  u_long hashval;
  for (hashval = 0; *str != '\0'; str++)
    hashval = *str + 31 * hashval;
  return hashval % 2048;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x800,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <hash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
lea    0x7ff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffff800,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(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 ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = mul nsw i32 31, %13
%15 = add nsw i32 %12, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
%21 = srem i32 %20, 2048
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 31
%10 = add nsw i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %10, 2048
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int test_imm_6Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x6c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 108
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int time_t;
struct timeval {
  int tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t lwm2m_gettime(void) {
  struct timeval tv;
  if (0 != gettimeofday(&tv, NULL)) {
    return -1;
  }
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<lwm2m_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     113f <lwm2m_gettime+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <lwm2m_gettime+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lwm2m_gettime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @lwm2m_gettime() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 0, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %9
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i32, i32* %7
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @lwm2m_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
scalar_t__ MTwister_Int32();
double MTwister_Real3(void) {
  return (((double)MTwister_Int32()) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<MTwister_Real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MTwister_Int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MTwister_Real3>:
push   %rax
xor    %eax,%eax
call   1030 <MTwister_Int32@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @MTwister_Real3() {
%1 = call i64 (...) @MTwister_Int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}

LLVM IR (-O2):
define double @MTwister_Real3() {
%1 = tail call i64 (...) @MTwister_Int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
void help(void) {
  fputc('\n', stderr);
  usage();
  fprintf(stderr,
          "\n"
          "-b    batch mode (quiet, exit on first error)\n"
          "-g    report number of free nodes after each GC\n"
          "-i    init mode (do not load any image)\n"
          "-n #  number of nodes to allocate (default: %dK)\n"
          "-L    print license and exit\n"
          "\n"
          "default image: %s\n\n",
          131072 / 1024, "/usr/local/share/alisp/alisp-image");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    $0x0,%al
call   1050 <usage@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
mov    $0x80,%edx
lea    0xf80(%rip),%rcx
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
call   1050 <usage@plt>
mov    (%rbx),%edi
lea    0xeac(%rip),%rsi
lea    0xf8f(%rip),%rcx
mov    $0x80,%edx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [234 x i8] c"\0A-b batch mode (quiet, exit on first error)\0A-g report number of free nodes after each GC\0A-i init mode (do not load any image)\0A-n # number of nodes to allocate (default: %dK)\0A-L print license and exit\0A\0Adefault image: %s\0A\0A\00"
@.str.1 = [35 x i8] c"/usr/local/share/alisp/alisp-image\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputc(i8 signext 10, i32 %1)
%3 = call i32 (...) @usage()
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [234 x i8] c"\0A-b batch mode (quiet, exit on first error)\0A-g report number of free nodes after each GC\0A-i init mode (do not load any image)\0A-n # number of nodes to allocate (default: %dK)\0A-L print license and exit\0A\0Adefault image: %s\0A\0A\00"
@.str.1 = [35 x i8] c"/usr/local/share/alisp/alisp-image\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputc(i8 signext 10, i32 %1)
%3 = tail call i32 (...) @usage()
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void NullFunction(void *junk __attribute__((unused))) { ; }


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

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

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

LLVM IR (-O2):
define void @NullFunction(i8* nocapture %0) {
ret void
}
double sqrt(double x) {
  double r;
  if (x < 0)
    return __domain_error();
  __asm__ __volatile__("fsqrt" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1140 <sqrt+0x30>
mov    $0x0,%al
call   1030 <__domain_error@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <sqrt+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
fldl   -0x20(%rbp)
fsqrt
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1131 <sqrt+0x21>
xor    %eax,%eax
call   1030 <__domain_error@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
ret
movsd  %xmm0,0x10(%rsp)
fldl   0x10(%rsp)
fsqrt
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 (...) @__domain_error()
%9 = sitofp i32 %8 to double
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = call double asm sideeffect "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %11)
store double %12, double* %4
%13 = load double, double* %4
store double %13, double* %2
br label %14
14: ; preds = %10, %7
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @__domain_error()
%5 = sitofp i32 %4 to double
br label %8
6: ; preds = %1
%7 = tail call double asm sideeffect "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
br label %8
8: ; preds = %6, %3
%9 = phi double [ %5, %3 ], [ %7, %6 ]
ret double %9
}
void glEnableClientState(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glEnableClientState() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ perror(char *);
void xnomem(void *p) {
  if (!p) {
    errno = ENOMEM;
    perror("libgendep.so");
  }
}


x86 assembly (clang, -O0):
<xnomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <xnomem+0x35>
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea1(%rip),%rax
mov    %ecx,(%rax)
lea    0xec0(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xnomem>:
test   %rdi,%rdi
je     1116 <xnomem+0x6>
ret
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
mov    0x2eb2(%rip),%rcx
mov    %eax,(%rcx)
lea    0xed1(%rip),%rdi
jmp    1030 <perror@plt>

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
@.str = [13 x i8] c"libgendep.so\00"
define void @xnomem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @ENOMEM
store i32 %6, i32* @errno
%7 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
@.str = [13 x i8] c"libgendep.so\00"
define void @xnomem(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
%5 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int addDigits(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", addDigits(10));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @addDigits(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @addDigits(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: dump.exfat\n");
  fprintf(stderr, "\t-V | --version                        Show version\n");
  fprintf(stderr, "\t-h | --help                           Show help\n");
  exit(EXIT_FAILURE);
}


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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: dump.exfat\0A\00"
@.str.1 = [53 x i8] c"\09-V | --version Show version\0A\00"
@.str.2 = [50 x i8] c"\09-h | --help Show help\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Usage: dump.exfat\0A\00"
@.str.1 = [53 x i8] c"\09-V | --version Show version\0A\00"
@.str.2 = [50 x i8] c"\09-h | --help Show help\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
int fun514() { return 514; }


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

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

LLVM IR (-O0):
define i32 @fun514() {
ret i32 514
}

LLVM IR (-O2):
define i32 @fun514() {
ret i32 514
}
printd(n) register int n;
{
  register int a, nchars;
  if (a = n / 10)
    nchars = 1 + printd(a);
  else
    nchars = 1;
  putchar(n % 10 + '0');
  return (nchars);
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1155 <printd+0x35>
mov    -0x8(%rbp),%edi
call   1040 <printd@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <printd+0x3c>
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %r14
push   %rbx
push   %rax
lea    0x9(%rdi),%eax
mov    $0x1,%ebx
movslq %edi,%r14
cmp    $0x13,%eax
jb     1152 <printd+0x32>
imul   $0x66666667,%r14,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
call   1040 <printd@plt>
mov    %eax,%ebx
add    $0x1,%ebx
imul   $0x66666667,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%r14,%rax,1),%edi
add    $0x30,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @printd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @printd(i32 %9)
%11 = add nsw i32 1, %10
store i32 %11, i32* %4
br label %13
12: ; preds = %1
store i32 1, i32* %4
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
%15 = srem i32 %14, 10
%16 = add nsw i32 %15, 48
%17 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %16)
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @printd(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 10
%6 = tail call i32 @printd(i32 %5)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
%10 = srem i32 %0, 10
%11 = add nsw i32 %10, 48
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %11)
ret i32 %9
}
void xdgFreeStringList(char **list) {
  char **ptr = list;
  if (!list)
    return;
  for (; *ptr; ptr++)
    free(*ptr);
  free(list);
}


x86 assembly (clang, -O0):
<xdgFreeStringList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <xdgFreeStringList+0x24>
jmp    116d <xdgFreeStringList+0x5d>
jmp    1139 <xdgFreeStringList+0x29>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <xdgFreeStringList+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <xdgFreeStringList+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdgFreeStringList>:
test   %rdi,%rdi
je     1150 <xdgFreeStringList+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <xdgFreeStringList+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <xdgFreeStringList+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xdgFreeStringList(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %1, %12
ret void
}
void ledInit(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XGetErrorText() {
ret void
}
int fls(int x) {
  int r;
  __asm__("bsrl %1,%0\n\t"
          "jnz 1f\n\t"
          "movl $-1,%0\n"
          "1:"
          : "=r"(r)
          : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsr    -0xc(%rbp),%eax
jne    111c <fls+0x1c>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
jne    1110 <fls+0x10>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @fls(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int rand();
void pingCounter(unsigned char *pdata, unsigned short val) {
  unsigned short pid = rand() % 65535;
  if (val < 65536) {
    *(pdata + 40) = (unsigned char)((val >> 8) & 0xff);
    *(pdata + 41) = (unsigned char)((val >> 0) & 0xff);
  }
}


x86 assembly (clang, -O0):
<pingCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xffff,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x10000,%eax
jge    1172 <pingCounter+0x62>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x28(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x29(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pingCounter>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
rol    $0x8,%bx
mov    %bx,0x28(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @pingCounter(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 65535
%8 = trunc i32 %7 to i16
store i16 %8, i16* %5
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = icmp slt i32 %10, 65536
br i1 %11, label %12, label %27
12: ; preds = %2
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 40
store i8 %17, i8* %19
%20 = load i16, i16* %4
%21 = zext i16 %20 to i32
%22 = ashr i32 %21, 0
%23 = and i32 %22, 255
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 41
store i8 %24, i8* %26
br label %27
27: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @pingCounter(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = tail call i32 (...) @rand()
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 40
store i8 %5, i8* %6
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 41
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int DES_set_key(void *key, void *schedule) {
  printf("DES_set_key stubbed\n");
  (void)&(key);
  (void)&(schedule);
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"DES_set_key stubbed\00"
define i32 @DES_set_key(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *get_api_key() { return "key\0"; }


x86 assembly (clang, -O0):
<get_api_key>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_api_key>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"key\00\00"
define i8* @get_api_key() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"key\00\00"
define i8* @get_api_key() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool __u32_leq(void *a, void *b) { return *(uint32_t *)a <= *(uint32_t *)b; }


x86 assembly (clang, -O0):
<__u32_leq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__u32_leq>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
setle  %al
ret

LLVM IR (-O0):
define i32 @__u32_leq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp sle i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @__u32_leq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sle i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int an_int = 1;
  char *ptr = (char *)&an_int;
  if (((int)*ptr) == 1)
    printf("The system is little endian\n");
  else
    printf("The system is big endian\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    114f <main+0x3f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <main+0x4b>
lea    0xec7(%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 = [29 x i8] c"The system is little endian\0A\00"
@.str.1 = [26 x i8] c"The system is big endian\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"The system is little endian\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int _lseek(int fd, int ptr, int dir) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
int add(int val1, int val2) { return val1 + val2; }


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

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

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
double monte_fact(double x) {
  long i;
  double y = 1;
  if (x <= 1) {
    return (1);
  }
  for (i = 1; i <= x; i++) {
    y *= (double)i;
  }
  return (y);
}


x86 assembly (clang, -O0):
<monte_fact>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xee2(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113b <monte_fact+0x3b>
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <monte_fact+0x83>
movq   $0x1,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1179 <monte_fact+0x79>
cvtsi2sdq -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <monte_fact+0x43>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<monte_fact>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1136 <monte_fact+0x36>
movsd  0xeea(%rip),%xmm2
mov    $0x2,%eax
movapd %xmm2,%xmm1
nop
mulsd  %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sd %rax,%xmm2
add    $0x1,%rax
ucomisd %xmm2,%xmm0
jae    1120 <monte_fact+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @monte_fact(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i64
%5 = alloca double
store double %0, double* %3
store double 1.000000e+00, double* %5
%6 = load double, double* %3
%7 = fcmp ole double %6, 1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store double 1.000000e+00, double* %2
br label %25
9: ; preds = %1
store i64 1, i64* %4
br label %10
10: ; preds = %20, %9
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to double
%13 = load double, double* %3
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = load i64, i64* %4
%17 = sitofp i64 %16 to double
%18 = load double, double* %5
%19 = fmul double %18, %17
store double %19, double* %5
br label %20
20: ; preds = %15
%21 = load i64, i64* %4
%22 = add nsw i64 %21, 1
store i64 %22, i64* %4
br label %10
23: ; preds = %10
%24 = load double, double* %5
store double %24, double* %2
br label %25
25: ; preds = %23, %8
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @monte_fact(double %0) {
%2 = fcmp ule double %0, 1.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi double [ %9, %3 ], [ 1.000000e+00, %1 ]
%5 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
%6 = phi i64 [ %8, %3 ], [ 1, %1 ]
%7 = fmul double %5, %4
%8 = add nuw nsw i64 %6, 1
%9 = sitofp i64 %8 to double
%10 = fcmp ugt double %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi double [ 1.000000e+00, %1 ], [ %7, %3 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void PrintResult(char *m) {
  int i = 0;
  while (m[i] != '\0') {
    putchar(m[i]);
    i++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1167 <PrintResult+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <PrintResult+0x13>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @PrintResult(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @putchar(i8 signext %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

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