xunge/DecIR huggingface dataset:
int test_imm_0Cuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x0C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Cuint64_highword_mem>:
testb  $0xc,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Cuint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 12
%7 = icmp ne i64 %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_0Cuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 51539607552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_attr_destroy(int /*<<< orphan*/ *);
int my_pthread_attr_destroy(pthread_attr_t *__attr) {
  int ret;
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  ret = pthread_attr_destroy(realattr);
  free(realattr);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_attr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_attr_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_destroy>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebx
mov    %rbx,%rdi
call   1040 <pthread_attr_destroy@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_pthread_attr_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_attr_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_attr_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_attr_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
unsigned long I2CMasterErr(unsigned long ulBase) {
  unsigned long ulErr;
  ;
  ulErr = (*((volatile unsigned long *)(ulBase + 0x00000014)));
  if (ulErr & (0x00000200 | 0x00000400 | 0x00000100)) {
    return (ulErr & (0x00000200 | 0x00000400 | 0x00000100));
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<I2CMasterErr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x700,%rax
cmp    $0x0,%rax
je     113b <I2CMasterErr+0x3b>
mov    -0x18(%rbp),%rax
and    $0x700,%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <I2CMasterErr+0x43>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterErr>:
mov    0x14(%rdi),%rax
and    $0x700,%eax
ret

LLVM IR (-O0):
define i64 @I2CMasterErr(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 20
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = and i64 %9, 1792
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %4
%14 = and i64 %13, 1792
store i64 %14, i64* %2
br label %16
15: ; preds = %1
store i64 0, i64* %2
br label %16
16: ; preds = %15, %12
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @I2CMasterErr(i64 %0) {
%2 = add i64 %0, 20
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 1792
ret i64 %5
}
void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
                              int op, int op_flags) {}


x86 assembly (clang, -O0):
<bfqg_stats_update_io_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bfq_group = type opaque
%struct.bfq_queue = type opaque
define void @bfqg_stats_update_io_add(%struct.bfq_group* %0, %struct.bfq_queue* %1, i32 %2, i32 %3) {
%5 = alloca %struct.bfq_group*
%6 = alloca %struct.bfq_queue*
%7 = alloca i32
%8 = alloca i32
store %struct.bfq_group* %0, %struct.bfq_group** %5
store %struct.bfq_queue* %1, %struct.bfq_queue** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.bfq_group = type opaque
%struct.bfq_queue = type opaque
define void @bfqg_stats_update_io_add(%struct.bfq_group* nocapture %0, %struct.bfq_queue* nocapture %1, i32 %2, i32 %3) {
ret void
}
int ffsl(long i) { return (__builtin_ffsl(i)); }


x86 assembly (clang, -O0):
<ffsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsl>:
bsf    %rdi,%rcx
add    $0x1,%ecx
xor    %eax,%eax
test   %rdi,%rdi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ffsl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = add i64 %4, 1
%6 = icmp eq i64 %3, 0
%7 = select i1 %6, i64 0, i64 %5
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ffsl(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = icmp eq i64 %0, 0
%4 = trunc i64 %2 to i32
%5 = add nuw nsw i32 %4, 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
double __infer_nondet_double();
double ceil(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
char *string_end(char *);
void string_reverse(char *str) {
  char *start = str;
  char *end = string_end(str);
  while (end > start) {
    char tmp = *start;
    *start = *end;
    *end = tmp;
    end--;
    start++;
  }
}


x86 assembly (clang, -O0):
<string_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <string_end@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    117a <string_reverse+0x6a>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1131 <string_reverse+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_reverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <string_end@plt>
cmp    %rbx,%rax
jbe    114c <string_reverse+0x3c>
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%ecx
movzbl 0x1(%rax),%edx
mov    %dl,(%rbx)
mov    %cl,0x1(%rax)
add    $0x1,%rbx
lea    -0x1(%rax),%rcx
cmp    %rbx,%rax
mov    %rcx,%rax
ja     1130 <string_reverse+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @string_reverse(i8* %0) {
%2 = tail call i8* @string_end(i8* %0)
%3 = icmp ugt i8* %2, %0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
store i8 %8, i8* %5
store i8 %7, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!\n");
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @splash_thread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  char our_string[] = {'H', 'a', 'l', 'l', 'i', ' ',
                       'H', 'a', 'l', 'l', 'o', '\0'};
  puts(our_string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x614820696c6c6148,%rax
20 48 61
mov    %rax,0x8(%rsp)
movl   $0x6f6c6c,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.our_string = [12 x i8] c"Halli Hallo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.our_string = [12 x i8] c"Halli Hallo\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
char *md_malloc(size_t, char const *, int);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char __attribute__((visibility("default"))) *
    md_strdup(const char *ptr, const char *fname, int line) {
  size_t len = strlen(ptr);
  char *str = md_malloc(len + 1, fname, line);
  if (str)
    memcpy(str, ptr, len + 1);
  return str;
}


x86 assembly (clang, -O0):
<md_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <md_malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1188 <md_strdup+0x58>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_strdup>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1050 <md_malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1170 <md_strdup+0x40>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @md_strdup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = add i64 %11, 1
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i8* @md_malloc(i64 %12, i8* %13, i32 %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %24
18: ; preds = %3
%19 = load i8*, i8** %8
%20 = load i8*, i8** %4
%21 = load i64, i64* %7
%22 = add i64 %21, 1
%23 = call i32 @memcpy(i8* %19, i8* %20, i64 %22)
br label %24
24: ; preds = %18, %3
%25 = load i8*, i8** %8
ret i8* %25
}

LLVM IR (-O2):
define i8* @md_strdup(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add i64 %4, 1
%6 = tail call i8* @md_malloc(i64 %5, i8* %1, i32 %2)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %5)
br label %10
10: ; preds = %8, %3
ret i8* %6
}
int test_imm_E5int64_midword_reg(long long val) {
  return ((val >> 16) & (0xE5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E5int64_midword_reg(i64 %0) {
%2 = and i64 %0, 15007744
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CLBenchmarkClose();
int /*<<< orphan*/ CLBenchmarkSetup(char const *);
void CLBenchmarkReset(const char *path) {
  CLBenchmarkClose();
  CLBenchmarkSetup(path);
}


x86 assembly (clang, -O0):
<CLBenchmarkReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <CLBenchmarkClose@plt>
mov    -0x8(%rbp),%rdi
call   1030 <CLBenchmarkSetup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLBenchmarkReset>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <CLBenchmarkClose@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <CLBenchmarkSetup@plt>

LLVM IR (-O0):
define void @CLBenchmarkReset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @CLBenchmarkClose()
%4 = load i8*, i8** %2
%5 = call i32 @CLBenchmarkSetup(i8* %4)
ret void
}

LLVM IR (-O2):
define void @CLBenchmarkReset(i8* %0) {
%2 = tail call i32 (...) @CLBenchmarkClose()
%3 = tail call i32 @CLBenchmarkSetup(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_pwr_reset(void) { mrf24j40_write_short_ctrl_reg(0x2A, (1 << 2)); }


x86 assembly (clang, -O0):
<mrf24j40_pwr_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x4,%esi
call   1030 <mrf24j40_write_short_ctrl_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_pwr_reset>:
mov    $0x2a,%edi
mov    $0x4,%esi
jmp    1030 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_pwr_reset() {
%1 = call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 4)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_pwr_reset() {
%1 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 42, i32 4)
ret void
}
int call_after_alloca(c, s, i, l)
char c;
short s;
int i;
long l;
{
  char *z = __builtin_alloca(s + 50);
  call_after_alloca_subr(c, s, i, l, 'b', 11, 12, (unsigned long)13);
}


x86 assembly (clang, -O0):
<call_after_alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movswq -0x8(%rbp),%rcx
add    $0x41,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x20(%rbp)
movsbl -0x5(%rbp),%edi
movswl -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x62,%r8d
mov    $0xb,%r9d
sub    $0x10,%rsp
movl   $0xc,(%rsp)
movq   $0xd,0x8(%rsp)
mov    $0x0,%al
call   1030 <call_after_alloca_subr@plt>
add    $0x10,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_after_alloca>:
push   %rax
movswl %si,%esi
movsbl %dil,%edi
mov    $0x62,%r8d
mov    $0xb,%r9d
xor    %eax,%eax
push   $0xd
push   $0xc
call   1030 <call_after_alloca_subr@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @call_after_alloca(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i16
%8 = alloca i32
%9 = alloca i64
%10 = alloca i8*
%11 = trunc i32 %0 to i8
%12 = trunc i32 %1 to i16
store i8 %11, i8* %6
store i16 %12, i16* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
%13 = load i16, i16* %7
%14 = sext i16 %13 to i32
%15 = add nsw i32 %14, 50
%16 = sext i32 %15 to i64
%17 = alloca i8, i64 %16
store i8* %17, i8** %10
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = load i16, i16* %7
%21 = sext i16 %20 to i32
%22 = load i32, i32* %8
%23 = load i64, i64* %9
%24 = call i32 (i32, i32, i32, i64, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call_after_alloca_subr to i32 (i32, i32, i32, i64, i32, i32, i32, i64, ...)*)(i32 %19, i32 %21, i32 %22, i64 %23, i32 98, i32 11, i32 12, i64 13)
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @call_after_alloca(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = shl i32 %0, 24
%8 = ashr exact i32 %7, 24
%9 = tail call i32 (i32, i32, i32, i64, i32, i32, i32, i64, ...) bitcast (i32 (...)* @call_after_alloca_subr to i32 (i32, i32, i32, i64, i32, i32, i32, i64, ...)*)(i32 %8, i32 %6, i32 %2, i64 %3, i32 98, i32 11, i32 12, i64 13)
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void finalizer_scrub128(void *ptr) {
  uint64_t *sz_ptr = (uint64_t *)ptr;
  int i;
  for (i = 0; i < 16; i++)
    sz_ptr[i] = 0xa5a5a5a5a5a5a5a5ULL;
}


x86 assembly (clang, -O0):
<finalizer_scrub128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    113e <finalizer_scrub128+0x3e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xa5a5a5a5,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <finalizer_scrub128+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalizer_scrub128>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @finalizer_scrub128(i8* nocapture writeonly %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func2(int **array, int m) {
  printf("Func2\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Func2\00"
define i32 @func2(i32** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void length() {}


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

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

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

LLVM IR (-O2):
define void @length() {
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int sscanf(char *, char *, char *);
void hextorb(uint8_t *hex, uint8_t *rb) {
  while (sscanf(hex, "%2x", rb) == 1) {
    hex += 2;
    rb += 1;
  }
  *rb = '\0';
}


x86 assembly (clang, -O0):
<hextorb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    115a <hextorb+0x4a>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <hextorb+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextorb>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    115b <hextorb+0x4b>
add    $0x2,%rbx
lea    0xec6(%rip),%r15
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <sscanf@plt>
add    $0x2,%rbx
cmp    $0x1,%eax
je     1140 <hextorb+0x30>
movb   $0x0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%2x\00"
define void @hextorb(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %5, label %12
12: ; preds = %5, %2
%13 = phi i8* [ %1, %2 ], [ %9, %5 ]
store i8 0, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handleC(char const);
void puth(unsigned n) {
  static const char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                               '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  handleC(hex[n & 15]);
}


x86 assembly (clang, -O0):
<puth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xed4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <handleC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puth>:
and    $0xf,%edi
lea    0xee6(%rip),%rax
movsbl (%rdi,%rax,1),%edi
jmp    1030 <handleC@plt>

LLVM IR (-O0):
@puth.hex = internal constant [16 x i8] c"0123456789ABCDEF"
define void @puth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @puth.hex, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = call i32 @handleC(i8 signext %7)
ret void
}

LLVM IR (-O2):
@puth.hex = internal unnamed_addr constant [16 x i8] c"0123456789ABCDEF"
define void @puth(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @puth.hex, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @handleC(i8 signext %5)
ret void
}
void g_date_get_julian() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_julian() {
ret void
}
/* Variables and functions */
char *android_profile_strdup_file_path(char const *, int /*<<< orphan*/ *);
char *android_profile_strdup_path(const char *profile_name) {
  return android_profile_strdup_file_path(profile_name, NULL);
}


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

x86 assembly (clang, -O2):
<android_profile_strdup_path>:
xor    %esi,%esi
jmp    1030 <android_profile_strdup_file_path@plt>

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

LLVM IR (-O2):
define i8* @android_profile_strdup_path(i8* %0) {
%2 = tail call i8* @android_profile_strdup_file_path(i8* %0, i32* null)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, double);
int main(int argc, const char *argv[]) {
  float float1;
  float float2;
  double floatSums;
  float1 = 3.14;
  float2 = 42.0;
  floatSums = float1 + float2;
  printf("The sum of %f and %f is %f \n", float1, float2, floatSums);
  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)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"The sum of %f and %f is %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x40091EB860000000, float* %6
store float 4.200000e+01, float* %7
%9 = load float, float* %6
%10 = load float, float* %7
%11 = fadd float %9, %10
%12 = fpext float %11 to double
store double %12, double* %8
%13 = load float, float* %6
%14 = load float, float* %7
%15 = load double, double* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %13, float %14, double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"The sum of %f and %f is %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x40091EB860000000, float 4.200000e+01, double 0x404691EB80000000)
ret i32 0
}
int test_imm_36int16_mem(short *val) {
  return ((*val) & (-0x36 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_36int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -54
%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_36int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -54
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int http_tosp_length(char, char const *);
int http_field_name_length(const char *s) { return http_tosp_length(':', s); }


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

x86 assembly (clang, -O2):
<http_field_name_length>:
mov    %rdi,%rsi
mov    $0x3a,%edi
jmp    1030 <http_tosp_length@plt>

LLVM IR (-O0):
define i32 @http_field_name_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @http_tosp_length(i8 signext 58, i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @http_field_name_length(i8* %0) {
%2 = tail call i32 @http_tosp_length(i8 signext 58, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x2a() {
  Assert_real((isalpha(42) == 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",
              215, ("isalpha should be 0 for *"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x2a>:
push   %rax
mov    $0x2a,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd7,%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 = [26 x i8] c"isalpha should be 0 for *\00"
define void @t_isalpha_0x2a() {
%1 = call i64 @isalpha(i32 42)
%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 215, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isalpha should be 0 for *\00"
define void @t_isalpha_0x2a() {
%1 = tail call i64 @isalpha(i32 42)
%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 215, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
dolabel() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dolabel() {
ret i32 0
}
/* Variables and functions */
int add(int, int);
int main(int argc, char **argv) { return add(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <add@plt>

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
%6 = call i32 @add(i32 1, i32 2)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 1, i32 2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ stderr;
int ModuloAdd(int f, int k) {
  int tmp;
  tmp = f + k;
  0 && fprintf(stderr, "MDBG f+k = t  %d + %d = %d, ", f, k, tmp);
  if (tmp >= 27)
    tmp -= 27;
  0 && fprintf(stderr, " mod= %d\n", tmp);
  return (tmp);
}


x86 assembly (clang, -O0):
<ModuloAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1b,-0xc(%rbp)
jl     1126 <ModuloAdd+0x26>
mov    -0xc(%rbp),%eax
sub    $0x1b,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModuloAdd>:
lea    (%rsi,%rdi,1),%ecx
cmp    $0x1b,%ecx
lea    -0x1b(%rsi,%rdi,1),%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @ModuloAdd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 27
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 27
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @ModuloAdd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp sgt i32 %3, 26
%5 = add nsw i32 %3, -27
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
void XFreeExtensionList() {}


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

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

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

LLVM IR (-O2):
define void @XFreeExtensionList() {
ret void
}
int isless(float f1, float f2) {
  int r = (f1 < f2);
  return !r ? -1 : 1;
}


x86 assembly (clang, -O0):
<isless>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x1,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isless>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @isless(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fcmp olt float %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @isless(float %0, float %1) {
%3 = fcmp uge float %0, %1
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void _Tc_HashTable_NullErrorMessage(const char *file, const char *funcname,
                                    unsigned long linenumber) {
  fprintf(stderr, "\n\nWARNING: Type-checked cast attempted on NULL pointer.");
  fprintf(stderr, "\n\nLocation: %s, function %s, line %lu. \n", file, funcname,
          linenumber);
}


x86 assembly (clang, -O0):
<_Tc_HashTable_NullErrorMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Tc_HashTable_NullErrorMessage>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2eb8(%rip),%r12
mov    (%r12),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xef3(%rip),%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"\0A\0AWARNING: Type-checked cast attempted on NULL pointer.\00"
@.str.1 = [41 x i8] c"\0A\0ALocation: %s, function %s, line %lu. \0A\00"
define void @_Tc_HashTable_NullErrorMessage(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i64 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"\0A\0AWARNING: Type-checked cast attempted on NULL pointer.\00"
@.str.1 = [41 x i8] c"\0A\0ALocation: %s, function %s, line %lu. \0A\00"
define void @_Tc_HashTable_NullErrorMessage(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i64 %2)
ret void
}
void lh_new(void) {}


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

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

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

LLVM IR (-O2):
define void @lh_new() {
ret void
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
int uname(struct utsname *);
int gethostname(char *name, size_t len) {
  struct utsname u;
  int status = uname(&u);
  if (-1 != status) {
    strncpy(name, u.nodename, len);
    name[len - 1] = '\0';
  }
  return (status);
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <uname@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x1c(%rbp),%eax
je     116a <gethostname+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1154 <gethostname+0x34>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.utsname
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i32 @uname(%struct.utsname* %5)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 -1, %8
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %5, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i64, i64* %4
%15 = call i32 @strncpy(i8* %11, i32 %13, i64 %14)
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = sub i64 %17, 1
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
br label %20
20: ; preds = %10, %2
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @strncpy(i8* %0, i32 %9, i64 %1)
%11 = add i64 %1, -1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %7, %2
ret i32 %5
}
int test_imm_85uint32_reg(unsigned int val) {
  return ((val) & (0x85 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_85uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x85,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_85uint32_reg(i32 %0) {
%2 = and i32 %0, 133
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ flip2(unsigned short *, unsigned short *, int);
int read(int, unsigned short *, int);
int read_uint2_array(int f, unsigned short *iarray, int n) {
  int nread = read(f, iarray, n * 2);
  if (nread <= 0)
    return 0;
  flip2(iarray, iarray, nread / 2);
  return nread / 2;
}


x86 assembly (clang, -O0):
<read_uint2_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     115d <read_uint2_array+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1185 <read_uint2_array+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <flip2@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint2_array>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
add    %edx,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1144 <read_uint2_array+0x24>
mov    %eax,%ebp
shr    %ebp
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <flip2@plt>
jmp    1146 <read_uint2_array+0x26>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_uint2_array(i32 %0, i16* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i16* %1, i16** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i16*, i16** %6
%11 = load i32, i32* %7
%12 = mul nsw i32 %11, 2
%13 = call i32 @read(i32 %9, i16* %10, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %25
17: ; preds = %3
%18 = load i16*, i16** %6
%19 = load i16*, i16** %6
%20 = load i32, i32* %8
%21 = sdiv i32 %20, 2
%22 = call i32 @flip2(i16* %18, i16* %19, i32 %21)
%23 = load i32, i32* %8
%24 = sdiv i32 %23, 2
store i32 %24, i32* %4
br label %25
25: ; preds = %17, %16
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_uint2_array(i32 %0, i16* %1, i32 %2) {
%4 = shl nsw i32 %2, 1
%5 = tail call i32 @read(i32 %0, i16* %1, i32 %4)
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = lshr i32 %5, 1
%9 = tail call i32 @flip2(i16* %1, i16* %1, i32 %8)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %8, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ close(int /*<<< orphan*/);
void close_stdfiles(void) {
  {};
  close(STDIN_FILENO);
  close(STDOUT_FILENO);
  close(STDERR_FILENO);
  {};
}


x86 assembly (clang, -O0):
<close_stdfiles>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_stdfiles>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <close@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_stdfiles() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @close(i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @close(i32 %3)
%5 = load i32, i32* @STDERR_FILENO
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
define void @close_stdfiles() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @close(i32 %1)
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @close(i32 %3)
%5 = load i32, i32* @STDERR_FILENO
%6 = tail call i32 @close(i32 %5)
ret void
}