xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ const uint32_t;

/* Variables and functions */
const uint32_t *find_last_uint32_t(const uint32_t *it, const uint32_t *end,
                                   uint32_t val) {
  while (it != end) {
    --end;
    if (*end == val)
      return end;
  }
  return 0;
}


x86 assembly (clang, -O0):
<find_last_uint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     114d <find_last_uint32_t+0x4d>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    1148 <find_last_uint32_t+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <find_last_uint32_t+0x55>
jmp    1110 <find_last_uint32_t+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_last_uint32_t>:
cmp    %rdi,%rsi
je     1113 <find_last_uint32_t+0x13>
lea    -0x8(%rsi),%rax
cmp    %rdx,-0x8(%rsi)
mov    %rax,%rsi
jne    1100 <find_last_uint32_t>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @find_last_uint32_t(i64* readnone %0, i64* %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i64* [ %1, %3 ], [ %8, %7 ]
%6 = icmp eq i64* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = getelementptr inbounds i64, i64* %5, i64 -1
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %7
%12 = phi i64* [ %8, %7 ], [ null, %4 ]
ret i64* %12
}
/* Variables and functions */
int fabs(double);
int fcmp(double a, double b) {
  if (fabs(a - b) < 1e-50)
    return 0;
  if (a < b)
    return -1;
  else
    return +1;
}


x86 assembly (clang, -O0):
<fcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1153 <fcmp+0x43>
movl   $0x0,-0x4(%rbp)
jmp    117a <fcmp+0x6a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1173 <fcmp+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <fcmp+0x6a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmp>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm0
ucomisd 0x10(%rsp),%xmm0
setbe  %cl
lea    (%rcx,%rcx,1),%edx
add    $0xffffffff,%edx
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %edx,%ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @fcmp(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 1.000000e-50
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %19
13: ; preds = %2
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -1, i32* %3
br label %19
18: ; preds = %13
store i32 1, i32* %3
br label %19
19: ; preds = %18, %17, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @fcmp(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = fcmp olt double %0, %1
%6 = select i1 %5, i32 -1, i32 1
%7 = icmp sgt i32 %4, 0
%8 = select i1 %7, i32 %6, i32 0
ret i32 %8
}
unsigned int hash_get_bucket(void *ptr) {
  unsigned int number = (long)ptr;
  unsigned int bucket = (number >> 3) % 30031;
  return bucket;
}


x86 assembly (clang, -O0):
<hash_get_bucket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
mov    $0x754f,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_get_bucket>:
mov    %rdi,%rax
shr    $0x3,%eax
imul   $0x11754e55,%rax,%rcx
shr    $0x2b,%rcx
imul   $0x754f,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_get_bucket(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = lshr i32 %8, 3
%10 = urem i32 %9, 30031
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash_get_bucket(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 3
%5 = urem i32 %4, 30031
ret i32 %5
}
void EPINonBlockingReadStart(unsigned long ulBase, unsigned long ulChannel,
                             unsigned long ulCount) {
  unsigned long ulOffset;
  ;
  ;
  ;
  ulOffset = ulChannel * (0x00000038 - 0x00000028);
  (*((volatile unsigned long *)(ulBase + 0x00000028 + ulOffset))) = ulCount;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x28,%rax
add    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStart>:
shl    $0x4,%rsi
mov    %rdx,0x28(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @EPINonBlockingReadStart(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = mul i64 %8, 16
store i64 %9, i64* %7
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = add i64 %11, 40
%13 = load i64, i64* %7
%14 = add i64 %12, %13
%15 = inttoptr i64 %14 to i64*
store volatile i64 %10, i64* %15
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadStart(i64 %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 4
%5 = add i64 %0, 40
%6 = add i64 %5, %4
%7 = inttoptr i64 %6 to i64*
store volatile i64 %2, i64* %7
ret void
}
int checkFib(long int n) {
  long int isPerfectSquare(long int);
  if (isPerfectSquare(5 * n * n + 4) || isPerfectSquare(5 * n * n - 4)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkFib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
imul   $0x5,-0x10(%rbp),%rdi
imul   -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <isPerfectSquare@plt>
cmp    $0x0,%rax
jne    1156 <checkFib+0x46>
imul   $0x5,-0x10(%rbp),%rdi
imul   -0x10(%rbp),%rdi
sub    $0x4,%rdi
call   1030 <isPerfectSquare@plt>
cmp    $0x0,%rax
je     1162 <checkFib+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <checkFib+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFib>:
push   %rbx
mov    %rdi,%rbx
imul   %rdi,%rbx
lea    (%rbx,%rbx,4),%rdi
add    $0x4,%rdi
call   1030 <isPerfectSquare@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1134 <checkFib+0x24>
pop    %rbx
ret
lea    (%rbx,%rbx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <isPerfectSquare@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @checkFib(i64 %0) {
%2 = mul nsw i64 %0, 5
%3 = mul nsw i64 %2, %0
%4 = add nsw i64 %3, 4
%5 = tail call i64 @isPerfectSquare(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = add nsw i64 %3, -4
%9 = tail call i64 @isPerfectSquare(i64 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %7, %1
%13 = phi i32 [ 1, %1 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct nlattr {
  int dummy;
};

/* Variables and functions */
uint8_t nla_read_u8(const struct nlattr *nla) { return *(uint8_t *)(nla + 1); }


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

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

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

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_read_u8(%struct.nlattr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 1, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int set_closeexec(int fd) {
  int val = 0;
  if ((val = fcntl(fd, F_GETFD, 0)) < 0) {
    return -1;
  }
  val |= FD_CLOEXEC;
  return (fcntl(fd, F_SETFD, val));
}


x86 assembly (clang, -O0):
<set_closeexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    114d <set_closeexec+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <set_closeexec+0x63>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_closeexec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <set_closeexec+0x33>
mov    0x2eaa(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_closeexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = load i32, i32* @FD_CLOEXEC
%12 = load i32, i32* %4
%13 = or i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* @F_SETFD
%16 = load i32, i32* %4
%17 = call i32 @fcntl(i32 %14, i32 %15, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %10, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @set_closeexec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @FD_CLOEXEC
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
int numDigits(const float n) {
  int m = (int)n;
  int count = 0;
  while (m > 0) {
    m /= 10;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<numDigits>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113e <numDigits+0x3e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <numDigits+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDigits>:
cvttss2si %xmm0,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    1124 <numDigits+0x24>
mov    $0xcccccccd,%edx
nop
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1110 <numDigits+0x10>
ret

LLVM IR (-O0):
define i32 @numDigits(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 10
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %7
15: ; preds = %7
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @numDigits(float %0) {
%2 = fptosi float %0 to i32
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %6, 10
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int getpid(void) {
  printf("getpid() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<getpid>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"getpid() not implemented\0A\00"
define i32 @getpid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"getpid() not implemented\00"
define i32 @getpid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ printf(char *, int);
void t2(void *who) {
  printf("t2 %d start\n", (int)who);
  MyThreadExit();
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MyThreadExit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"t2 %d start\0A\00"
define void @t2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @MyThreadExit()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"t2 %d start\0A\00"
define void @t2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @MyThreadExit()
ret void
}
void at91_sys_write(unsigned int reg_offset, unsigned long value) {
  void *addr = (void *)0xffffe800;
  (*(volatile unsigned int *)(addr + reg_offset) = (value));
}


x86 assembly (clang, -O0):
<at91_sys_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffe800,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %edx,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<at91_sys_write>:
mov    %edi,%eax
mov    $0xffffe800,%ecx
mov    %esi,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @at91_sys_write(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
store i8* inttoptr (i64 4294961152 to i8*), i8** %5
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %5
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = getelementptr i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @at91_sys_write(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = zext i32 %0 to i64
%5 = getelementptr i8, i8* inttoptr (i64 4294961152 to i8*), i64 %4
%6 = bitcast i8* %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
void module_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @module_destroy() {
ret void
}
/* Variables and functions */
long double cosl(long double);
long double sinl(long double);
long double tanl(long double x) { return (sinl(x) / cosl(x)); }


x86 assembly (clang, -O0):
<tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
fldt   -0x1c(%rbp)
fdivp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
fstpt  0x1c(%rsp)
fldt   0x10(%rsp)
fstpt  (%rsp)
call   1040 <cosl@plt>
fldt   0x1c(%rsp)
fdivp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @sinl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @cosl(x86_fp80 %5)
%7 = fdiv x86_fp80 %4, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinl(x86_fp80 %0)
%3 = tail call x86_fp80 @cosl(x86_fp80 %0)
%4 = fdiv x86_fp80 %2, %3
ret x86_fp80 %4
}
long neq(long a, long b) { return a != b; }


x86 assembly (clang, -O0):
<neq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<neq>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i64 @neq(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xd8() {
  Assert_real((isprint(216) == 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_isprint.c",
              1085, ("isprint should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x43d,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd8\00"
define void @t_isprint_0xd8() {
%1 = call i64 @isprint(i32 216)
%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 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd8\00"
define void @t_isprint_0xd8() {
%1 = tail call i64 @isprint(i32 216)
%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 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int vaild_lre_results(int res) { return (res == (1) || res == (0)); }


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

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

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

LLVM IR (-O2):
define i32 @vaild_lre_results(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_letters(char *);
void print_arguments(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    print_letters(argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <print_arguments+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <print_letters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_arguments+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_arguments(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @print_letters(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void _clr_bit(volatile void *addr, unsigned long nr) {
  __asm__ __volatile__("btr %1,%0"
                       : "+m"(*(unsigned long *)addr)
                       : "Ir"(nr)
                       : "memory");
}


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

x86 assembly (clang, -O2):
<_clr_bit>:
btr    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @_clr_bit(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @_clr_bit(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
tail call void asm sideeffect "btr $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1, i64* elementtype(i64) %3)
ret void
}
/* Variables and functions */
int dl_linux_open(int const);
int scamper_dl_open_fd(const int ifindex) { return dl_linux_open(ifindex); }


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

x86 assembly (clang, -O2):
<scamper_dl_open_fd>:
jmp    1030 <dl_linux_open@plt>

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

LLVM IR (-O2):
define i32 @scamper_dl_open_fd(i32 %0) {
%2 = tail call i32 @dl_linux_open(i32 %0)
ret i32 %2
}
/* Variables and functions */
int open(char const *, int);
int /*<<< orphan*/ unix_error(char *);
int Open(const char *pathname, int flags) {
  int rc;
  if ((rc = open(pathname, flags)) < 0)
    unix_error("Open error");
  return rc;
}


x86 assembly (clang, -O0):
<Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1153 <Open+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Open+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Open error\00"
define i32 @Open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int is_little_endian() {
  {
    union w {
      int a;
      char b;
    } c;
    c.a = 1;
    return (c.b == 1);
  }
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.w = type { i32 }
define i32 @is_little_endian() {
%1 = alloca %union.w
%2 = bitcast %union.w* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.w* %1 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ delay(unsigned int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ led_high();
int /*<<< orphan*/ led_low();
int main() {
  init();
  while (1) {
    led_high();
    delay(100000U);
    led_low();
    delay(100000U);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1030 <led_high@plt>
mov    $0x186a0,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1050 <led_low@plt>
mov    $0x186a0,%edi
call   1040 <delay@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <led_high@plt>
mov    $0x186a0,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1050 <led_low@plt>
mov    $0x186a0,%edi
call   1040 <delay@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @led_high()
%5 = call i32 @delay(i32 100000)
%6 = call i32 (...) @led_low()
%7 = call i32 @delay(i32 100000)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @led_high()
%4 = tail call i32 @delay(i32 100000)
%5 = tail call i32 (...) @led_low()
%6 = tail call i32 @delay(i32 100000)
br label %2
}
/* Variables and functions */
unsigned long long _blsr_u64(unsigned long long);
unsigned long long func_blsr64_2(unsigned long long X) { return _blsr_u64(X); }


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

x86 assembly (clang, -O2):
<func_blsr64_2>:
jmp    1030 <_blsr_u64@plt>

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

LLVM IR (-O2):
define i64 @func_blsr64_2(i64 %0) {
%2 = tail call i64 @_blsr_u64(i64 %0)
ret i64 %2
}
_Bool mutex_trylock(int *c) {
  _Bool is_locked;
  __CPROVER_atomic_begin();
  is_locked = (*c != 0);
  if (!is_locked) {
    *c = 1;
  }
  __CPROVER_atomic_end();
  return is_locked;
}


x86 assembly (clang, -O0):
<mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__CPROVER_atomic_begin@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
testb  $0x1,-0x9(%rbp)
jne    1156 <mutex_trylock+0x36>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1040 <__CPROVER_atomic_end@plt>
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_trylock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__CPROVER_atomic_begin@plt>
mov    (%rbx),%eax
test   %eax,%eax
jne    1137 <mutex_trylock+0x17>
movl   $0x1,(%rbx)
test   %eax,%eax
setne  %bl
xor    %eax,%eax
call   1040 <__CPROVER_atomic_end@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i1 @mutex_trylock(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i32 (...) @__CPROVER_atomic_begin()
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = trunc i8 %9 to i1
br i1 %10, label %13, label %11
11: ; preds = %1
%12 = load i32*, i32** %2
store i32 1, i32* %12
br label %13
13: ; preds = %11, %1
%14 = call i32 (...) @__CPROVER_atomic_end()
%15 = load i8, i8* %3
%16 = trunc i8 %15 to i1
ret i1 %16
}

LLVM IR (-O2):
define zeroext i1 @mutex_trylock(i32* nocapture %0) {
%2 = tail call i32 (...) @__CPROVER_atomic_begin()
%3 = load i32, i32* %0
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
store i32 1, i32* %0
br label %6
6: ; preds = %5, %1
%7 = tail call i32 (...) @__CPROVER_atomic_end()
ret i1 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x8e() {
  Assert_real((ispunct(142) == 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_ispunct.c",
              715, ("ispunct should be 0 for 0x8e"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x8e>:
push   %rax
mov    $0x8e,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2cb,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8e\00"
define void @t_ispunct_0x8e() {
%1 = call i64 @ispunct(i32 142)
%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 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8e\00"
define void @t_ispunct_0x8e() {
%1 = tail call i64 @ispunct(i32 142)
%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 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("Hello!\n");
  return 0;
}


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)
lea    0xed3(%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 = [8 x i8] c"Hello!\0A\00"
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 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @free_resources_extern() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void whinge_and_die(const char *whinge) {
  fprintf(stderr, "%s\n", whinge);
  abort();
}


x86 assembly (clang, -O0):
<whinge_and_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<whinge_and_die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @whinge_and_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @whinge_and_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gen_immediate2();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_number(int);
void add_offset(int val) {
  gen_immediate2();
  output_number(val);
  newline();
  output_line("add hl,de");
}


x86 assembly (clang, -O0):
<add_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gen_immediate2@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe98(%rip),%rdi
call   1050 <output_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_offset>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <gen_immediate2@plt>
mov    %ebx,%edi
call   1040 <output_number@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xea1(%rip),%rdi
pop    %rbx
jmp    1050 <output_line@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"add hl,de\00"
define void @add_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gen_immediate2()
%4 = load i32, i32* %2
%5 = call i32 @output_number(i32 %4)
%6 = call i32 (...) @newline()
%7 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"add hl,de\00"
define void @add_offset(i32 %0) {
%2 = tail call i32 (...) @gen_immediate2()
%3 = tail call i32 @output_number(i32 %0)
%4 = tail call i32 (...) @newline()
%5 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int fib(int n) {
  if (n < 3) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char const *, char const *, size_t);
size_t strlen(char const *);
int IsThisEntry(const char *line, const char *entry) {
  return (!memcmp(line, entry, strlen(entry)) && line[strlen(entry)] == '=');
}


x86 assembly (clang, -O0):
<IsThisEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1040 <memcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    118e <IsThisEntry+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsThisEntry>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <bcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1156 <IsThisEntry+0x36>
xor    %eax,%eax
cmpb   $0x3d,(%r14,%r15,1)
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @IsThisEntry(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = call i32 @memcmp(i8* %5, i8* %6, i64 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 61
br label %19
19: ; preds = %11, %2
%20 = phi i1 [ false, %2 ], [ %18, %11 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @IsThisEntry(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 61
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(void *, int, int, int /*<<< orphan*/ *);
int Serialize_ReadData(FILE *Stream, void *Data, int Bytes) {
  return fread(Data, 1, Bytes, Stream);
}


x86 assembly (clang, -O0):
<Serialize_ReadData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serialize_ReadData>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

LLVM IR (-O0):
define i32 @Serialize_ReadData(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = call i32 @fread(i8* %7, i32 1, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Serialize_ReadData(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i32* %0)
ret i32 %4
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ activate_task(struct rq *, struct task_struct *, int);
void task_new_rt(struct rq *rq, struct task_struct *p) {
  activate_task(rq, p, 1);
}


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

x86 assembly (clang, -O2):
<task_new_rt>:
mov    $0x1,%edx
jmp    1030 <activate_task@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_new_rt(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
%5 = load %struct.rq*, %struct.rq** %3
%6 = load %struct.task_struct*, %struct.task_struct** %4
%7 = call i32 @activate_task(%struct.rq* %5, %struct.task_struct* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_new_rt(%struct.rq* %0, %struct.task_struct* %1) {
%3 = tail call i32 @activate_task(%struct.rq* %0, %struct.task_struct* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ND_Terminal2_WriteString(char *);
void ND_Keyboard_Handler() { ND_Terminal2_WriteString("Keyboard"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Keyboard\00"
define void @ND_Keyboard_Handler() {
%1 = tail call i32 @ND_Terminal2_WriteString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}