xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_intlen();
unsigned rightrot(unsigned x, int n) {
  int intlen = get_intlen();
  unsigned upper_bits, lower_bits;
  upper_bits = x & (~0 << n);
  lower_bits = x & ~(~0 << n);
  return ((upper_bits >> n) | (lower_bits << (intlen - n)));
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_intlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <get_intlen@plt>
mov    $0xffffffff,%edx
mov    %ebx,%ecx
shl    %cl,%edx
mov    %edx,%esi
and    %ebp,%esi
not    %edx
and    %ebp,%edx
shr    %cl,%esi
sub    %ebx,%eax
mov    %eax,%ecx
shl    %cl,%edx
or     %esi,%edx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = call i32 (...) @get_intlen()
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 -1, %10
%12 = and i32 %9, %11
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 -1, %14
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = lshr i32 %18, %19
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %22, %23
%25 = shl i32 %21, %24
%26 = or i32 %20, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = tail call i32 (...) @get_intlen()
%4 = shl nsw i32 -1, %1
%5 = and i32 %4, %0
%6 = xor i32 %4, -1
%7 = and i32 %6, %0
%8 = lshr i32 %5, %1
%9 = sub nsw i32 %3, %1
%10 = shl i32 %7, %9
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ function1();
int /*<<< orphan*/ function2();
int /*<<< orphan*/ function3();
int /*<<< orphan*/ printf(char *);
main() {
  function1();
  function2();
  function3();
  printf("Hello");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <function1@plt>
mov    $0x0,%al
call   1060 <function2@plt>
mov    $0x0,%al
call   1040 <function3@plt>
lea    0xea0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <function1@plt>
xor    %eax,%eax
call   1060 <function2@plt>
xor    %eax,%eax
call   1040 <function3@plt>
lea    0xea3(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = call i32 (...) @function1()
%2 = call i32 (...) @function2()
%3 = call i32 (...) @function3()
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 (...) @function1()
%2 = tail call i32 (...) @function2()
%3 = tail call i32 (...) @function3()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int strcountc(char *s, char c) {
  int n = 0;
  while (*s != '\0') {
    if (*s == c) {
      n++;
    }
    s++;
  }
  return n;
}


x86 assembly (clang, -O0):
<strcountc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <strcountc+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <strcountc+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <strcountc+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcountc>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strcountc+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strcountc+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @motor_all_off() {
ret void
}
/* Variables and functions */
char toupper(char c) {
  if (c >= 'a' && c <= 'z')
    c -= ('a' - 'A');
  return (c);
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <toupper+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <toupper+0x2e>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @toupper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int);
void fault_handler() {
  printf("FAULT %d current flags %02x prev flags %02x\n",
         __builtin_nyuzi_read_control_reg(3),
         __builtin_nyuzi_read_control_reg(4),
         __builtin_nyuzi_read_control_reg(8));
  exit(0);
}


x86 assembly (clang, -O0):
<fault_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fault_handler>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebp
mov    $0x8,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"FAULT %d current flags %02x prev flags %02x\0A\00"
define void @fault_handler() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = call i32 @__builtin_nyuzi_read_control_reg(i32 4)
%3 = call i32 @__builtin_nyuzi_read_control_reg(i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"FAULT %d current flags %02x prev flags %02x\0A\00"
define void @fault_handler() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 4)
%3 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
long lrintl(long double x) {
  long r;
  __asm__("fistpll %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fistpll -0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
fldt   0x8(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int rand();
int random_int(int min, int max) { return min + rand() % (max - min); }


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %6, %9
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
scalar_t__ __statfs(char const *, struct statfs *);
int /*<<< orphan*/ fixup(struct statvfs *, struct statfs *);
int statvfs(const char *path, struct statvfs *buf) {
  struct statfs kbuf;
  if (__statfs(path, &kbuf) < 0)
    return -1;
  fixup(buf, &kbuf);
  return 0;
}


x86 assembly (clang, -O0):
<statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <__statfs@plt>
cmp    $0x0,%rax
jge    1153 <statvfs+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <statvfs+0x47>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <fixup@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statvfs>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <__statfs@plt>
test   %rax,%rax
js     1148 <statvfs+0x28>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <fixup@plt>
xor    %eax,%eax
jmp    114d <statvfs+0x2d>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.statvfs*
%6 = alloca %struct.statfs
store i8* %0, i8** %4
store %struct.statvfs* %1, %struct.statvfs** %5
%7 = load i8*, i8** %4
%8 = call i64 @__statfs(i8* %7, %struct.statfs* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load %struct.statvfs*, %struct.statvfs** %5
%13 = call i32 @fixup(%struct.statvfs* %12, %struct.statfs* %6)
store i32 0, i32* %3
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i64 @__statfs(i8* %0, %struct.statfs* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @fixup(%struct.statvfs* %1, %struct.statfs* %3)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
void priv_adjtime_cleanup(int asroot, int injail, struct test *test) {}


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

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

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

LLVM IR (-O2):
%struct.test = type { i32 }
define void @priv_adjtime_cleanup(i32 %0, i32 %1, %struct.test* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkIfOddOrEven(int);
int /*<<< orphan*/ checkIfPrime(int);
int /*<<< orphan*/ checkIfTribonacci(int);
int main(void) {
  int numberToCheck = 44;
  checkIfPrime(numberToCheck);
  checkIfTribonacci(numberToCheck);
  checkIfOddOrEven(numberToCheck);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2c,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <checkIfPrime@plt>
mov    -0x4(%rbp),%edi
call   1040 <checkIfTribonacci@plt>
mov    -0x4(%rbp),%edi
call   1050 <checkIfOddOrEven@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2c,%edi
call   1030 <checkIfPrime@plt>
mov    $0x2c,%edi
call   1040 <checkIfTribonacci@plt>
mov    $0x2c,%edi
call   1050 <checkIfOddOrEven@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 44, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @checkIfPrime(i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @checkIfTribonacci(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @checkIfOddOrEven(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @checkIfPrime(i32 44)
%2 = tail call i32 @checkIfTribonacci(i32 44)
%3 = tail call i32 @checkIfOddOrEven(i32 44)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void createTypedefForUint32_t(void) {
  if (sizeof(unsigned int) == 4)
    printf("typedef unsigned int uint32_t;\n");
  else if (sizeof(unsigned long) == 4)
    printf("typedef unsigned long uint32_t;\n");
  else {
    fprintf(stderr, "Cannot find a 32 bit unsigned integer type!\n");
    exit(1);
  }
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"typedef unsigned int uint32_t;\0A\00"
@stderr = global i32 0
define void @createTypedefForUint32_t() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@str = [31 x i8] c"typedef unsigned int uint32_t;\00"
define void @createTypedefForUint32_t() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handler_not_implemented(char *);
void defaultUpcallHandler() { handler_not_implemented("UPCALL_HANDLER"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"UPCALL_HANDLER\00"
define void @defaultUpcallHandler() {
%1 = call i32 @handler_not_implemented(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"UPCALL_HANDLER\00"
define void @defaultUpcallHandler() {
%1 = tail call i32 @handler_not_implemented(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_open_pawns(int, int);
void b_open_pawns_test(void **state) {
  assert_int_equal(0x0000000800000000ul,
                   b_open_pawns(0x0000000010000000ul, 0x0000001800000000ul));
}


x86 assembly (clang, -O0):
<b_open_pawns_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10000000,%edi
xor    %esi,%esi
call   1040 <b_open_pawns@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_open_pawns_test>:
push   %rax
mov    $0x10000000,%edi
xor    %esi,%esi
call   1040 <b_open_pawns@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_open_pawns_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_open_pawns(i32 268435456, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_open_pawns_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_open_pawns(i32 268435456, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  char c1 = '\0', c2 = '\0';
  if (c1 == c2)
    printf("Makes sense!\n");
  else
    printf("WTF?!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xebf(%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 = [14 x i8] c"Makes sense!\0A\00"
@.str.1 = [7 x i8] c"WTF?!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Makes sense!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int energymon_is_exclusive_msr(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @energymon_is_exclusive_msr() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_thread_flag(int);
__attribute__((always_)) void clear_need_resched(void) { clear_thread_flag(3); }


x86 assembly (clang, -O0):
<clear_need_resched>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <clear_thread_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_need_resched>:
mov    $0x3,%edi
jmp    1030 <clear_thread_flag@plt>

LLVM IR (-O0):
define void @clear_need_resched() {
%1 = call i32 @clear_thread_flag(i32 3)
ret void
}

LLVM IR (-O2):
define void @clear_need_resched() {
%1 = tail call i32 @clear_thread_flag(i32 3)
ret void
}
int test_imm_79uint16_reg(unsigned short val) {
  return ((val) & (-0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff87,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79uint16_reg>:
test   $0xff87,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -121
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void testClosureIFrV(void (*closure)(int, float), int a1, float a2) {
  (*closure)(a1, a2);
}


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

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

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

LLVM IR (-O2):
define void @testClosureIFrV(void (i32, float)* nocapture %0, i32 %1, float %2) {
tail call void %0(i32 %1, float %2)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void AESDMADisable(uint32_t ui32Base, uint32_t ui32Flags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000084))) &= ~ui32Flags;
}


x86 assembly (clang, -O0):
<AESDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x84(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x84(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESDMADisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x84(%rcx)
ret

LLVM IR (-O0):
define void @AESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 132
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @AESDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 132
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Variables and functions */
char const *version_get_compilation_date_time();
const char *plugin_api_info_date_cb(const void *pointer, void *data,
                                    const char *info_name,
                                    const char *arguments) {
  (void)pointer;
  (void)data;
  (void)info_name;
  (void)arguments;
  return version_get_compilation_date_time();
}


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

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

LLVM IR (-O0):
define i8* @plugin_api_info_date_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* (...) @version_get_compilation_date_time()
ret i8* %13
}

LLVM IR (-O2):
define i8* @plugin_api_info_date_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i8* (...) @version_get_compilation_date_time()
ret i8* %5
}
void soru_7(int dizi[], int N) {}


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

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

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

LLVM IR (-O2):
define void @soru_7(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ sysctlbyname(char *, char *, size_t *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
char const *get_cpu(void) {
  static char ret[255];
  size_t len = 255;
  if (sysctlbyname("machdep.cpu.brand_string", ret, &len, NULL, 0))
    return NULL;
  return ret;
}


x86 assembly (clang, -O0):
<get_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xff,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0x2f12(%rip),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
cmp    $0x0,%rax
je     1155 <get_cpu+0x45>
movq   $0x0,-0x8(%rbp)
jmp    1160 <get_cpu+0x50>
lea    0x2ee4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu>:
push   %r14
push   %rbx
push   %rax
movq   $0xff,(%rsp)
lea    0xedd(%rip),%rdi
lea    0x2f16(%rip),%rbx
xor    %r14d,%r14d
mov    %rsp,%rdx
mov    %rbx,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
test   %rax,%rax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_cpu.ret = internal global [255 x i8] zeroinitializer
@.str = [25 x i8] c"machdep.cpu.brand_string\00"
define i8* @get_cpu() {
%1 = alloca i8*
%2 = alloca i64
store i64 255, i64* %2
%3 = call i64 @sysctlbyname(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_cpu.ret, i64 0, i64 0), i64* %2, i32* null, i32 0)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* null, i8** %1
br label %7
6: ; preds = %0
store i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_cpu.ret, i64 0, i64 0), i8** %1
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@get_cpu.ret = internal global [255 x i8] zeroinitializer
@.str = [25 x i8] c"machdep.cpu.brand_string\00"
define i8* @get_cpu() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 255, i64* %1
%3 = call i64 @sysctlbyname(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_cpu.ret, i64 0, i64 0), i64* %1, i32* null, i32 0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([255 x i8], [255 x i8]* @get_cpu.ret, i64 0, i64 0), i8* null
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_about(void) {
  printf("\nTSort - text file sort program\n");
  printf("Version 1.0 - 24/02/99\n");
  printf("Copyright Trevor Barnett 1999\n");
}


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

x86 assembly (clang, -O2):
<print_about>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0ATSort - text file sort program\0A\00"
@.str.1 = [24 x i8] c"Version 1.0 - 24/02/99\0A\00"
@.str.2 = [31 x i8] c"Copyright Trevor Barnett 1999\0A\00"
define void @print_about() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\0ATSort - text file sort program\00"
@str.3 = [23 x i8] c"Version 1.0 - 24/02/99\00"
@str.4 = [30 x i8] c"Copyright Trevor Barnett 1999\00"
define void @print_about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int open(char const *, int);
int /*<<< orphan*/ printf(char *, char const *);
int open_or_die(const char *filename, int flags) {
  int fd = open(filename, flags);
  if (fd < 0) {
    printf("Failed to open '%s'; "
           "check prerequisites are available\n",
           filename);
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1172 <open_or_die+0x42>
mov    -0x8(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_or_die>:
push   %rbx
mov    %rdi,%rbx
call   1040 <open@plt>
test   %eax,%eax
js     113f <open_or_die+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Failed to open '%s'; check prerequisites are available\0A\00"
define i32 @open_or_die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [56 x i8] c"Failed to open '%s'; check prerequisites are available\0A\00"
define i32 @open_or_die(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_init(int /*<<< orphan*/ *);
int pthread_mutexattr_setprioceiling(int /*<<< orphan*/ *, int);
int main(void) {
  int ret;
  pthread_mutexattr_t mutex_attr;
  ret = pthread_mutexattr_init(&mutex_attr);
  if (ret)
    ret = pthread_mutexattr_setprioceiling(&mutex_attr, 120);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1156 <main+0x36>
lea    -0xc(%rbp),%rdi
mov    $0x78,%esi
call   1030 <pthread_mutexattr_setprioceiling@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <pthread_mutexattr_init@plt>
test   %eax,%eax
je     1140 <main+0x20>
lea    0x4(%rsp),%rdi
mov    $0x78,%esi
call   1030 <pthread_mutexattr_setprioceiling@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutexattr_init(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @pthread_mutexattr_setprioceiling(i32* %1, i32 120)
br label %7
7: ; preds = %5, %0
%8 = phi i32 [ %6, %5 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int trouverIndexEnnemi(unsigned int const, unsigned int const);
unsigned int estEnnemi(const unsigned int lig, const unsigned int col) {
  return trouverIndexEnnemi(lig, col) != -1;
}


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

x86 assembly (clang, -O2):
<estEnnemi>:
push   %rax
call   1030 <trouverIndexEnnemi@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @estEnnemi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @trouverIndexEnnemi(i32 %5, i32 %6)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @estEnnemi(i32 %0, i32 %1) {
%3 = tail call i32 @trouverIndexEnnemi(i32 %0, i32 %1)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
int get_XKeyPressedEvent_same_screen(void *_p) {
  return (int)((XKeyPressedEvent *)_p)->same_screen;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyPressedEvent_same_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyPressedEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int cmd_quit(char *args) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cmd_quit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ djb2(unsigned char const *);
unsigned int hashCstrhash(const void *const x) {
  const char *const s = x;
  return (unsigned int)djb2((const unsigned char *)s);
}


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

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

LLVM IR (-O0):
define i32 @hashCstrhash(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** %3
%6 = call i64 @djb2(i8* %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hashCstrhash(i8* %0) {
%2 = tail call i64 @djb2(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void phci_mem_cleanup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @phci_mem_cleanup() {
ret void
}
void b_serial_send(unsigned char chr) {
  asm volatile("call 0x00100120" : : "a"(chr));
}


x86 assembly (clang, -O0):
<b_serial_send>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
call   100120 <completed.0+0xfc100>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_serial_send>:
mov    %edi,%eax
call   100120 <completed.0+0xfc100>
ret

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

LLVM IR (-O2):
define void @b_serial_send(i8 zeroext %0) {
tail call void asm sideeffect "call 0x00100120", "{ax},~{dirflag},~{fpsr},~{flags}"(i8 %0)
ret void
}
void host_close(int fd) {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, "
                       "0x10"
                       "\n"
                       ".byte "
                       "0x02"
                       ", 0x00\n"
                       ".byte 0x00, 0x00, 0x00\n"
                       ".byte 0x00\n"
                       :
                       : "a"(fd));
}


x86 assembly (clang, -O0):
<host_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
(bad)
add    %dl,(%rax)
add    (%rax),%al
add    %al,(%rax)
add    %al,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_close>:
mov    %edi,%eax
(bad)
add    %dl,(%rax)
add    (%rax),%al
add    %al,(%rax)
add    %al,(%rax)
ret

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

LLVM IR (-O2):
define void @host_close(i32 %0) {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x10\0A.byte 0x02, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
/* Variables and functions */
int comput(char *);
int /*<<< orphan*/ printf(char *, int);
int main3(void) {
  int ret = comput("431-5*+");
  printf("4+(3-1)*5=%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <comput@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main3>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <comput@plt>
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"431-5*+\00"
@.str.1 = [14 x i8] c"4+(3-1)*5=%d\0A\00"
define i32 @main3() {
%1 = alloca i32
%2 = call i32 @comput(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"431-5*+\00"
@.str.1 = [14 x i8] c"4+(3-1)*5=%d\0A\00"
define i32 @main3() {
%1 = tail call i32 @comput(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
signed int signedint_ignoring_signedshortint(signed int x, signed short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_signedshortint(i32 returned %0, i16 signext %1) {
ret i32 %0
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int btktermio_get_cols(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_col;
}


x86 assembly (clang, -O0):
<btktermio_get_cols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btktermio_get_cols>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @btktermio_get_cols() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @btktermio_get_cols() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
__attribute__((noipa)) long double long_double_from_double(double x) {
  return x;
}


x86 assembly (clang, -O0):
<long_double_from_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_double_from_double>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @long_double_from_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fpext double %3 to x86_fp80
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @long_double_from_double(double %0) {
%2 = fpext double %0 to x86_fp80
ret x86_fp80 %2
}
/* Variables and functions */
int tirar(int);
int d8() { return tirar(8); }


x86 assembly (clang, -O0):
<d8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <tirar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d8>:
mov    $0x8,%edi
jmp    1030 <tirar@plt>

LLVM IR (-O0):
define i32 @d8() {
%1 = call i32 @tirar(i32 8)
ret i32 %1
}

LLVM IR (-O2):
define i32 @d8() {
%1 = tail call i32 @tirar(i32 8)
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long time;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselection_time(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselection.time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselection_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselection_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSL_free(void *);
void dv_openssl_free(void *s) { SSL_free(s); }


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

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

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

LLVM IR (-O2):
define void @dv_openssl_free(i8* %0) {
%2 = tail call i32 @SSL_free(i8* %0)
ret void
}