xunge/DecIR huggingface dataset:
void *thread(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t obs_get_version(void) { return ((24 << 24) | (0 << 16) | 1); }


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

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

LLVM IR (-O0):
define i32 @obs_get_version() {
ret i32 402653185
}

LLVM IR (-O2):
define i32 @obs_get_version() {
ret i32 402653185
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ verrorf(char const *, int /*<<< orphan*/);
void vdief(int status, const char *msg, va_list ap) {
  verrorf(msg, ap);
  exit(status);
}


x86 assembly (clang, -O0):
<vdief>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <verrorf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<vdief>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <verrorf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @vdief(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @verrorf(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define void @vdief(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @verrorf(i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
ectoc(c) int c;
{
  if (c & 0x0100)
    c = c & ~(0x0100 | 0x40);
  if (c & 0x0800)
    c = c & 255;
  return (c);
}


x86 assembly (clang, -O0):
<ectoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1123 <ectoc+0x23>
mov    -0x4(%rbp),%eax
and    $0xfffffebf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     113f <ectoc+0x3f>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ectoc>:
mov    %edi,%ecx
and    $0xfffffebf,%ecx
test   $0x100,%edi
cmove  %edi,%ecx
test   $0x800,%ecx
movzbl %cl,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ectoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 256
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, -321
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = and i32 %10, 2048
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = and i32 %14, 255
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ectoc(i32 %0) {
%2 = and i32 %0, 256
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, -321
%5 = select i1 %3, i32 %0, i32 %4
%6 = and i32 %5, 2048
%7 = icmp eq i32 %6, 0
%8 = and i32 %5, 255
%9 = select i1 %7, i32 %5, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *to_type_string(int);
void gcc_rti_error(int value_type, int expected_type) {
  char *value_string = to_type_string(value_type);
  char *expected_string = to_type_string(expected_type);
  fprintf(stderr, "Runtime error: expected %s, %s was found instead\n",
          expected_string, value_string);
  exit(4);
}


x86 assembly (clang, -O0):
<gcc_rti_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <to_type_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <to_type_string@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gcc_rti_error>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <to_type_string@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1050 <to_type_string@plt>
mov    0x2e94(%rip),%rcx
mov    (%rcx),%edi
lea    0xeab(%rip),%rsi
mov    %rax,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x4,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Runtime error: expected %s, %s was found instead\0A\00"
define void @gcc_rti_error(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i8* @to_type_string(i32 %7)
store i8* %8, i8** %5
%9 = load i32, i32* %4
%10 = call i8* @to_type_string(i32 %9)
store i8* %10, i8** %6
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 @exit(i32 4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Runtime error: expected %s, %s was found instead\0A\00"
define void @gcc_rti_error(i32 %0, i32 %1) {
%3 = tail call i8* @to_type_string(i32 %0)
%4 = tail call i8* @to_type_string(i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %3)
%7 = tail call i32 @exit(i32 4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *blake2b_file(unsigned char *, int /*<<< orphan*/ *,
                            unsigned char const *, size_t);
unsigned char *hash_file_blake2b_key(unsigned char *out, FILE *fp,
                                     const unsigned char *key, size_t key_len) {
  return blake2b_file(out, fp, key, key_len);
}


x86 assembly (clang, -O0):
<hash_file_blake2b_key>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <blake2b_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @hash_file_blake2b_key(i8* %0, i32* %1, i8* %2, i64 %3) {
%5 = tail call i8* @blake2b_file(i8* %0, i32* %1, i8* %2, i64 %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void lint_put(signed long int number, FILE *stream) {
  if (number > (signed long int)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    lint_put(number / (signed long int)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (signed long int)10), stream);
}


x86 assembly (clang, -O0):
<lint_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x9,-0x8(%rbp)
jle    1155 <lint_put+0x35>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lint_put@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lint_put>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0xa,%rdi
jl     114f <lint_put+0x2f>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%rdi
shr    $0x3,%rdi
mov    %r14,%rsi
call   1030 <lint_put@plt>
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x2,%edx
add    %eax,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
movsbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputc@plt>

LLVM IR (-O0):
define void @lint_put(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = icmp sgt i64 %5, 9
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = sdiv i64 %8, 10
%10 = load i32*, i32** %4
br label %11
11: ; preds = %7, %2
%12 = load i64, i64* %3
%13 = srem i64 %12, 10
%14 = trunc i64 %13 to i8
%15 = sext i8 %14 to i32
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
%18 = load i32*, i32** %4
%19 = call i32 @fputc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @lint_put(i64 %0, i32* nocapture %1) {
%3 = icmp sgt i64 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i64 %0, 10
tail call void @lint_put(i64 %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = srem i64 %0, 10
%8 = trunc i64 %7 to i8
%9 = add nsw i8 %8, 48
%10 = tail call i32 @fputc(i8 signext %9, i32* %1)
ret void
}
void Timer0A_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Timer0A_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Timer0A_Handler+0x9>
jmp    1109 <Timer0A_Handler+0x9>

x86 assembly (clang, -O2):
<Timer0A_Handler>:
jmp    1100 <Timer0A_Handler>

LLVM IR (-O0):
define void @Timer0A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Timer0A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void and_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x23);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<and_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x23,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x23,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @and_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 35)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @and_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 35)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *skip_whitespace(const char *p) {
  while (isspace((unsigned char)*p))
    p++;
  return (char *)p;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_whitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void (*signal(int sig, void (*func)(int)))(int) {
  fprintf(stderr,
          "Sulong does not support signals, registering a signal handler over "
          "the signal function has no effect!\n");
  return func;
}


x86 assembly (clang, -O0):
<signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"Sulong does not support signals, registering a signal handler over the signal function has no effect!\0A\00"
define void (i32)* @signal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%7 = load void (i32)*, void (i32)** %4
ret void (i32)* %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"Sulong does not support signals, registering a signal handler over the signal function has no effect!\0A\00"
define void (i32)* @signal(i32 %0, void (i32)* readnone returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void (i32)* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void readline(FILE *f) {}


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

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

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

LLVM IR (-O2):
define void @readline(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xil_printf(char *, int, int);
void prinfloat(float fval) {
  int whole = fval;
  int thousandths = (fval - whole) * 1000;
  thousandths = thousandths > 0 ? thousandths : -thousandths;
  xil_printf("%d.%3d", whole, thousandths);
}


x86 assembly (clang, -O0):
<prinfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xec5(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115b <prinfloat+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <prinfloat+0x53>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <xil_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prinfloat>:
cvttss2si %xmm0,%esi
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
mulss  0xed9(%rip),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,%edx
neg    %edx
cmovs  %eax,%edx
lea    0xecb(%rip),%rdi
jmp    1030 <xil_printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d.%3d\00"
define void @prinfloat(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
%7 = load float, float* %2
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = fsub float %7, %9
%11 = fmul float %10, 1.000000e+03
%12 = fptosi float %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = load i32, i32* %4
br label %20
17: ; preds = %1
%18 = load i32, i32* %4
%19 = sub nsw i32 0, %18
br label %20
20: ; preds = %17, %15
%21 = phi i32 [ %16, %15 ], [ %19, %17 ]
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i32 @xil_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d.%3d\00"
define void @prinfloat(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fmul float %4, 1.000000e+03
%6 = fptosi float %5 to i32
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = tail call i32 @xil_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %7)
ret void
}
void RTAvlPVRemoveBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlPVRemoveBestFit() {
ret void
}
/* Variables and functions */
bool addKey(const char *auctionKey) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @addKey(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *pthread_rwlock_timedrdlock;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = pthread_rwlock_timedrdlock;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@pthread_rwlock_timedrdlock = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** @pthread_rwlock_timedrdlock
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@pthread_rwlock_timedrdlock = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long time(int /*<<< orphan*/ *);
long int GetTimeSinceEpoch() { return time(NULL); }


x86 assembly (clang, -O0):
<GetTimeSinceEpoch>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimeSinceEpoch>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @GetTimeSinceEpoch() {
%1 = call i64 @time(i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @GetTimeSinceEpoch() {
%1 = tail call i64 @time(i32* null)
ret i64 %1
}
double what_percent_of(double fp, double sp) {
  double result;
  if (fp == 0 || sp == 0) {
    return -1;
  }
  result = fp / sp;
  result = result * 100.0;
  return result;
}


x86 assembly (clang, -O0):
<what_percent_of>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112b <what_percent_of+0x2b>
jp     112b <what_percent_of+0x2b>
jmp    1143 <what_percent_of+0x43>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <what_percent_of+0x55>
jp     1155 <what_percent_of+0x55>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <what_percent_of+0x80>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe94(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<what_percent_of>:
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  0xef0(%rip),%xmm2
jne    1114 <what_percent_of+0x14>
jnp    112c <what_percent_of+0x2c>
ucomisd %xmm3,%xmm1
jne    111c <what_percent_of+0x1c>
jnp    112c <what_percent_of+0x2c>
divsd  %xmm1,%xmm0
mulsd  0xee0(%rip),%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @what_percent_of(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = fcmp oeq double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store double -1.000000e+00, double* %3
br label %20
13: ; preds = %9
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fdiv double %14, %15
store double %16, double* %6
%17 = load double, double* %6
%18 = fmul double %17, 1.000000e+02
store double %18, double* %6
%19 = load double, double* %6
store double %19, double* %3
br label %20
20: ; preds = %13, %12
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @what_percent_of(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
%4 = fcmp oeq double %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = fdiv double %0, %1
%8 = fmul double %7, 1.000000e+02
br label %9
9: ; preds = %2, %6
%10 = phi double [ %8, %6 ], [ -1.000000e+00, %2 ]
ret double %10
}
void dead_test1(int *data) {
  int j = data[0] + data[1];
  j = data[2];
  data[j] = 2;
}


x86 assembly (clang, -O0):
<dead_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_test1>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @dead_test1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
store i32 %13, i32* %3
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 2, i32* %17
ret void
}

LLVM IR (-O2):
define void @dead_test1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int system(char *);
void ps_report(void) {
  char buf[1024];
  sprintf(buf, "ps -o comm,majflt,minflt,rss,drs,pagein,sz,trs,vsz %d 1>&2",
          getpid());
  if (system(buf) == -1) {
    perror("system call to ps failed");
  }
}


x86 assembly (clang, -O0):
<ps_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rax
mov    %rax,-0x408(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x408(%rbp),%rdi
mov    %eax,%edx
lea    0xe90(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <system@plt>
cmp    $0xffffffff,%eax
jne    1196 <ps_report+0x56>
lea    0xeaa(%rip),%rdi
call   1050 <perror@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_report>:
push   %rbx
sub    $0x400,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaa(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
cmp    $0xffffffff,%eax
je     1179 <ps_report+0x39>
add    $0x400,%rsp
pop    %rbx
ret
lea    0xebb(%rip),%rdi
add    $0x400,%rsp
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"ps -o comm,majflt,minflt,rss,drs,pagein,sz,trs,vsz %d 1>&2\00"
@.str.1 = [25 x i8] c"system call to ps failed\00"
define void @ps_report() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"ps -o comm,majflt,minflt,rss,drs,pagein,sz,trs,vsz %d 1>&2\00"
@.str.1 = [25 x i8] c"system call to ps failed\00"
define void @ps_report() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t modulo(int x, int N) { return (x % N + N) % N; }


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

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
/* Variables and functions */
unsigned int dictGenCaseHashFunction(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ sdslen(char *);
unsigned int dictSdsCaseHash(const void *key) {
  return dictGenCaseHashFunction((unsigned char *)key, sdslen((char *)key));
}


x86 assembly (clang, -O0):
<dictSdsCaseHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sdslen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <dictGenCaseHashFunction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictSdsCaseHash>:
push   %rbx
mov    %rdi,%rbx
call   1040 <sdslen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dictGenCaseHashFunction@plt>

LLVM IR (-O0):
define i32 @dictSdsCaseHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sdslen(i8* %4)
%6 = call i32 @dictGenCaseHashFunction(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @dictSdsCaseHash(i8* %0) {
%2 = tail call i32 @sdslen(i8* %0)
%3 = tail call i32 @dictGenCaseHashFunction(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x94() {
  Assert_real((isspace(148) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              745, ("isspace should be 0 for 0x94"));
}


x86 assembly (clang, -O0):
<t_isspace_0x94>:
push   %rbp
mov    %rsp,%rbp
mov    $0x94,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x94\00"
define void @t_isspace_0x94() {
%1 = call i64 @isspace(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x94\00"
define void @t_isspace_0x94() {
%1 = tail call i64 @isspace(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f44(int *);
int f45(int *p) { return f44(p); }


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

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

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

LLVM IR (-O2):
define i32 @f45(i32* %0) {
%2 = tail call i32 @f44(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CloseCOM(int);
int /*<<< orphan*/ DS2480Detect(int);
scalar_t__ OpenCOM(int, char *);
int /*<<< orphan*/ owRaiseError(int);
int owAcquire(int portnum, char *port_zstr) {
  if (OpenCOM(portnum, port_zstr) < 0) {
    owRaiseError(8);
    return 0;
  }
  if (!DS2480Detect(portnum)) {
    CloseCOM(portnum);
    owRaiseError(5);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<owAcquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <OpenCOM@plt>
cmp    $0x0,%rax
jge    117b <owAcquire+0x3b>
mov    $0x8,%edi
call   1050 <owRaiseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <owAcquire+0x71>
mov    -0x8(%rbp),%edi
call   1030 <DS2480Detect@plt>
cmp    $0x0,%eax
jne    11aa <owAcquire+0x6a>
mov    -0x8(%rbp),%edi
call   1040 <CloseCOM@plt>
mov    $0x5,%edi
call   1050 <owRaiseError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b1 <owAcquire+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owAcquire>:
push   %rbx
mov    %edi,%ebx
call   1060 <OpenCOM@plt>
test   %rax,%rax
js     1161 <owAcquire+0x21>
mov    %ebx,%edi
call   1030 <DS2480Detect@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1168 <owAcquire+0x28>
pop    %rbx
ret
mov    $0x8,%edi
jmp    1174 <owAcquire+0x34>
mov    %ebx,%edi
call   1040 <CloseCOM@plt>
mov    $0x5,%edi
call   1050 <owRaiseError@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @owAcquire(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = call i64 @OpenCOM(i32 %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @owRaiseError(i32 8)
store i32 0, i32* %3
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @DS2480Detect(i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = call i32 @CloseCOM(i32 %17)
%19 = call i32 @owRaiseError(i32 5)
store i32 0, i32* %3
br label %21
20: ; preds = %12
store i32 1, i32* %3
br label %21
21: ; preds = %20, %16, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @owAcquire(i32 %0, i8* %1) {
%3 = tail call i64 @OpenCOM(i32 %0, i8* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @DS2480Detect(i32 %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = tail call i32 @CloseCOM(i32 %0)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 5, %8 ], [ 8, %2 ]
%12 = tail call i32 @owRaiseError(i32 %11)
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ 1, %5 ], [ 0, %10 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
void _spx_mm_getr_ps(__m128 U, float *__Z, float *__Y, float *__X, float *__W) {
  union {
    float __a[4];
    __m128 __v;
  } __u;
  __u.__v = U;
  *__Z = __u.__a[0];
  *__Y = __u.__a[1];
  *__X = __u.__a[2];
  *__W = __u.__a[3];
}


x86 assembly (clang, -O0):
<_spx_mm_getr_ps>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x34(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_spx_mm_getr_ps>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
%union.anon = type { [4 x float] }
define void @_spx_mm_getr_ps(i32 %0, float* %1, float* %2, float* %3, float* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca %union.anon
store i32 %0, i32* %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%12 = load i32, i32* %6
%13 = bitcast %union.anon* %11 to i32*
store i32 %12, i32* %13
%14 = bitcast %union.anon* %11 to [4 x float]*
%15 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 0, i64 0
%16 = load float, float* %15
%17 = load float*, float** %7
store float %16, float* %17
%18 = bitcast %union.anon* %11 to [4 x float]*
%19 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 1
%20 = load float, float* %19
%21 = load float*, float** %8
store float %20, float* %21
%22 = bitcast %union.anon* %11 to [4 x float]*
%23 = getelementptr inbounds [4 x float], [4 x float]* %22, i64 0, i64 2
%24 = load float, float* %23
%25 = load float*, float** %9
store float %24, float* %25
%26 = bitcast %union.anon* %11 to [4 x float]*
%27 = getelementptr inbounds [4 x float], [4 x float]* %26, i64 0, i64 3
%28 = load float, float* %27
%29 = load float*, float** %10
store float %28, float* %29
ret void
}

LLVM IR (-O2):
define void @_spx_mm_getr_ps(i32 %0, float* nocapture writeonly %1, float* nocapture readnone %2, float* nocapture readnone %3, float* nocapture readnone %4) {
%6 = bitcast float* %1 to i32*
store i32 %0, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_TeX_parentheses(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++)
    check_TeX_parentheses(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <check_TeX_parentheses@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <check_TeX_parentheses@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @check_TeX_parentheses(i8* %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 i32 0
}
/* Variables and functions */
int alphabeta_cutoff(int, int *, int *, int);
int negascout_cutoff(int score, int *alpha, int *beta) {
  return alphabeta_cutoff(score, alpha, beta, 1);
}


x86 assembly (clang, -O0):
<negascout_cutoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <alphabeta_cutoff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<negascout_cutoff>:
mov    $0x1,%ecx
jmp    1030 <alphabeta_cutoff@plt>

LLVM IR (-O0):
define i32 @negascout_cutoff(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 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @alphabeta_cutoff(i32 %7, i32* %8, i32* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @negascout_cutoff(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @alphabeta_cutoff(i32 %0, i32* %1, i32* %2, i32 1)
ret i32 %4
}
void set_signal() {}


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

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

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

LLVM IR (-O2):
define void @set_signal() {
ret void
}
int iscrlf(char c) { return (c == '\r' || c == '\n'); }


x86 assembly (clang, -O0):
<iscrlf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1129 <iscrlf+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscrlf>:
cmp    $0xd,%dil
sete   %al
cmp    $0xa,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscrlf(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, 13
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @iscrlf(i8 signext %0) {
%2 = icmp eq i8 %0, 13
%3 = icmp eq i8 %0, 10
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ prctl(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void set_threadname(const char *name) {
  char threadname[17];
  strncpy(threadname, name, 16);
  threadname[16] = 0;
  prctl(PR_SET_NAME, (unsigned long)threadname);
}


x86 assembly (clang, -O0):
<set_threadname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_threadname>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x10(%rsp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca i8*
%3 = alloca [17 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 16)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 16
store i8 0, i8* %7
%8 = load i32, i32* @PR_SET_NAME
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @prctl(i32 %8, i64 %10)
ret void
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 16)
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 16
store i8 0, i8* %5
%6 = load i32, i32* @PR_SET_NAME
%7 = ptrtoint [17 x i8]* %2 to i64
%8 = call i32 @prctl(i32 %6, i64 %7)
ret void
}
void memzerol(unsigned long *p, unsigned long size) {
  unsigned long i;
  size /= sizeof(unsigned long);
  for (i = 0; i < size; i++) {
    p[i] = 0;
  }
}


x86 assembly (clang, -O0):
<memzerol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114f <memzerol+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <memzerol+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzerol>:
cmp    $0x8,%rsi
jb     1129 <memzerol+0x19>
push   %rax
mov    %rsi,%rdx
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @memzerol(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp ult i64 %1, 8
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = and i64 %1, -8
%6 = bitcast i64* %0 to i8*
br label %7
7: ; preds = %4, %2
ret void
}
void glmSet3f(float v[3], float x, float y, float z) {
  v[0] = x;
  v[1] = y;
  v[2] = z;
}


x86 assembly (clang, -O0):
<glmSet3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSet3f>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmSet3f(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %7
%13 = load float*, float** %5
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float, float* %8
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
ret void
}

LLVM IR (-O2):
define void @glmSet3f(float* nocapture writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret void
}