xunge/DecIR huggingface dataset:
/* Type definitions */
struct prb_table {
  int dummy;
};

/* Variables and functions */
void **prb_probe(struct prb_table *, void *);
void *prb_insert(struct prb_table *table, void *item) {
  void **p = prb_probe(table, item);
  return p == NULL || *p == item ? NULL : *p;
}


x86 assembly (clang, -O0):
<prb_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <prb_probe@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <prb_insert+0x3d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    1158 <prb_insert+0x48>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1163 <prb_insert+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prb_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <prb_probe@plt>
test   %rax,%rax
je     112c <prb_insert+0x1c>
mov    (%rax),%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
cmovne %rcx,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.prb_table = type { i32 }
define i8* @prb_insert(%struct.prb_table* %0, i8* %1) {
%3 = alloca %struct.prb_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.prb_table* %0, %struct.prb_table** %3
store i8* %1, i8** %4
%6 = load %struct.prb_table*, %struct.prb_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @prb_probe(%struct.prb_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp eq i8** %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11, %2
br label %20
17: ; preds = %11
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
br label %20
20: ; preds = %17, %16
%21 = phi i8* [ null, %16 ], [ %19, %17 ]
ret i8* %21
}

LLVM IR (-O2):
%struct.prb_table = type { i32 }
define i8* @prb_insert(%struct.prb_table* %0, i8* %1) {
%3 = tail call i8** @prb_probe(%struct.prb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = select i1 %7, i8* null, i8* %6
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ null, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int nvme_verify_chr(int);
int nvme_reset_controller(int fd) {
  int ret;
  ret = nvme_verify_chr(fd);
  if (ret)
    return ret;
  return ioctl(fd, _IO('N', 0x44));
}


x86 assembly (clang, -O0):
<nvme_reset_controller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <nvme_verify_chr@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <nvme_reset_controller+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <nvme_reset_controller+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x4e,%edi
mov    $0x44,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_reset_controller>:
push   %rbx
mov    %edi,%ebx
call   1050 <nvme_verify_chr@plt>
test   %eax,%eax
je     113e <nvme_reset_controller+0xe>
pop    %rbx
ret
mov    $0x4e,%edi
mov    $0x44,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @nvme_reset_controller(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @nvme_verify_chr(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @_IO(i8 signext 78, i32 68)
%14 = call i32 @ioctl(i32 %12, i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @nvme_reset_controller(i32 %0) {
%2 = tail call i32 @nvme_verify_chr(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @_IO(i8 signext 78, i32 68)
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ %2, %1 ]
ret i32 %8
}
int fchar_Hash(void *elem, int nrelem) {
  long long int sum = 1;
  int x;
  for (x = 0; ((char *)elem)[x] != '\0'; x++) {
    sum = sum * 2 + ((char *)elem)[x];
  }
  return sum % nrelem;
}


x86 assembly (clang, -O0):
<fchar_Hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <fchar_Hash+0x59>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <fchar_Hash+0x1a>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchar_Hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <fchar_Hash+0x25>
add    $0x1,%rdi
mov    $0x1,%eax
nop
movsbq %cl,%rcx
lea    (%rcx,%rax,2),%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fchar_Hash+0x10>
jmp    112a <fchar_Hash+0x2a>
mov    $0x1,%eax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1142 <fchar_Hash+0x42>
cqto
idiv   %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @fchar_Hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i64 1, i64* %5
store i32 0, i32* %6
br label %7
7: ; preds = %25, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %7
%16 = load i64, i64* %5
%17 = mul nsw i64 %16, 2
%18 = load i8*, i8** %3
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i64
%24 = add nsw i64 %17, %23
store i64 %24, i64* %5
br label %25
25: ; preds = %15
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %7
28: ; preds = %7
%29 = load i64, i64* %5
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = srem i64 %29, %31
%33 = trunc i64 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @fchar_Hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i64 [ %11, %5 ], [ 1, %2 ]
%9 = shl nsw i64 %8, 1
%10 = sext i8 %7 to i64
%11 = add nsw i64 %9, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i64 [ 1, %2 ], [ %11, %5 ]
%18 = sext i32 %1 to i64
%19 = srem i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}
unsigned char CalculateNmeaCheckSum(char *NmeaSentence) {
  int Index;
  unsigned char NmeaCheckSum = 0;
  for (Index = 1; NmeaSentence[Index] != '*'; Index++) {
    NmeaCheckSum ^= NmeaSentence[Index];
  }
  return NmeaCheckSum;
}


x86 assembly (clang, -O0):
<CalculateNmeaCheckSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0xd(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
je     114b <CalculateNmeaCheckSum+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movzbl -0xd(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <CalculateNmeaCheckSum+0x13>
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateNmeaCheckSum>:
mov    0x1(%rdi),%cl
cmp    $0x2a,%cl
jne    110b <CalculateNmeaCheckSum+0xb>
xor    %eax,%eax
ret
add    $0x2,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %cl,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x2a,%cl
jne    1120 <CalculateNmeaCheckSum+0x20>
ret

LLVM IR (-O0):
define zeroext i8 @CalculateNmeaCheckSum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %4
store i32 1, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 42
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = xor i32 %21, %19
%23 = trunc i32 %22 to i8
store i8 %23, i8* %4
br label %24
24: ; preds = %13
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i8, i8* %4
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @CalculateNmeaCheckSum(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 42
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 1, %1 ]
%7 = phi i8 [ %12, %5 ], [ %3, %1 ]
%8 = phi i8 [ %9, %5 ], [ 0, %1 ]
%9 = xor i8 %7, %8
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 42
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i8 [ 0, %1 ], [ %9, %5 ]
ret i8 %15
}
int foo_func(int x) { return x + 1; }


x86 assembly (clang, -O0):
<foo_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_func>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo_func(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int execute_timer_delete() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_timer_delete() {
ret i32 0
}
int test_imm_13uint16_reg(unsigned short val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_13uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 19
%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_13uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 19
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((no, noclone)) unsigned __int128 t102_5mul(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(-3), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t102_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3,%ecx
mov    %rcx,-0x60(%rbp)
mul    %rcx
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
seto   %sil
mov    %sil,-0x49(%rbp)
mul    %rdx
mov    %rax,%rsi
mov    -0x49(%rbp),%al
mov    %rsi,-0x48(%rbp)
mov    %rdx,%rsi
mov    -0x48(%rbp),%rdx
add    %rcx,%rsi
setb   %cl
or     %cl,%al
mov    %rdx,%rcx
or     %rsi,%rcx
setne  %cl
or     %cl,%al
xor    %ecx,%ecx
neg    %rdx
sbb    %rsi,%rcx
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    119f <t102_5mul+0x8f>
jmp    11a6 <t102_5mul+0x96>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t102_5mul>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffffffffffd,%rcx
mov    %rdi,%rax
mul    %rcx
mov    %rax,%r14
mov    %rdx,%rbx
sub    %rdi,%rbx
lea    (%rsi,%rsi,2),%rax
sub    %rax,%rbx
or     %rsi,%rdi
je     113d <t102_5mul+0x2d>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t102_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 3, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ne i128 %14, 0
%16 = and i1 true, %15
%17 = or i1 %13, %16
%18 = sub i128 0, %14
%19 = select i1 true, i128 %18, i128 %14
store i128 %19, i128* %6
br i1 %17, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t102_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = mul i128 %6, -3
%8 = icmp eq i128 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 (...) @bar()
br label %11
11: ; preds = %9, %2
%12 = trunc i128 %7 to i64
%13 = lshr i128 %7, 64
%14 = trunc i128 %13 to i64
%15 = insertvalue { i64, i64 } poison, i64 %12, 0
%16 = insertvalue { i64, i64 } %15, i64 %14, 1
ret { i64, i64 } %16
}
__typeof__(isxdigit("")) test_isxdigit_68(void) { return isxdigit(""); }


x86 assembly (clang, -O0):
<test_isxdigit_68>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isxdigit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isxdigit_68() {
%1 = call i32 @isxdigit(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isxdigit_68() {
%1 = tail call i32 @isxdigit(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, size_t const);
void *malloc(size_t const);
void *xmalloc(register const size_t size) {
  register void *value = malloc(size);
  if (!value)
    error(3, errno, "can't allocate %zi bytes of memory!", size);
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <xmalloc+0x42>
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    $0x3,%edi
lea    0xea3(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <xmalloc+0x31>
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdx
mov    $0x3,%edi
mov    %r14,%rcx
call   1040 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [36 x i8] c"can't allocate %zi bytes of memory!\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = load i64, i64* %2
%11 = call i32 @error(i32 3, i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [36 x i8] c"can't allocate %zi bytes of memory!\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @error(i32 3, i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
signed int unsigned_int_to_signed_int(unsigned int src) { return src; }


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

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

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

LLVM IR (-O2):
define i32 @unsigned_int_to_signed_int(i32 returned %0) {
ret i32 %0
}
void _mesa_init_all_ppc_transform_asm(void) {}


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

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

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

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

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int countchar(FILE *in) {
  int count = 0;
  char ch;
  while ((ch = fgetc(in)) != EOF) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xd(%rbp)
movsbl %al,%eax
mov    0x2eaf(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1152 <countchar+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <countchar+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countchar>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2ec4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    (%r15),%al
jne    1130 <countchar+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @countchar(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32*, i32** %2
%7 = call signext i8 @fgetc(i32* %6)
store i8 %7, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @countchar(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = load i8, i8* @EOF
%6 = icmp eq i8 %4, %5
%7 = add nuw nsw i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int PAPI_unlock(int);
void papif_unlock_(int *lock, int *check) { *check = PAPI_unlock(*lock); }


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

x86 assembly (clang, -O2):
<papif_unlock_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_unlock@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_unlock_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_unlock(i32 %3)
store i32 %4, i32* %1
ret void
}
void relay_config_change_network_ssl_priorities(
    const void *pointer, void *data, struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type opaque
define void @relay_config_change_network_ssl_priorities(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type opaque
define void @relay_config_change_network_ssl_priorities(i8* nocapture %0, i8* nocapture %1, %struct.t_config_option* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int foo(int a) {
  printf("%d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
char fudgef(char b) {
  static int c;
  if (!b)
    return b;
  if (++c & 0x1f)
    return b;
  b |= 1;
  if (b > 2)
    b -= 2;
  return b;
}


x86 assembly (clang, -O0):
<fudgef>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
jne    111f <fudgef+0x1f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    116c <fudgef+0x6c>
mov    0x2eff(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef6(%rip)
and    $0x1f,%eax
cmp    $0x0,%eax
je     1145 <fudgef+0x45>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    116c <fudgef+0x6c>
movsbl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2,%eax
jle    1166 <fudgef+0x66>
movsbl -0x2(%rbp),%eax
sub    $0x2,%eax
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fudgef>:
mov    %edi,%eax
test   %al,%al
je     111b <fudgef+0x1b>
mov    0x2f18(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
test   $0x1f,%cl
je     111e <fudgef+0x1e>
ret
xor    %eax,%eax
ret
or     $0x1,%al
lea    -0x2(%rax),%ecx
cmp    $0x3,%al
movzbl %al,%edx
movzbl %cl,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
@fudgef.c = internal global i32 0
define signext i8 @fudgef(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = load i8, i8* %3
store i8 %7, i8* %2
br label %30
8: ; preds = %1
%9 = load i32, i32* @fudgef.c
%10 = add nsw i32 %9, 1
store i32 %10, i32* @fudgef.c
%11 = and i32 %10, 31
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %30
15: ; preds = %8
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = or i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sgt i32 %21, 2
br i1 %22, label %23, label %28
23: ; preds = %15
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 2
%27 = trunc i32 %26 to i8
store i8 %27, i8* %3
br label %28
28: ; preds = %23, %15
%29 = load i8, i8* %3
store i8 %29, i8* %2
br label %30
30: ; preds = %28, %13, %6
%31 = load i8, i8* %2
ret i8 %31
}

LLVM IR (-O2):
@fudgef.c = internal unnamed_addr global i32 0
define signext i8 @fudgef(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i32, i32* @fudgef.c
%5 = add nsw i32 %4, 1
store i32 %5, i32* @fudgef.c
%6 = and i32 %5, 31
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = or i8 %0, 1
%10 = icmp sgt i8 %9, 2
%11 = add i8 %9, -2
%12 = select i1 %10, i8 %11, i8 %9
br label %13
13: ; preds = %3, %1, %8
%14 = phi i8 [ %12, %8 ], [ 0, %1 ], [ %0, %3 ]
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sig_usr1(int signo) {
  fprintf(stderr, "SHOULD NOT BE HERE (SIGUSR1)!!!!\n");
  return;
}


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

x86 assembly (clang, -O2):
<sig_usr1>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"SHOULD NOT BE HERE (SIGUSR1)!!!!\0A\00"
define void @sig_usr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"SHOULD NOT BE HERE (SIGUSR1)!!!!\0A\00"
define void @sig_usr1(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x46() {
  Assert_real((islower(70) == 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_islower.c",
              355, ("islower should be 0 for F"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x46>:
push   %rax
mov    $0x46,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x163,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for F\00"
define void @t_islower_0x46() {
%1 = call i64 @islower(i32 70)
%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 355, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for F\00"
define void @t_islower_0x46() {
%1 = tail call i64 @islower(i32 70)
%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 355, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int number(char token[]) {
  int i;
  sscanf(token, "%d", &i);
  return i;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @number(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void m_free(char *t) { printf("%p\n", t); }


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

x86 assembly (clang, -O2):
<m_free>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define void @m_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @m_free(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ test_file_lock(int, int /*<<< orphan*/);
pid_t is_write_lock_blocked(int fd) { return (test_file_lock(fd, F_WRLCK)); }


x86 assembly (clang, -O0):
<is_write_lock_blocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <test_file_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_write_lock_blocked>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <test_file_lock@plt>

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

LLVM IR (-O2):
@F_WRLCK = global i32 0
define i32 @is_write_lock_blocked(i32 %0) {
%2 = load i32, i32* @F_WRLCK
%3 = tail call i32 @test_file_lock(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int foo();
int main() { return foo() - 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
sub    $0x2a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0xffffffd6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = sub nsw i32 %2, 42
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = add nsw i32 %1, -42
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long wcstol(const wchar_t *nptr, wchar_t **endptr, int base) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<wcstol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @wcstol(i32* %0, i32** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%7 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @wcstol(i32* nocapture readnone %0, i32** nocapture readnone %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ckd_free_3d(void ***ptr) {
  {
    free(*(*(ptr + 0) + 0));
    free((void *)*(ptr + 0));
    free((void *)ptr);
    return;
  }
}


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

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

LLVM IR (-O0):
define void @ckd_free_3d(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = getelementptr inbounds i8**, i8*** %3, i64 0
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8***, i8**** %2
%10 = getelementptr inbounds i8**, i8*** %9, i64 0
%11 = load i8**, i8*** %10
%12 = bitcast i8** %11 to i8*
%13 = call i32 @free(i8* %12)
%14 = load i8***, i8**** %2
%15 = bitcast i8*** %14 to i8*
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @ckd_free_3d(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast i8*** %0 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
%8 = bitcast i8*** %0 to i8*
%9 = tail call i32 @free(i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int ej4() {
  int num1, num2, ina, inb;
  printf("Ingrese dos número enteros: \n");
  scanf("%d%d", &num1, &num2);
  ina = num1 & num2;
  inb = num1 | num2;
  printf("Inciso a: %d \nInciso b: %d\n", ina, inb);
  return 0;
}


x86 assembly (clang, -O0):
<ej4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ej4>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
mov    %edx,%esi
and    %eax,%esi
or     %eax,%edx
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Ingrese dos n\C3\BAmero enteros: \0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [28 x i8] c"Inciso a: %d \0AInciso b: %d\0A\00"
define i32 @ej4() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = and i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = or i32 %10, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [28 x i8] c"Inciso a: %d \0AInciso b: %d\0A\00"
@str = [30 x i8] c"Ingrese dos n\C3\BAmero enteros: \00"
define i32 @ej4() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = and i32 %8, %7
%10 = or i32 %8, %7
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
void reverse(char *str, int len) {
  int j = len - 1, i = 0;
  while (i < j) {
    char c = str[i];
    str[i] = str[j];
    str[j] = c;
    i++;
    j--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1170 <reverse+0x70>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <reverse+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    $0x2,%esi
jl     1131 <reverse+0x31>
mov    %esi,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define void @reverse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %14, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %7
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %3
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 %24, i8* %28
%29 = load i8, i8* %7
%30 = load i8*, i8** %3
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 %29, i8* %33
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
%36 = load i32, i32* %5
%37 = add nsw i32 %36, -1
store i32 %37, i32* %5
br label %10
38: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = phi i64 [ %6, %4 ], [ %15, %7 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = add nuw nsw i64 %8, 1
%15 = add nsw i64 %9, -1
%16 = icmp slt i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ strchr(char *, int);
int isfname(int c) {
  return ((isalnum(c) || (c && strchr(".,'+- ()[]!&_", c))));
}


x86 assembly (clang, -O0):
<isfname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1173 <isfname+0x53>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
je     116d <isfname+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%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):
<isfname>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isfname+0x17>
pop    %rbx
ret
test   %ebx,%ebx
je     1156 <isfname+0x36>
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c".,'+- ()[]!&_\00"
define i32 @isfname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i64 @strchr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br label %15
15: ; preds = %13, %1
%16 = phi i1 [ true, %1 ], [ %14, %13 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c".,'+- ()[]!&_\00"
define i32 @isfname(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = icmp eq i32 %0, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i64 @strchr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6, %1
%11 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}
int do_578() { return 578; }


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

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

LLVM IR (-O0):
define i32 @do_578() {
ret i32 578
}

LLVM IR (-O2):
define i32 @do_578() {
ret i32 578
}
/* Variables and functions */
scalar_t__ hdp_get_nearest_bitrate(float const);
int hdp_get_nearest_delay(const float delay) {
  return (int)hdp_get_nearest_bitrate(delay);
}


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

x86 assembly (clang, -O2):
<hdp_get_nearest_delay>:
jmp    1030 <hdp_get_nearest_bitrate@plt>

LLVM IR (-O0):
define i32 @hdp_get_nearest_delay(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @hdp_get_nearest_bitrate(float %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hdp_get_nearest_delay(float %0) {
%2 = tail call i64 @hdp_get_nearest_bitrate(float %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
struct convexFigList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ convexFigListRm(struct convexFigList **);
void convexFigListDestroy(struct convexFigList **pList) {
  while (*pList)
    convexFigListRm(pList);
}


x86 assembly (clang, -O0):
<convexFigListDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1138 <convexFigListDestroy+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <convexFigListRm@plt>
jmp    111c <convexFigListDestroy+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convexFigListDestroy>:
push   %rbx
cmpq   $0x0,(%rdi)
je     112e <convexFigListDestroy+0x1e>
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <convexFigListRm@plt>
cmpq   $0x0,(%rbx)
jne    1120 <convexFigListDestroy+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.convexFigList = type { i32 }
define void @convexFigListDestroy(%struct.convexFigList** %0) {
%2 = alloca %struct.convexFigList**
store %struct.convexFigList** %0, %struct.convexFigList*** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.convexFigList**, %struct.convexFigList*** %2
%5 = load %struct.convexFigList*, %struct.convexFigList** %4
%6 = icmp ne %struct.convexFigList* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load %struct.convexFigList**, %struct.convexFigList*** %2
%9 = call i32 @convexFigListRm(%struct.convexFigList** %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.convexFigList = type { i32 }
define void @convexFigListDestroy(%struct.convexFigList** %0) {
%2 = load %struct.convexFigList*, %struct.convexFigList** %0
%3 = icmp eq %struct.convexFigList* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @convexFigListRm(%struct.convexFigList** %0)
%6 = load %struct.convexFigList*, %struct.convexFigList** %0
%7 = icmp eq %struct.convexFigList* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}