xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ float64Clear(double *);
int /*<<< orphan*/ free(double *);
void float64Destroy(double *data) {
  float64Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<float64Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <float64Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @float64Destroy(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @float64Clear(double* %3)
%5 = load double*, double** %2
%6 = call i32 @free(double* %5)
ret void
}

LLVM IR (-O2):
define void @float64Destroy(double* %0) {
%2 = tail call i32 @float64Clear(double* %0)
%3 = tail call i32 @free(double* %0)
ret void
}
int arg_char_ptr(int i, char *str) {
  (void)str;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @arg_char_ptr(i32 returned %0, i8* nocapture readnone %1) {
ret i32 %0
}
/* Variables and functions */
int main(int argc, char **argv) {
  while (true) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printHandler(int i) {
  if (i == 0)
    fprintf(stderr, "\nERROR: fork failed\n");
  if (i == 1)
    fprintf(stderr, "ERROR execv failed!\n");
}


x86 assembly (clang, -O0):
<printHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <printHandler+0x2a>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1159 <printHandler+0x49>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHandler>:
test   %edi,%edi
je     1122 <printHandler+0x12>
cmp    $0x1,%edi
jne    1137 <printHandler+0x27>
lea    0xef5(%rip),%rsi
jmp    1129 <printHandler+0x19>
lea    0xed7(%rip),%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"\0AERROR: fork failed\0A\00"
@.str.1 = [21 x i8] c"ERROR execv failed!\0A\00"
define void @printHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"\0AERROR: fork failed\0A\00"
@.str.1 = [21 x i8] c"ERROR execv failed!\0A\00"
define void @printHandler(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %3
i32 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* %4)
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int totemmrp_my_nodeid_get();
int totempg_my_nodeid_get(void) { return (totemmrp_my_nodeid_get()); }


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

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

LLVM IR (-O0):
define i32 @totempg_my_nodeid_get() {
%1 = call i32 (...) @totemmrp_my_nodeid_get()
ret i32 %1
}

LLVM IR (-O2):
define i32 @totempg_my_nodeid_get() {
%1 = tail call i32 (...) @totemmrp_my_nodeid_get()
ret i32 %1
}
int ins_end() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ins_end() {
ret i32 0
}
unsigned long pthread__sp(void) {
  unsigned long ret;
  __asm("movq %%rsp, %0" : "=g"(ret));
  return ret;
}


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

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

LLVM IR (-O0):
define i64 @pthread__sp() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @pthread__sp() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
/* Variables and functions */
int midRangeBitwiseAnd(int, int);
int mid(int m, int n) { return midRangeBitwiseAnd(m, n); }


x86 assembly (clang, -O0):
<mid>:
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 <midRangeBitwiseAnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mid(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 @midRangeBitwiseAnd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mid(i32 %0, i32 %1) {
%3 = tail call i32 @midRangeBitwiseAnd(i32 %0, i32 %1)
ret i32 %3
}
volatile char *build_lfence(volatile char *tgt_addr) {
  (*(short *)tgt_addr) = 0xae0f;
  tgt_addr += 0x2;
  (*tgt_addr++) = 0xe8;
  return (tgt_addr);
}


x86 assembly (clang, -O0):
<build_lfence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movw   $0xae0f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xe8,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_lfence>:
movw   $0xae0f,(%rdi)
movb   $0xe8,0x2(%rdi)
lea    0x3(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @build_lfence(i8* %0) {
%2 = bitcast i8* %0 to i16*
store i16 -20977, i16* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = getelementptr inbounds i8, i8* %0, i64 3
store volatile i8 -24, i8* %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, char const *);
void debug_panic(const char *file, int line, const char *function,
                 const char *message, ...) {
  printf("PANIC at %s:%d in %s(): ", file, line, function);
}


x86 assembly (clang, -O0):
<debug_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_panic>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"PANIC at %s:%d in %s(): \00"
define void @debug_panic(i8* %0, i32 %1, i8* %2, i8* %3, ...) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"PANIC at %s:%d in %s(): \00"
define void @debug_panic(i8* %0, i32 %1, i8* %2, i8* nocapture readnone %3, ...) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
void ASN1_template_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_template_free() {
ret void
}
void *test_anti_range_140(short n) {
  extern void *alloc_anti_range_140(short) __attribute__((alloc_size(1)));
  if (-1 <= n && n <= 2)
    n = -1 - 1;
  return alloc_anti_range_140(n);
}


x86 assembly (clang, -O0):
<test_anti_range_140>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_140+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1143 <test_anti_range_140+0x33>
movw   $0xfffe,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_140@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_140>:
lea    0x1(%rdi),%eax
cmp    $0x4,%ax
mov    $0xfffe,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_140@plt>

LLVM IR (-O0):
define i8* @test_anti_range_140(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -2, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_140(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_140(i16 signext %0) {
%2 = add i16 %0, 1
%3 = icmp ult i16 %2, 4
%4 = select i1 %3, i16 -2, i16 %0
%5 = tail call i8* @alloc_anti_range_140(i16 signext %4)
ret i8* %5
}
__attribute__((always_)) void lockdep_off(void) {}


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

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

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

LLVM IR (-O2):
define void @lockdep_off() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_equal(unsigned char, unsigned char);
int /*<<< orphan*/ is_greater(unsigned char, unsigned char);
unsigned char is_less(unsigned char x, unsigned char y) {
  return (!is_equal(x, y) && !is_greater(x, y));
}


x86 assembly (clang, -O0):
<is_less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1040 <is_equal@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
jne    116d <is_less+0x4d>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <is_greater@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_less>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <is_equal@plt>
test   %eax,%eax
je     1134 <is_less+0x14>
xor    %eax,%eax
jmp    1145 <is_less+0x25>
movzbl %bpl,%edi
movzbl %bl,%esi
call   1030 <is_greater@plt>
test   %eax,%eax
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @is_less(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @is_equal(i8 zeroext %5, i8 zeroext %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i8, i8* %3
%11 = load i8, i8* %4
%12 = call i32 @is_greater(i8 zeroext %10, i8 zeroext %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %9, %2
%16 = phi i1 [ false, %2 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @is_less(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @is_equal(i8 zeroext %0, i8 zeroext %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @is_greater(i8 zeroext %0, i8 zeroext %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i8
br label %9
9: ; preds = %5, %2
%10 = phi i8 [ 0, %2 ], [ %8, %5 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
unsigned long strtoul(char const *, char **, int /*<<< orphan*/);
unsigned int parse_count(const char *arg) {
  unsigned long ret;
  char *s;
  ret = strtoul(arg, &s, 0);
  if (*s != '\0')
    err(1, "parse_count: unexpected character in \"%s\"\n", arg);
  return ret;
}


x86 assembly (clang, -O0):
<parse_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <parse_count+0x44>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xea1(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_count>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %rax,%r14
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1151 <parse_count+0x31>
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1030 <err@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"parse_count: unexpected character in \22%s\22\0A\00"
define i32 @parse_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtoul(i8* %5, i8** %4, i32 0)
store i64 %6, i64* %3
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i64, i64* %3
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [43 x i8] c"parse_count: unexpected character in \22%s\22\0A\00"
define i32 @parse_count(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtoul(i8* %0, i8** %2, i32 0)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %1
%11 = trunc i64 %4 to i32
ret i32 %11
}
unsigned short int cast_uchar_ushort(unsigned char x) {
  return (unsigned short int)x;
}


x86 assembly (clang, -O0):
<cast_uchar_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @cast_uchar_ushort(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @cast_uchar_ushort(i8 zeroext %0) {
%2 = zext i8 %0 to i16
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ spc_command(int, unsigned int);
void sfx_play(unsigned int chn, unsigned int sfx, int pan) {
  if (pan < 0)
    pan = 0;
  if (pan > 255)
    pan = 255;
  (spc_command(0x4000 | ((chn) << 8), (sfx) | ((pan) << 8)));
}


x86 assembly (clang, -O0):
<sfx_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1132 <sfx_play+0x22>
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jle    1146 <sfx_play+0x36>
movl   $0xff,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
or     $0x4000,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     %eax,%esi
call   1030 <spc_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfx_play>:
xor    %eax,%eax
test   %edx,%edx
cmovns %edx,%eax
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovb  %eax,%ecx
or     $0x40,%edi
shl    $0x8,%edi
shl    $0x8,%ecx
or     %ecx,%esi
jmp    1030 <spc_command@plt>

LLVM IR (-O0):
define void @sfx_play(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* %6
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 0, i32* %6
br label %10
10: ; preds = %9, %3
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 255, i32* %6
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %4
%16 = shl i32 %15, 8
%17 = or i32 16384, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = shl i32 %19, 8
%21 = or i32 %18, %20
%22 = call i32 @spc_command(i32 %17, i32 %21)
ret void
}

LLVM IR (-O2):
define void @sfx_play(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
%5 = select i1 %4, i32 %2, i32 0
%6 = icmp ult i32 %5, 255
%7 = select i1 %6, i32 %5, i32 255
%8 = shl i32 %0, 8
%9 = or i32 %8, 16384
%10 = shl nuw nsw i32 %7, 8
%11 = or i32 %10, %1
%12 = tail call i32 @spc_command(i32 %9, i32 %11)
ret void
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s) {
    if (*s == c)
      return (char *)s;
    ++s;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
void foo563(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo563(i32 %0) {
ret void
}
int mymin(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<mymin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <mymin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <mymin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @mymin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @mymin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_Callback_free_cell(void *cellData) { free(cellData); }


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

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

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

LLVM IR (-O2):
define void @my_Callback_free_cell(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void RAWToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RAWToYRow_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int /*<<< orphan*/);
int fegetenv(fenv_t *envp) {
  _FPU_GETCW(*envp);
  return 0;
}


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

x86 assembly (clang, -O2):
<fegetenv>:
push   %rax
mov    (%rdi),%edi
call   1030 <_FPU_GETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fegetenv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @_FPU_GETCW(i32 %2)
ret i32 0
}
/* Variables and functions */
unsigned long TimerGetMS();
int /*<<< orphan*/ usleep(int);
void TimerReady(unsigned long Timer) {
  while (Timer > TimerGetMS()) {
    usleep(1000);
  }
}


x86 assembly (clang, -O0):
<TimerReady>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <TimerGetMS@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jbe    115a <TimerReady+0x3a>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    112c <TimerReady+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerReady>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <TimerGetMS@plt>
cmp    %rbx,%rax
jae    1148 <TimerReady+0x28>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
jmp    1130 <TimerReady+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @TimerReady(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = call i64 (...) @TimerGetMS()
%6 = icmp ugt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @usleep(i32 1000)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @TimerReady(i64 %0) {
%2 = tail call i64 (...) @TimerGetMS()
%3 = icmp ult i64 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @usleep(i32 1000)
%6 = tail call i64 (...) @TimerGetMS()
%7 = icmp ult i64 %6, %0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xdc() {
  Assert_real((isalpha(220) == 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_isalpha.c",
              1105, ("isalpha should be 0 for 0xdc"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xdc>:
push   %rax
mov    $0xdc,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x451,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xdc\00"
define void @t_isalpha_0xdc() {
%1 = call i64 @isalpha(i32 220)
%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 1105, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xdc\00"
define void @t_isalpha_0xdc() {
%1 = tail call i64 @isalpha(i32 220)
%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 1105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ loggerf(char *, unsigned long long);
void *realloc(void *, size_t);
void *util_realloc(void *m, size_t size) {
  if ((m = realloc(m, size)) == NULL) {
    loggerf("ooops, not enough memory (%llu)", ((unsigned long long)(size)));
    abort();
  };
  return m;
}


x86 assembly (clang, -O0):
<util_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1172 <util_realloc+0x42>
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <loggerf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1050 <realloc@plt>
test   %rax,%rax
je     1140 <util_realloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <loggerf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"ooops, not enough memory (%llu)\00"
define i8* @util_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = call i32 @loggerf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [32 x i8] c"ooops, not enough memory (%llu)\00"
define noalias i8* @util_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @loggerf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %1)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
int test_imm_FFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xFF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FFuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff01,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FFuint16_mem>:
movzwl (%rdi),%eax
test   $0xff01,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -255
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __gen_ocl_get_group_id0();
int __gen_ocl_get_group_id1();
int __gen_ocl_get_group_id2();
__attribute__((always_)) unsigned get_group_id(unsigned int dim) {
  if (dim == 0)
    return __gen_ocl_get_group_id0();
  else if (dim == 1)
    return __gen_ocl_get_group_id1();
  else if (dim == 2)
    return __gen_ocl_get_group_id2();
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_group_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <get_group_id+0x24>
mov    $0x0,%al
call   1050 <__gen_ocl_get_group_id0@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_group_id+0x5d>
cmpl   $0x1,-0x8(%rbp)
jne    116d <get_group_id+0x3d>
mov    $0x0,%al
call   1030 <__gen_ocl_get_group_id1@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_group_id+0x5d>
cmpl   $0x2,-0x8(%rbp)
jne    1186 <get_group_id+0x56>
mov    $0x0,%al
call   1040 <__gen_ocl_get_group_id2@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_group_id+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_group_id>:
cmp    $0x2,%edi
je     1145 <get_group_id+0x15>
cmp    $0x1,%edi
je     114c <get_group_id+0x1c>
test   %edi,%edi
jne    1153 <get_group_id+0x23>
xor    %eax,%eax
jmp    1050 <__gen_ocl_get_group_id0@plt>
xor    %eax,%eax
jmp    1040 <__gen_ocl_get_group_id2@plt>
xor    %eax,%eax
jmp    1030 <__gen_ocl_get_group_id1@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_group_id(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %2
i32 1, label %4
i32 2, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @__gen_ocl_get_group_id0()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @__gen_ocl_get_group_id1()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @__gen_ocl_get_group_id2()
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32 [ %3, %2 ], [ %5, %4 ], [ %7, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int strparaint(char string[10]) {
  int inteiro;
  sscanf(string, "%d", &inteiro);
  return inteiro;
}


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

x86 assembly (clang, -O2):
<strparaint>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @strparaint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @strparaint(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
void rec_init(int *a, int n) {
  if (n == 0) {
    a[0] = 5;
    return;
  } else {
    __CRAB_assert(n > 0);
    a[n] = 5;
    rec_init(a, n - 1);
  }
}


x86 assembly (clang, -O0):
<rec_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1148 <rec_init+0x28>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
jmp    1177 <rec_init+0x57>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <rec_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
je     113e <rec_init+0x2e>
movslq %esi,%rbx
xchg   %ax,%ax
xor    %edi,%edi
test   %rbx,%rbx
setg   %dil
call   1030 <__CRAB_assert@plt>
movl   $0x5,(%r14,%rbx,4)
add    $0xffffffffffffffff,%rbx
test   %ebx,%ebx
jne    1120 <rec_init+0x10>
movl   $0x5,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @rec_init(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %7
6: ; preds = %7, %2
store i32 5, i32* %0
ret void
7: ; preds = %4, %7
%8 = phi i64 [ %5, %4 ], [ %13, %7 ]
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @__CRAB_assert(i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 5, i32* %12
%13 = add nsw i64 %8, -1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %6, label %7
}
/* Variables and functions */
int socket(int, int, int);
int os_socket(int domain, int type, int protocol) {
  return socket(domain, type, protocol);
}


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

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

LLVM IR (-O0):
define i32 @os_socket(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 @socket(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @os_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EPOLLIN;
int /*<<< orphan*/ kore_platform_event_schedule(int, int /*<<< orphan*/,
                                                int /*<<< orphan*/, void *);
void kore_platform_schedule_read(int fd, void *data) {
  kore_platform_event_schedule(fd, EPOLLIN, 0, data);
}


x86 assembly (clang, -O0):
<kore_platform_schedule_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <kore_platform_event_schedule@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_platform_schedule_read>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <kore_platform_event_schedule@plt>

LLVM IR (-O0):
@EPOLLIN = global i32 0
define void @kore_platform_schedule_read(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @EPOLLIN
%7 = load i8*, i8** %4
%8 = call i32 @kore_platform_event_schedule(i32 %5, i32 %6, i32 0, i8* %7)
ret void
}

LLVM IR (-O2):
@EPOLLIN = global i32 0
define void @kore_platform_schedule_read(i32 %0, i8* %1) {
%3 = load i32, i32* @EPOLLIN
%4 = tail call i32 @kore_platform_event_schedule(i32 %0, i32 %3, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tio_set_terminal(int);
void tio_restore_terminal(void) {
  printf("\033[?47l");
  printf("\033[?25h");
  printf("\033[u");
  tio_set_terminal(1);
}


x86 assembly (clang, -O0):
<tio_restore_terminal>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <tio_set_terminal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_restore_terminal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <tio_set_terminal@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?47l\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
@.str.2 = [4 x i8] c"\1B[u\00"
define void @tio_restore_terminal() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @tio_set_terminal(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?47l\00"
@.str.1 = [7 x i8] c"\1B[?25h\00"
@.str.2 = [4 x i8] c"\1B[u\00"
define void @tio_restore_terminal() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @tio_set_terminal(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fork(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ *tmpfile();
int main() {
  FILE *tmp = tmpfile();
  char buffer[100];
  memset(buffer, 0, 100);
  if (fgets(buffer, 100, tmp) != NULL) {
    abort();
  }
  puts(buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    $0x0,%al
call   1070 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x64,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1196 <main+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x70(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
xor    %eax,%eax
call   1070 <tmpfile@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
jne    119a <main+0x4a>
mov    %rsp,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca [100 x i8]
%3 = call i32* (...) @tmpfile()
store i32* %3, i32** %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 100)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = load i32*, i32** %1
%8 = call i32* @fgets(i8* %6, i32 100, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32* (...) @tmpfile()
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 100)
%5 = call i32* @fgets(i8* %3, i32 100, i32* %2)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = call i32 @puts(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int toconvert = 1026;
  int pound = 0;
  int shilling = 0;
  int pence = 0;
  pound = (int)toconvert / (12 * 20);
  shilling = (int)(toconvert % (12 * 20)) / 12;
  pence = (int)(toconvert % (12 * 20)) % 12;
  printf("Du borde ha %d pund, %d shilling och %d pence\n", pound, shilling,
         pence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x402,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf0,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Du borde ha %d pund, %d shilling och %d pence\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1026, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 240
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 240
%10 = sdiv i32 %9, 12
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = srem i32 %11, 240
%13 = srem i32 %12, 12
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Du borde ha %d pund, %d shilling och %d pence\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 4, i32 5, i32 6)
ret i32 0
}
int input_map_b4(char c) { return 0; }


x86 assembly (clang, -O0):
<input_map_b4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @input_map_b4(i8 signext %0) {
ret i32 0
}