xunge/DecIR huggingface dataset:
/* Variables and functions */
char *format_memcached(char const *, int);
char *format_http(const char *payload, int size) {
  return format_memcached(payload, size);
}


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

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

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

LLVM IR (-O2):
define i8* @format_http(i8* %0, i32 %1) {
%3 = tail call i8* @format_memcached(i8* %0, i32 %1)
ret i8* %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
unsigned long long _pthread_time_in_ms();
unsigned long long _pthread_time_in_ms_from_timespec(struct timespec const *);
unsigned long long _pthread_rel_time_in_ms(const struct timespec *ts) {
  unsigned long long t1 = _pthread_time_in_ms_from_timespec(ts);
  unsigned long long t2 = _pthread_time_in_ms();
  if (t1 < t2)
    return 1;
  return t1 - t2;
}


x86 assembly (clang, -O0):
<_pthread_rel_time_in_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_pthread_time_in_ms_from_timespec@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <_pthread_time_in_ms@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115f <_pthread_rel_time_in_ms+0x3f>
movq   $0x1,-0x8(%rbp)
jmp    116b <_pthread_rel_time_in_ms+0x4b>
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pthread_rel_time_in_ms>:
push   %rbx
call   1040 <_pthread_time_in_ms_from_timespec@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <_pthread_time_in_ms@plt>
sub    %rax,%rbx
mov    $0x1,%eax
cmovae %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @_pthread_rel_time_in_ms(%struct.timespec* %0) {
%2 = alloca i64
%3 = alloca %struct.timespec*
%4 = alloca i64
%5 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = call i64 @_pthread_time_in_ms_from_timespec(%struct.timespec* %6)
store i64 %7, i64* %4
%8 = call i64 (...) @_pthread_time_in_ms()
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i64 1, i64* %2
br label %17
13: ; preds = %1
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = sub i64 %14, %15
store i64 %16, i64* %2
br label %17
17: ; preds = %13, %12
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i64 @_pthread_rel_time_in_ms(%struct.timespec* %0) {
%2 = tail call i64 @_pthread_time_in_ms_from_timespec(%struct.timespec* %0)
%3 = tail call i64 (...) @_pthread_time_in_ms()
%4 = icmp ult i64 %2, %3
%5 = sub i64 %2, %3
%6 = select i1 %4, i64 1, i64 %5
ret i64 %6
}
int fun252() { return 252; }


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

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

LLVM IR (-O0):
define i32 @fun252() {
ret i32 252
}

LLVM IR (-O2):
define i32 @fun252() {
ret i32 252
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ UINT8_MAX;
int add_uint8_overflows(uint8_t a, uint8_t b) { return (b > UINT8_MAX - a); }


x86 assembly (clang, -O0):
<add_uint8_overflows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x8(%rbp),%rcx
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_uint8_overflows>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
sub    %rdi,%rcx
xor    %eax,%eax
cmp    %rsi,%rcx
setl   %al
ret

LLVM IR (-O0):
@UINT8_MAX = global i64 0
define i32 @add_uint8_overflows(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @UINT8_MAX
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = icmp sgt i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@UINT8_MAX = global i64 0
define i32 @add_uint8_overflows(i64 %0, i64 %1) {
%3 = load i64, i64* @UINT8_MAX
%4 = sub nsw i64 %3, %0
%5 = icmp slt i64 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t size = 0;
  while (*s++ != '\0')
    size++;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ lapic_write(int, int /*<<< orphan*/);
void lapic_send_eoi(void) { lapic_write((0xFEE00000 + 0x0B0), 0); }


x86 assembly (clang, -O0):
<lapic_send_eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfee000b0,%edi
xor    %esi,%esi
call   1030 <lapic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lapic_send_eoi>:
mov    $0xfee000b0,%edi
xor    %esi,%esi
jmp    1030 <lapic_write@plt>

LLVM IR (-O0):
define void @lapic_send_eoi() {
%1 = call i32 @lapic_write(i32 -18874192, i32 0)
ret void
}

LLVM IR (-O2):
define void @lapic_send_eoi() {
%1 = tail call i32 @lapic_write(i32 -18874192, i32 0)
ret void
}
unsigned xrop3_87_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_87_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_87_1_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %edi,%esi
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_87_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_87_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i8 %1, %0
%8 = zext i8 %7 to i32
%9 = or i32 %4, %8
%10 = or i32 %9, %6
%11 = xor i32 %10, -1
%12 = or i32 %8, %11
ret i32 %12
}
int xxx(int y, int z) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xxx(i32 %0, i32 %1) {
ret i32 0
}
int add(int x, int y) {
  int r;
  r = x + y;
  return r;
}


x86 assembly (clang, -O0):
<add>:
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)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @add(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
ret i32 %9
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int check_prime(int num) {
  int i = 2;
  if (num == 1) {
    return 0;
  }
  for (i = 2; i <= num - 1; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  { return 1; }
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <check_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1172 <check_prime+0x72>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     116b <check_prime+0x6b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1158 <check_prime+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1172 <check_prime+0x72>
jmp    115d <check_prime+0x5d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <check_prime+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %ecx,%ecx
cmp    $0x1,%edi
jne    110a <check_prime+0xa>
mov    %ecx,%eax
ret
cmp    $0x3,%edi
jl     1130 <check_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <check_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <check_prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
const char *call_s(const char *(*func)(const char *), const char *arg) {
  return func(arg);
}


x86 assembly (clang, -O0):
<call_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_s>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define i8* @call_s(i8* (i8*)* nocapture %0, i8* %1) {
%3 = tail call i8* %0(i8* %1)
ret i8* %3
}
/* Variables and functions */
char *getchar();
char *wakithxuli_ghilaki() { return getchar(); }


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

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

LLVM IR (-O0):
define i8* @wakithxuli_ghilaki() {
%1 = call i8* (...) @getchar()
ret i8* %1
}

LLVM IR (-O2):
define i8* @wakithxuli_ghilaki() {
%1 = tail call i8* (...) @getchar()
ret i8* %1
}
/* Variables and functions */
int munlockall();
int /*<<< orphan*/ terminal_error(char *);
void set_munlock(void) {
  if (munlockall() == -1)
    terminal_error("munlockall");
}


x86 assembly (clang, -O0):
<set_munlock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <munlockall@plt>
cmp    $0xffffffff,%eax
jne    1140 <set_munlock+0x20>
lea    0xec5(%rip),%rdi
call   1030 <terminal_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_munlock>:
push   %rax
xor    %eax,%eax
call   1040 <munlockall@plt>
cmp    $0xffffffff,%eax
je     112f <set_munlock+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <terminal_error@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"munlockall\00"
define void @set_munlock() {
%1 = call i32 (...) @munlockall()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @terminal_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"munlockall\00"
define void @set_munlock() {
%1 = tail call i32 (...) @munlockall()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @terminal_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
int afunc(int *x) {}


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

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

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

LLVM IR (-O2):
define i32 @afunc(i32* nocapture readnone %0) {
ret i32 undef
}
int __ocl_any_char(char src) { return (src >> (8 - 1)) & 0x1; }


x86 assembly (clang, -O0):
<__ocl_any_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_any_char>:
shr    $0x7,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @__ocl_any_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 7
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @__ocl_any_char(i8 signext %0) {
%2 = lshr i8 %0, 7
%3 = zext i8 %2 to i32
ret i32 %3
}
void gtk_radio_tool_button_new() {}


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

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

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

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

/* Variables and functions */
scalar_t__ iswalpha(int /*<<< orphan*/);
scalar_t__ iswdigit(int /*<<< orphan*/);
int iswalnum(wint_t c) { return iswdigit(c) || iswalpha(c); }


x86 assembly (clang, -O0):
<iswalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <iswdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <iswalnum+0x37>
mov    -0x4(%rbp),%edi
call   1040 <iswalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <iswdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <iswalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <iswalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iswalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @iswdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @iswalpha(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @iswalnum(i32 %0) {
%2 = tail call i64 @iswdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @iswalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int test_imm_42int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x42 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_42int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 66
%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_42int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 283467841536
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void FreeHelp() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ RTC_SetCounter(int /*<<< orphan*/);
int rtc_init(void) {
  RTC_SetCounter((uint32_t)((11 * 60 + 55) * 60));
  return 0;
}


x86 assembly (clang, -O0):
<rtc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa794,%edi
call   1030 <RTC_SetCounter@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_init>:
push   %rax
mov    $0xa794,%edi
call   1030 <RTC_SetCounter@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rtc_init() {
%1 = call i32 @RTC_SetCounter(i32 42900)
ret i32 0
}

LLVM IR (-O2):
define i32 @rtc_init() {
%1 = tail call i32 @RTC_SetCounter(i32 42900)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unreachable();
int fge32(int a) {
  unsigned i = a / 4;
  unsigned j = i + 3;
  if (j == -7)
    return -1;
  if (i >= -3)
    return 0;
  if (i >= j)
    unreachable();
  return 1;
}


x86 assembly (clang, -O0):
<fge32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xfffffff9,-0x10(%rbp)
jne    1148 <fge32+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <fge32+0x68>
cmpl   $0xfffffffd,-0xc(%rbp)
jb     115e <fge32+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1178 <fge32+0x68>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jb     1171 <fge32+0x61>
mov    $0x0,%al
call   1030 <unreachable@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fge32>:
lea    0x2b(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x4,%ecx
jb     1120 <fge32+0x20>
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
xor    %eax,%eax
cmp    $0xfffffffd,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @fge32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 4
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add i32 %8, 3
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -7
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %24
13: ; preds = %1
%14 = load i32, i32* %4
%15 = icmp uge i32 %14, -3
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %2
br label %24
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp uge i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @unreachable()
br label %23
23: ; preds = %21, %17
store i32 1, i32* %2
br label %24
24: ; preds = %23, %16, %12
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @fge32(i32 %0) {
%2 = add i32 %0, 43
%3 = icmp ult i32 %2, 4
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 4
%6 = icmp ult i32 %5, -3
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x6b() {
  Assert_real((iscntrl(107) == 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_iscntrl.c",
              540, ("iscntrl should be 0 for k"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x21c,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for k\00"
define void @t_iscntrl_0x6b() {
%1 = call i64 @iscntrl(i32 107)
%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 540, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for k\00"
define void @t_iscntrl_0x6b() {
%1 = tail call i64 @iscntrl(i32 107)
%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 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long abs_val(unsigned long a, unsigned long b) {
  if (a > b) {
    return (a - b);
  } else {
    return (b - a);
  }
}


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    112b <abs_val+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <abs_val+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
mov    %rsi,%rax
sub    %rdi,%rax
neg    %rax
sub    %rdi,%rsi
cmovae %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @abs_val(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = sub i64 %0, %1
%5 = sub i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int system(char *);
int main() {
  int respuesta;
  do {
    respuesta = system("zenity --question --text \"¿Es usted tonto?\"");
  } while (respuesta != 0);
  if (respuesta == 0)
    system("toilet -F border --gay \"Ahora eres mi putita     :D\"");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <main+0xf>
cmpl   $0x0,-0x8(%rbp)
jne    114e <main+0x3e>
lea    0xee4(%rip),%rdi
call   1030 <system@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <system@plt>
test   %eax,%eax
jne    1120 <main+0x10>
lea    0xefa(%rip),%rdi
call   1030 <system@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"zenity --question --text \22\C2\BFEs usted tonto?\22\00"
@.str.1 = [53 x i8] c"toilet -F border --gay \22Ahora eres mi putita :D\22\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %5, %0
%4 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
br label %5
5: ; preds = %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str = [45 x i8] c"zenity --question --text \22\C2\BFEs usted tonto?\22\00"
@.str.1 = [53 x i8] c"toilet -F border --gay \22Ahora eres mi putita :D\22\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void myfree(void *ptr, char *file, int line) {
  if (file == file && line == line) {
  }
  free(ptr);
}


x86 assembly (clang, -O0):
<myfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1142 <myfree+0x32>
mov    -0x14(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1142 <myfree+0x32>
jmp    1142 <myfree+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @myfree(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %15
15: ; preds = %14, %10, %3
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
define void @myfree(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal5(char const *, char const *, char const *, char *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void fatal3x(const char *a, const char *b, const char *c) {
  fatal5(a, b, c, ": ", strerror(errno));
}


x86 assembly (clang, -O0):
<fatal3x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%r8d
lea    0xe90(%rip),%rcx
call   1030 <fatal5@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal3x>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebd(%rip),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fatal5@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @fatal3x(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @fatal5(i8* %7, i8* %8, i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @fatal3x(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @fatal5(i8* %0, i8* %1, i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void g_arith_hypot_f_u64(void *s, void *d, void *o) {}


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

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

LLVM IR (-O0):
define void @g_arith_hypot_f_u64(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_hypot_f_u64(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int sys_socket(int domain, int type, int protocol) { return 1; }


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

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

LLVM IR (-O0):
define i32 @sys_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
ret i32 1
}

LLVM IR (-O2):
define i32 @sys_socket(i32 %0, i32 %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
float logf(float);
float num_log(float a) { return logf(a); }


x86 assembly (clang, -O0):
<num_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @num_log(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ pmu_adc_reset_setting();
int /*<<< orphan*/ pmu_enable_4V_harvesting();
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_set_clk_init();
void pmu_init() {
  pmu_set_clk_init();
  pmu_enable_4V_harvesting();
  pmu_reg_write(0x45, ((0x00 << 9) | (0x00 << 8) | (0x48 << 0)));
  pmu_reg_write(0x3A,
                ((1 << 20) | (0 << 19) | (1 << 13) | (1 << 12) | (1 << 11)));
  pmu_adc_reset_setting();
}


x86 assembly (clang, -O0):
<pmu_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <pmu_set_clk_init@plt>
mov    $0x0,%al
call   1030 <pmu_enable_4V_harvesting@plt>
mov    $0x45,%edi
mov    $0x48,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x3a,%edi
mov    $0x103800,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x0,%al
call   1050 <pmu_adc_reset_setting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_init>:
push   %rax
xor    %eax,%eax
call   1060 <pmu_set_clk_init@plt>
xor    %eax,%eax
call   1030 <pmu_enable_4V_harvesting@plt>
mov    $0x45,%edi
mov    $0x48,%esi
call   1040 <pmu_reg_write@plt>
mov    $0x3a,%edi
mov    $0x103800,%esi
call   1040 <pmu_reg_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <pmu_adc_reset_setting@plt>

LLVM IR (-O0):
define void @pmu_init() {
%1 = call i32 (...) @pmu_set_clk_init()
%2 = call i32 (...) @pmu_enable_4V_harvesting()
%3 = call i32 @pmu_reg_write(i32 69, i32 72)
%4 = call i32 @pmu_reg_write(i32 58, i32 1062912)
%5 = call i32 (...) @pmu_adc_reset_setting()
ret void
}

LLVM IR (-O2):
define void @pmu_init() {
%1 = tail call i32 (...) @pmu_set_clk_init()
%2 = tail call i32 (...) @pmu_enable_4V_harvesting()
%3 = tail call i32 @pmu_reg_write(i32 69, i32 72)
%4 = tail call i32 @pmu_reg_write(i32 58, i32 1062912)
%5 = tail call i32 (...) @pmu_adc_reset_setting()
ret void
}
void strip_newline(char *s) {
  while (*s != '\0') {
    if (*s == '\r' || *s == '\n')
      *s = '\0';
    s++;
  }
}


x86 assembly (clang, -O0):
<strip_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <strip_newline+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1138 <strip_newline+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    113f <strip_newline+0x3f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strip_newline+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_newline>:
jmp    1117 <strip_newline+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <strip_newline+0x10>
cmp    $0xd,%al
je     1110 <strip_newline+0x10>
test   %al,%al
jne    1113 <strip_newline+0x13>
ret

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

LLVM IR (-O2):
define void @strip_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ outliers(double *, int);
bool no_outliers(double *vals, int len) { return (outliers(vals, len) == 0); }


x86 assembly (clang, -O0):
<no_outliers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <outliers@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_outliers>:
push   %rax
call   1030 <outliers@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @no_outliers(double* %0, i32 %1) {
%3 = tail call i64 @outliers(double* %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int setsilent(struct termios *initial_term) {
  int r;
  struct termios term;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @setsilent(%struct.termios* %0) {
%2 = alloca %struct.termios*
%3 = alloca i32
%4 = alloca %struct.termios
store %struct.termios* %0, %struct.termios** %2
ret i32 0
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @setsilent(%struct.termios* nocapture readnone %0) {
ret i32 0
}
void ve_nfs_data_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ve_nfs_data_init() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void viderBuffer(void) {
  int c;
  c = 0;
  while (c != '\n' && c != EOF)
    c = getchar();
}


x86 assembly (clang, -O0):
<viderBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1140 <viderBuffer+0x30>
mov    -0x4(%rbp),%eax
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1150 <viderBuffer+0x40>
jmp    115f <viderBuffer+0x4f>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    111f <viderBuffer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viderBuffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
cmpl   $0x0,(%rbx)
je     1130 <viderBuffer+0x20>
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <viderBuffer+0x20>
cmp    (%rbx),%eax
jne    1120 <viderBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @viderBuffer() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (...) @getchar()
store i32 %12, i32* %1
br label %2
13: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @viderBuffer() {
%1 = load i32, i32* @EOF
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getchar()
%5 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ will_not_return();
void unreachable_null_ok() {
  int *p = NULL;
  if (p == NULL) {
    will_not_return();
  }
  *p = 42;
}


x86 assembly (clang, -O0):
<unreachable_null_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <unreachable_null_ok+0x22>
mov    $0x0,%al
call   1030 <will_not_return@plt>
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unreachable_null_ok>:
push   %rax
xor    %eax,%eax
call   1030 <will_not_return@plt>

LLVM IR (-O0):
define void @unreachable_null_ok() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @will_not_return()
br label %6
6: ; preds = %4, %0
%7 = load i32*, i32** %1
store i32 42, i32* %7
ret void
}

LLVM IR (-O2):
define void @unreachable_null_ok() {
%1 = tail call i32 (...) @will_not_return()
unreachable
}
int test_imm_D0int8_reg(signed char val) {
  return ((val) & (-0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D0int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -208
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_14int64_lowword_mem(long long *val) {
  return ((*val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 20
%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_14int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 20
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
isascii(int c) { return (((int)(c) >= 0) && ((int)(c) <= 0x7F)); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x55() {
  Assert_real((isgraph(85)),
              "/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_isgraph.c",
              430, ("isgraph should be 1 for U"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x55>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1ae,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x55>:
push   %rax
mov    $0x55,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1ae,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for U\00"
define void @t_isgraph_0x55() {
%1 = call i32 @isgraph(i32 85)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for U\00"
define void @t_isgraph_0x55() {
%1 = tail call i32 @isgraph(i32 85)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}