xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void RFCCpeIntEnable(uint32_t ui32Mask) {
  (*((volatile unsigned long *)(0x40041000 + 0x00000014))) |= ui32Mask;
}


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

x86 assembly (clang, -O2):
<RFCCpeIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x40041014
40
ret

LLVM IR (-O0):
define void @RFCCpeIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074008084 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074008084 to i64*)
ret void
}

LLVM IR (-O2):
define void @RFCCpeIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074008084 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074008084 to i64*)
ret void
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned char, int, unsigned char *, int);
int fc8150_read(void *hDevice, unsigned char addr, unsigned char *data) {
  int res;
  res = tuner_i2c_read(hDevice, addr, 1, data, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8150_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzbl %al,%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_read>:
mov    %rdx,%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
jmp    1030 <tuner_i2c_read@plt>

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

LLVM IR (-O2):
define i32 @fc8150_read(i8* %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @tuner_i2c_read(i8* %0, i8 zeroext %1, i32 1, i8* %2, i32 1)
ret i32 %4
}
int QuotedArg(str)
char *str;
{
  while (*str) {
    if ((*str == ' ') || (*str == '\t'))
      return 1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<QuotedArg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <QuotedArg+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1135 <QuotedArg+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1141 <QuotedArg+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1159 <QuotedArg+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <QuotedArg+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuotedArg>:
movzbl (%rdi),%eax
test   %al,%al
je     111b <QuotedArg+0x1b>
cmp    $0x9,%al
je     1115 <QuotedArg+0x15>
cmp    $0x20,%al
je     1115 <QuotedArg+0x15>
add    $0x1,%rdi
jmp    1100 <QuotedArg>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @QuotedArg(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %9
}
int test1n(long long n) {
  if (n < -1LL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test1n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jge    111f <test1n+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <test1n+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1n>:
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @test1n(i64 %0) {
%2 = icmp slt i64 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int ads129x_start_acquisition(int ads129x_fd) {
  return ioctl(ads129x_fd, _IO('m', 0x10), 0);
}


x86 assembly (clang, -O0):
<ads129x_start_acquisition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x6d,%edi
mov    $0x10,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ads129x_start_acquisition>:
push   %rbx
mov    %edi,%ebx
mov    $0x6d,%edi
mov    $0x10,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @ads129x_start_acquisition(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 109, i32 16)
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ads129x_start_acquisition(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 109, i32 16)
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char c, C;
  scanf("%c", &c);
  C = c - 32;
  printf("%c", C);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x6(%rbp)
lea    0xeb0(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
add    $0xe0,%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = add i8 %3, -32
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
int isValid(char c) { return c == '.' || c == '!' || c == '?'; }


x86 assembly (clang, -O0):
<isValid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     113b <isValid+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x21,%ecx
mov    %al,-0x2(%rbp)
je     113b <isValid+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x3f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValid>:
mov    $0x1,%eax
cmp    $0x21,%dil
je     1111 <isValid+0x11>
cmp    $0x2e,%dil
jne    1112 <isValid+0x12>
ret
xor    %eax,%eax
cmp    $0x3f,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isValid(i8 signext %0) {
switch i8 %0, label %2 [
i8 46, label %5
i8 33, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 63
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void help(int c) {
  puts("Displays a number in various base representations.\n\t-b"
       "|--base"
       " [base]\tforce a base. Possible values are 2 through 36.\n\t-v"
       "|--version"
       "\t\toutput version then exit.\n\t"
       "--help\t"
       "\t\tview this help.");
  exit(c);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [184 x i8] c"Displays a number in various base representations.\0A\09-b|--base [base]\09force a base. Possible values are 2 through 36.\0A\09-v|--version\09\09output version then exit.\0A\09--help\09\09\09view this help.\00"
define void @help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [184 x i8] c"Displays a number in various base representations.\0A\09-b|--base [base]\09force a base. Possible values are 2 through 36.\0A\09-v|--version\09\09output version then exit.\0A\09--help\09\09\09view this help.\00"
define void @help(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
__attribute__((no, noclone)) int foo(int i) {
  int *p = &i;
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
int BISHOP_PIN(int sqSrc, int sqDst) { return (sqSrc + sqDst) >> 1; }


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

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

LLVM IR (-O0):
define i32 @BISHOP_PIN(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
%8 = ashr i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @BISHOP_PIN(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = ashr i32 %3, 1
ret i32 %4
}
int test_imm_DDuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xDD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DDuint64_highword_reg>:
movabs $0xdd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DDuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 221
%6 = icmp ne i64 %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_DDuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 949187772416
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cvmx_helper_get_interface_index_num(int ipd_port) { return ipd_port; }


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

x86 assembly (clang, -O2):
<cvmx_helper_get_interface_index_num>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cvmx_helper_get_interface_index_num(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_mul(uintptr_t, uintptr_t, uintptr_t);
void fiat_p434_mul(uint64_t out1[7], const uint64_t arg1[7],
                   const uint64_t arg2[7]) {
  internal_fiat_p434_mul((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p434_mul>:
jmp    1030 <internal_fiat_p434_mul@plt>

LLVM IR (-O0):
define void @fiat_p434_mul(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
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p434_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p434_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
scalar_t__ pow(float, double);
float float_srgb2linear(float value) { return (float)pow(value, 2.2); }


x86 assembly (clang, -O0):
<float_srgb2linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_srgb2linear>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @float_srgb2linear(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @pow(float %3, double 2.200000e+00)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @float_srgb2linear(float %0) {
%2 = tail call i64 @pow(float %0, double 2.200000e+00)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int main(void) {
  initscr();
  addstr("ncurses test!  ");
  refresh();
  getch();
  endwin();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1070 <addstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1070 <addstr@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"ncurses test! \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @addstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"ncurses test! \00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @addstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
double toDegrees(double angrad) { return angrad * 180.0 / 3.14; }


x86 assembly (clang, -O0):
<toDegrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toDegrees>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @toDegrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 3.140000e+00
ret double %5
}

LLVM IR (-O2):
define double @toDegrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 3.140000e+00
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XTextItem16;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XTextItem16(void *_p) {
  if (_p == NULL)
    abort();
  free((XTextItem16 *)_p);
}


x86 assembly (clang, -O0):
<free_XTextItem16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XTextItem16+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XTextItem16>:
test   %rdi,%rdi
je     112a <free_XTextItem16+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XTextItem16(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 %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XTextItem16(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ncsListEndGraf();
void ncsTempListExit() {
  ncsListEndGraf();
  exit(0);
}


x86 assembly (clang, -O0):
<ncsTempListExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ncsListEndGraf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ncsTempListExit>:
push   %rax
xor    %eax,%eax
call   1030 <ncsListEndGraf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @ncsTempListExit() {
%1 = call i32 (...) @ncsListEndGraf()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @ncsTempListExit() {
%1 = tail call i32 (...) @ncsListEndGraf()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int MB = 0;
  while (malloc(1 << 20))
    ++MB;
  printf("%d MB\n", MB);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x100000,%edi
call   1040 <malloc@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <main+0x10>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d MB\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = call i64 @malloc(i32 1048576)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d MB\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @malloc(i32 1048576)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ back_sub();
int /*<<< orphan*/ guass_openMP();
int /*<<< orphan*/ print_data();
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ printf(char *);
void parallel_openMP() {
  printf("\tExecuting in Parallel using openMP.\n");
  guass_openMP();
  print_data();
  back_sub();
  print_result();
}


x86 assembly (clang, -O0):
<parallel_openMP>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <guass_openMP@plt>
mov    $0x0,%al
call   1060 <print_data@plt>
mov    $0x0,%al
call   1070 <back_sub@plt>
mov    $0x0,%al
call   1050 <print_result@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_openMP>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <guass_openMP@plt>
xor    %eax,%eax
call   1060 <print_data@plt>
xor    %eax,%eax
call   1070 <back_sub@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <print_result@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\09Executing in Parallel using openMP.\0A\00"
define void @parallel_openMP() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @guass_openMP()
%3 = call i32 (...) @print_data()
%4 = call i32 (...) @back_sub()
%5 = call i32 (...) @print_result()
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"\09Executing in Parallel using openMP.\00"
define void @parallel_openMP() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @guass_openMP()
%3 = tail call i32 (...) @print_data()
%4 = tail call i32 (...) @back_sub()
%5 = tail call i32 (...) @print_result()
ret void
}
/* Variables and functions */
int getgid();
int getpid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  printf("hello world from process id %d, uid %d, gid %d\n", getpid(), getuid(),
         getgid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    %eax,%ecx
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getgid@plt>
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"hello world from process id %d, uid %d, gid %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 (...) @getuid()
%4 = call i32 (...) @getgid()
%5 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"hello world from process id %d, uid %d, gid %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getuid()
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void help(void) {
  static const char help_string[] =
      "\n Usage: ic706_server [options]\n"
      "\n Possible options are:\n"
      "\n"
      "  -p    Network port number (default is 42000).\n"
      "  -u    Uart port (default is /dev/ttyO1).\n"
      "  -h    This help message.\n\n";
  fprintf(stderr, "%s", help_string);
}


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

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

LLVM IR (-O0):
@help.help_string = internal constant [177 x i8] c"\0A Usage: ic706_server [options]\0A\0A Possible options are:\0A\0A -p Network port number (default is 42000).\0A -u Uart port (default is /dev/ttyO1).\0A -h This help message.\0A\0A\00"
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @help.help_string, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@help.help_string = internal constant [177 x i8] c"\0A Usage: ic706_server [options]\0A\0A Possible options are:\0A\0A -p Network port number (default is 42000).\0A -u Uart port (default is /dev/ttyO1).\0A -h This help message.\0A\0A\00"
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @help.help_string, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void tdspeed_free_buffers(int32_t **buffers, int nbuf) {
  int i;
  for (i = 0; i < nbuf; i++) {
    free(buffers[i]);
  }
}


x86 assembly (clang, -O0):
<tdspeed_free_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <tdspeed_free_buffers+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <tdspeed_free_buffers+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdspeed_free_buffers>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <tdspeed_free_buffers+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tdspeed_free_buffers+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @tdspeed_free_buffers(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = call i32 @free(i32* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @tdspeed_free_buffers(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = load i32*, i32** %8
%10 = tail call i32 @free(i32* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_Pertelian_list(void) {
  printf("Pertelian X2040 displays");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Pertelian X2040 displays\00"
define i32 @drv_Pertelian_list() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Pertelian X2040 displays\00"
define i32 @drv_Pertelian_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long double btdtrl(a, b, x)
long double a, b, x;
{ return (incbetl(a, b, x)); }


x86 assembly (clang, -O0):
<btdtrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
xor    %eax,%eax
call   1030 <incbetl@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btdtrl>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <incbetl@plt>
mov    %eax,0x34(%rsp)
fildl  0x34(%rsp)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @btdtrl(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %6
%10 = call i32 (x86_fp80, x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @incbetl to i32 (x86_fp80, x86_fp80, x86_fp80, ...)*)(x86_fp80 %7, x86_fp80 %8, x86_fp80 %9)
%11 = sitofp i32 %10 to x86_fp80
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @btdtrl(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call i32 (x86_fp80, x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @incbetl to i32 (x86_fp80, x86_fp80, x86_fp80, ...)*)(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
%5 = sitofp i32 %4 to x86_fp80
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i, s = 0;
  for (i = 1; i <= 100; i++) {
    s = s + i;
  }
  printf("%d", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%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    $0x13ba,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int wait(int *);
void received_sigchld_on_tcpserver(int sig) {
  int status, pid;
  pid = wait(&status);
  printf("wait pid=%d status=%d\n", pid, status);
}


x86 assembly (clang, -O0):
<received_sigchld_on_tcpserver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<received_sigchld_on_tcpserver>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
mov    0x4(%rsp),%edx
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"wait pid=%d status=%d\0A\00"
define void @received_sigchld_on_tcpserver(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessageIntSev_(int /*<<< orphan*/, char const *,
                                         int const *, int);
void DymosimMessageInt_(const char *message, const int *i, int lstr) {
  DymosimMessageIntSev_(0, message, i, lstr);
}


x86 assembly (clang, -O0):
<DymosimMessageInt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
call   1030 <DymosimMessageIntSev_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DymosimMessageInt_>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <DymosimMessageIntSev_@plt>

LLVM IR (-O0):
define void @DymosimMessageInt_(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 @DymosimMessageIntSev_(i32 0, i8* %7, i32* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @DymosimMessageInt_(i8* %0, i32* %1, i32 %2) {
%4 = tail call i32 @DymosimMessageIntSev_(i32 0, i8* %0, i32* %1, i32 %2)
ret void
}
/* Type definitions */
struct display_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ssd1306_close(struct display_info *);
void cleanup(int status, void *disp) {
  ssd1306_close((struct display_info *)disp);
}


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

x86 assembly (clang, -O2):
<cleanup>:
mov    %rsi,%rdi
jmp    1030 <ssd1306_close@plt>

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

LLVM IR (-O2):
%struct.display_info = type { i32 }
define void @cleanup(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.display_info*
%4 = tail call i32 @ssd1306_close(%struct.display_info* %3)
ret void
}
int asm_bt_reg2r_w(int base, int offset) {
  int ret = 0;
  __asm__ __volatile__("clc\n\t"
                       "mov %1, %%eax\n\t"
                       "mov %2, %%ecx\n\t"
                       "bt %%cx, %%ax\n\t"
                       "setc %%al\n\t"
                       "movzbl %%al, %%eax\n\t"
                       "mov %%eax, %0\n\t"
                       : "=m"(ret)
                       : "m"(base), "m"(offset)
                       : "eax", "ecx");
  return ret;
}


x86 assembly (clang, -O0):
<asm_bt_reg2r_w>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
clc
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
bt     %cx,%ax
setb   %al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_bt_reg2r_w>:
mov    %edi,-0x4(%rsp)
mov    %esi,-0x8(%rsp)
movl   $0x0,-0xc(%rsp)
clc
mov    -0x4(%rsp),%eax
mov    -0x8(%rsp),%ecx
bt     %cx,%ax
setb   %al
movzbl %al,%eax
mov    %eax,-0xc(%rsp)
mov    -0xc(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @asm_bt_reg2r_w(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = load i32, i32* %5
ret i32 %7
}
/* Variables and functions */
long double __qasin(long double);
long double intr_wrap_009(long double p1) { return __qasin(p1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qasin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_009(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qasin(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ init_palette();
int /*<<< orphan*/ init_screen(char *, int, int);
int /*<<< orphan*/ io_hlt();
void HariMain(void) {
  char *vram;
  int width, height;
  short *binfo_screen_w;
  short *binfo_screen_h;
  int *binfo_vram;
  init_palette();
  binfo_screen_w = (short *)0x0ff4;
  binfo_screen_h = (short *)0xff6;
  binfo_vram = (int *)0x0ff8;
  width = *binfo_screen_w;
  height = *binfo_screen_h;
  vram = (unsigned char *)*binfo_vram;
  init_screen(vram, width, height);
  for (;;)
    io_hlt();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <init_palette@plt>
mov    $0xff4,%eax
mov    %rax,-0x18(%rbp)
mov    $0xff6,%eax
mov    %rax,-0x20(%rbp)
mov    $0xff8,%eax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <init_screen@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
jmp    1188 <HariMain+0x58>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
xor    %eax,%eax
call   1050 <init_palette@plt>
movswl 0xff4,%esi
movswl 0xff6,%edx
movslq 0xff8,%rdi
call   1030 <init_screen@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <io_hlt@plt>
jmp    1160 <HariMain+0x30>

LLVM IR (-O0):
define void @HariMain() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i32*
%7 = call i32 (...) @init_palette()
store i16* inttoptr (i64 4084 to i16*), i16** %4
store i16* inttoptr (i64 4086 to i16*), i16** %5
store i32* inttoptr (i64 4088 to i32*), i32** %6
%8 = load i16*, i16** %4
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
store i32 %10, i32* %2
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
store i32 %13, i32* %3
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %1
%18 = load i8*, i8** %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @init_screen(i8* %18, i32 %19, i32 %20)
br label %22
22: ; preds = %22, %0
%23 = call i32 (...) @io_hlt()
br label %22
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 (...) @init_palette()
%2 = load i16, i16* inttoptr (i64 4084 to i16*)
%3 = sext i16 %2 to i32
%4 = load i16, i16* inttoptr (i64 4086 to i16*)
%5 = sext i16 %4 to i32
%6 = load i32, i32* inttoptr (i64 4088 to i32*)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @init_screen(i8* %8, i32 %3, i32 %5)
br label %10
10: ; preds = %10, %0
%11 = tail call i32 (...) @io_hlt()
br label %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ pthread_self();
void task(void *arg) {
  printf("Thread #%u working on %d\n", (int)pthread_self(), (int)arg);
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Thread #%u working on %d\0A\00"
define void @task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @pthread_self()
%4 = trunc i64 %3 to i32
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Thread #%u working on %d\0A\00"
define void @task(i8* %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
float NormalDistrib(float ndh, float alpha) {
  float tmp = alpha / (ndh * ndh * (alpha * alpha - 1.0) + 1.0);
  return tmp * tmp * 0.31830988618379067153776752674503;
}


x86 assembly (clang, -O0):
<NormalDistrib>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xecd(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalDistrib>:
cvtss2sd %xmm1,%xmm2
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xee4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xecd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @NormalDistrib(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = load float, float* %3
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = fpext float %10 to double
%12 = load float, float* %4
%13 = load float, float* %4
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = fsub double %15, 1.000000e+00
%17 = call double @llvm.fmuladd.f64(double %11, double %16, double 1.000000e+00)
%18 = fdiv double %7, %17
%19 = fptrunc double %18 to float
store float %19, float* %5
%20 = load float, float* %5
%21 = load float, float* %5
%22 = fmul float %20, %21
%23 = fpext float %22 to double
%24 = fmul double %23, 0x3FD45F306DC9C883
%25 = fptrunc double %24 to float
ret float %25
}

LLVM IR (-O2):
define float @NormalDistrib(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul float %0, %0
%5 = fpext float %4 to double
%6 = fmul float %1, %1
%7 = fpext float %6 to double
%8 = fadd double %7, -1.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %5, double %8, double 1.000000e+00)
%10 = fdiv double %3, %9
%11 = fptrunc double %10 to float
%12 = fmul float %11, %11
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3FD45F306DC9C883
%15 = fptrunc double %14 to float
ret float %15
}