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

/* Variables and functions */
int prepend_generic_katcp(struct katcp_dispatch *, int);
int prepend_reply_katcp(struct katcp_dispatch *d) {
  return prepend_generic_katcp(d, 1);
}


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

x86 assembly (clang, -O2):
<prepend_reply_katcp>:
mov    $0x1,%esi
jmp    1030 <prepend_generic_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @prepend_reply_katcp(%struct.katcp_dispatch* %0) {
%2 = alloca %struct.katcp_dispatch*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %2
%3 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %2
%4 = call i32 @prepend_generic_katcp(%struct.katcp_dispatch* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @prepend_reply_katcp(%struct.katcp_dispatch* %0) {
%2 = tail call i32 @prepend_generic_katcp(%struct.katcp_dispatch* %0, i32 1)
ret i32 %2
}
/* Type definitions */
struct l_class_OC_Subsmall_X {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ZN10Subsmall_XC2Ev(struct l_class_OC_Subsmall_X *);
void _ZN10Subsmall_XC1Ev(struct l_class_OC_Subsmall_X *llvm_cbe_this) {
  struct l_class_OC_Subsmall_X *llvm_cbe_this_2e_addr;
  struct l_class_OC_Subsmall_X *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZN10Subsmall_XC2Ev(llvm_cbe_this1);
  return;
}


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

x86 assembly (clang, -O2):
<_ZN10Subsmall_XC1Ev>:
jmp    1030 <_ZN10Subsmall_XC2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_Subsmall_X = type { i32 }
define void @_ZN10Subsmall_XC1Ev(%struct.l_class_OC_Subsmall_X* %0) {
%2 = alloca %struct.l_class_OC_Subsmall_X*
%3 = alloca %struct.l_class_OC_Subsmall_X*
%4 = alloca %struct.l_class_OC_Subsmall_X*
store %struct.l_class_OC_Subsmall_X* %0, %struct.l_class_OC_Subsmall_X** %2
%5 = load %struct.l_class_OC_Subsmall_X*, %struct.l_class_OC_Subsmall_X** %2
store %struct.l_class_OC_Subsmall_X* %5, %struct.l_class_OC_Subsmall_X** %3
%6 = load %struct.l_class_OC_Subsmall_X*, %struct.l_class_OC_Subsmall_X** %3
store %struct.l_class_OC_Subsmall_X* %6, %struct.l_class_OC_Subsmall_X** %4
%7 = load %struct.l_class_OC_Subsmall_X*, %struct.l_class_OC_Subsmall_X** %4
%8 = call i32 @_ZN10Subsmall_XC2Ev(%struct.l_class_OC_Subsmall_X* %7)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_Subsmall_X = type { i32 }
define void @_ZN10Subsmall_XC1Ev(%struct.l_class_OC_Subsmall_X* %0) {
%2 = tail call i32 @_ZN10Subsmall_XC2Ev(%struct.l_class_OC_Subsmall_X* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_status(int, char *);
int /*<<< orphan*/ config_uptime(int);
int /*<<< orphan*/ start_route();
int /*<<< orphan*/ system(char *);
void second_session_up(void) {
  start_route();
  config_uptime(1);
  config_status(1, "1");
  system("/sbin/check_route");
}


x86 assembly (clang, -O0):
<second_session_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <start_route@plt>
mov    $0x1,%edi
call   1060 <config_uptime@plt>
mov    $0x1,%edi
lea    0xe9f(%rip),%rsi
call   1040 <config_status@plt>
lea    0xe95(%rip),%rdi
call   1050 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_session_up>:
push   %rax
xor    %eax,%eax
call   1030 <start_route@plt>
mov    $0x1,%edi
call   1060 <config_uptime@plt>
lea    0xea7(%rip),%rsi
mov    $0x1,%edi
call   1040 <config_status@plt>
lea    0xe98(%rip),%rdi
pop    %rax
jmp    1050 <system@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [18 x i8] c"/sbin/check_route\00"
define void @second_session_up() {
%1 = call i32 (...) @start_route()
%2 = call i32 @config_uptime(i32 1)
%3 = call i32 @config_status(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [18 x i8] c"/sbin/check_route\00"
define void @second_session_up() {
%1 = tail call i32 (...) @start_route()
%2 = tail call i32 @config_uptime(i32 1)
%3 = tail call i32 @config_status(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fits_k_bits(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ min_int(int /*<<< orphan*/);
int64_t opposite(int64_t x, uint32_t k, bool *overflow) {
  assert(fits_k_bits(x, k));
  *overflow = (x == min_int(k));
  return -x;
}


x86 assembly (clang, -O0):
<opposite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <fits_k_bits@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <min_int@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opposite>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <fits_k_bits@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    %ebp,%edi
call   1050 <min_int@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,(%r14)
neg    %ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @opposite(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @fits_k_bits(i32 %7, i32 %8)
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @min_int(i32 %12)
%14 = icmp eq i32 %11, %13
%15 = zext i1 %14 to i32
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %4
%18 = sub nsw i32 0, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @opposite(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @fits_k_bits(i32 %0, i32 %1)
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @min_int(i32 %1)
%7 = icmp eq i32 %6, %0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
%9 = sub nsw i32 0, %0
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(void *, char *, int);
int /*<<< orphan*/ printf(char *, short);
int main() {
  void *p = (void *)malloc(sizeof(void) * 10000000);
  char *q = "katrina";
  memcpy(p, q, 10);
  int cnt = 1000000;
  while (1) {
    printf("%c", (short)*(char *)p++);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x989680,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <memcpy@plt>
movl   $0xf4240,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
lea    0xe7a(%rip),%rdi
movswl %ax,%esi
call   1030 <printf@plt>
jmp    1171 <main+0x41>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x989680,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeb8(%rip),%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1040 <memcpy@plt>
lea    0xeac(%rip),%r14
nopl   0x0(%rax)
movsbl (%rbx),%esi
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [8 x i8] c"katrina\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i64 @malloc(i32 10000000)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 10)
store i32 1000000, i32* %4
br label %10
10: ; preds = %0, %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i16
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i16 signext %14)
br label %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"katrina\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 10000000)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @memcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
br label %4
4: ; preds = %4, %0
%5 = phi i8* [ %2, %0 ], [ %6, %4 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i16
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i16 signext %8)
br label %4
}
long adjust_blocks(blocks, fromsize, tosize)
long blocks;
int fromsize, tosize;
{
  if (fromsize == tosize)
    return blocks;
  else if (fromsize > tosize)
    return blocks * (fromsize / tosize);
  else
    return (blocks + 1) / (tosize / fromsize);
}


x86 assembly (clang, -O0):
<adjust_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1127 <adjust_blocks+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <adjust_blocks+0x7d>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1158 <adjust_blocks+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    117d <adjust_blocks+0x7d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_blocks>:
cmp    %edx,%esi
je     113c <adjust_blocks+0x3c>
mov    %edx,%ecx
jle    1117 <adjust_blocks+0x17>
mov    %esi,%eax
cltd
idiv   %ecx
cltq
imul   %rax,%rdi
mov    %rdi,%rax
ret
add    $0x1,%rdi
mov    %ecx,%eax
cltd
idiv   %esi
mov    %eax,%ecx
movslq %eax,%rsi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <adjust_blocks+0x40>
mov    %rdi,%rax
cqto
idiv   %rsi
mov    %rax,%rdi
mov    %rdi,%rax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @adjust_blocks(i64 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = icmp sgt i32 %1, %2
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = sdiv i32 %1, %2
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, %0
br label %16
11: ; preds = %5
%12 = add nsw i64 %0, 1
%13 = sdiv i32 %2, %1
%14 = sext i32 %13 to i64
%15 = sdiv i64 %12, %14
br label %16
16: ; preds = %3, %11, %7
%17 = phi i64 [ %10, %7 ], [ %15, %11 ], [ %0, %3 ]
ret i64 %17
}
int dm_msf_to_lba(int m, int s, int f, int force_positive) {
  long ret = (m * 60 + s);
  ret *= 75;
  ret += f;
  if (m < 90 || force_positive)
    ret -= 150;
  else
    ret -= 450150;
  return ret;
}


x86 assembly (clang, -O0):
<dm_msf_to_lba>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
imul   $0x4b,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x5a,-0x4(%rbp)
jl     1146 <dm_msf_to_lba+0x46>
cmpl   $0x0,-0x10(%rbp)
je     1159 <dm_msf_to_lba+0x59>
mov    -0x18(%rbp),%rax
sub    $0x96,%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <dm_msf_to_lba+0x67>
mov    -0x18(%rbp),%rax
sub    $0x6de66,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_msf_to_lba>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
imul   $0x4b,%eax,%esi
add    %edx,%esi
test   %ecx,%ecx
mov    $0xffffff6a,%ecx
mov    $0xfff9219a,%eax
cmovne %ecx,%eax
cmp    $0x5a,%edi
cmovl  %ecx,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @dm_msf_to_lba(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %0, 60
%6 = add nsw i32 %5, %1
%7 = mul i32 %6, 75
%8 = add i32 %7, %2
%9 = icmp slt i32 %0, 90
%10 = icmp ne i32 %3, 0
%11 = or i1 %9, %10
%12 = select i1 %11, i32 -150, i32 -450150
%13 = add i32 %8, %12
ret i32 %13
}
/* Variables and functions */
int clip23(int);
void clp_v(int *input, int len) {
  for (int i = 0; i < len; i++)
    input[i] = clip23(input[i]);
}


x86 assembly (clang, -O0):
<clp_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <clp_v+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <clip23@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <clp_v+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clp_v>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <clp_v+0x36>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <clip23@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <clp_v+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @clp_v(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 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 i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @clip23(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int test_imm_E7int16_reg(short val) {
  return ((val) & (0xE7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E7int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 231
%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_E7int16_reg(i16 signext %0) {
%2 = and i16 %0, 231
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int avg(int v1, int v2) { return (v1 + v2) / 2; }


x86 assembly (clang, -O0):
<avg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg>:
lea    (%rdi,%rsi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @avg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @avg(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int a[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
long __ocl_convert_long_short_sat(short src) { return src; }


x86 assembly (clang, -O0):
<__ocl_convert_long_short_sat>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswq -0x2(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_long_short_sat>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__ocl_convert_long_short_sat(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @__ocl_convert_long_short_sat(i16 signext %0) {
%2 = sext i16 %0 to i64
ret i64 %2
}
/* Variables and functions */
int foo(int *, int);
int *malloc(int);
int strlen(char *);
int main() {
  int *k = malloc(6);
  int l = foo(k, 8);
  int boo[8];
  int m = boo[l % 2 + 12];
  return m & strlen("");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0xc,%edx
movslq %edx,%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
lea    0xe7d(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
and    %ecx,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x8,%esi
call   1050 <foo@plt>
lea    0xeb1(%rip),%rdi
call   1030 <strlen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [8 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @malloc(i32 6)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 @foo(i32* %7, i32 8)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = srem i32 %9, 2
%11 = add nsw i32 %10, 12
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%17 = and i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32* @malloc(i32 6)
%2 = tail call i32 @foo(i32* %1, i32 8)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  int i;
  for (i = 0; i < 1000000; i += 2)
    ;
  __VERIFIER_assert(i == 1000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1146 <main+0x36>
jmp    1138 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
cmpl   $0xf4240,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CallLib();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("In Main.c\n");
  CallLib();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"In Main.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @CallLib()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void jmp_reg32(unsigned long reg32) {
  put8(0xFF);
  put8(0xE0 + reg32);
}


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

x86 assembly (clang, -O2):
<jmp_reg32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xff,%edi
call   1030 <put8@plt>
add    $0xe0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jmp_reg32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 255)
%4 = load i64, i64* %2
%5 = add i64 224, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @jmp_reg32(i64 %0) {
%2 = tail call i32 @put8(i32 255)
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 224
%5 = tail call i32 @put8(i32 %4)
ret void
}
/* Variables and functions */
int test2(int);
int test3(int);
int test(int i) {
  return test2(i) + test2(i + 1) + test3(i) + test3(i) + test3(i) + test3(i);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <test2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <test2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test3@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test3@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test3@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
call   1040 <test2@plt>
mov    %eax,%r14d
lea    0x1(%r15),%edi
call   1040 <test2@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %r15d,%edi
call   1030 <test3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <test3@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r15d,%edi
call   1030 <test3@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r15d,%edi
call   1030 <test3@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @test2(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @test2(i32 %6)
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = call i32 @test3(i32 %9)
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %2
%13 = call i32 @test3(i32 %12)
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %2
%16 = call i32 @test3(i32 %15)
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %2
%19 = call i32 @test3(i32 %18)
%20 = add nsw i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @test2(i32 %0)
%3 = add nsw i32 %0, 1
%4 = tail call i32 @test2(i32 %3)
%5 = add nsw i32 %4, %2
%6 = tail call i32 @test3(i32 %0)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @test3(i32 %0)
%9 = add nsw i32 %7, %8
%10 = tail call i32 @test3(i32 %0)
%11 = add nsw i32 %9, %10
%12 = tail call i32 @test3(i32 %0)
%13 = add nsw i32 %11, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ucaF(char *);
void ucaF2(char *x) { ucaF(x); }


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

x86 assembly (clang, -O2):
<ucaF2>:
jmp    1030 <ucaF@plt>

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

LLVM IR (-O2):
define void @ucaF2(i8* %0) {
%2 = tail call i32 @ucaF(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x3d() {
  Assert_real((isspace(61) == 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_isspace.c",
              310, ("isspace should be 0 for ="));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x136,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for =\00"
define void @t_isspace_0x3d() {
%1 = call i64 @isspace(i32 61)
%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 310, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for =\00"
define void @t_isspace_0x3d() {
%1 = tail call i64 @isspace(i32 61)
%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 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int data1 = 10;
  int data2 = 20;
  int result;
  __asm__ __volatile__("imull %1, %2\n\t"
                       "movl %2, %0"
                       : "=r"(result)
                       : "r"(data1), "r"(data2));
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %eax,%ecx
mov    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%eax
mov    $0x14,%ecx
imul   %eax,%ecx
mov    %ecx,%esi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm sideeffect "imull $1, $2\0A\09movl $2, $0", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm sideeffect "imull $1, $2\0A\09movl $2, $0", "=r,r,r,~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned long __attribute__((weak)) serial_init(int chan, void *ignored) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i64 @serial_init(i32 %0, i8* %1) {
ret i64 0
}
float repl1(float varx) {
  if (varx < 0.0)
    return 0.0;
  else if (varx > 1.0)
    return 1.0;
  else
    return varx;
}


x86 assembly (clang, -O0):
<repl1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    112c <repl1+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <repl1+0x63>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <repl1+0x59>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <repl1+0x63>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<repl1>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @repl1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %15
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 1.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store float 1.000000e+00, float* %2
br label %15
13: ; preds = %8
%14 = load float, float* %3
store float %14, float* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
define float @repl1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Variables and functions */
scalar_t__ emalloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *int_to_str(int number) {
  char *buff;
  buff = (char *)emalloc(20);
  snprintf(buff, 20, "%i", number);
  return buff;
}


x86 assembly (clang, -O0):
<int_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x14,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x14,%edi
call   1040 <emalloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    $0x14,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i8* @int_to_str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @emalloc(i32 20)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @snprintf(i8* %6, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i8* @int_to_str(i32 %0) {
%2 = tail call i64 @emalloc(i32 20)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @snprintf(i8* %3, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
tolower(c) char c;
{ return ((c >= 'A' && c <= 'Z') ? c + 32 : c); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <tolower+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <tolower+0x33>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <tolower+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
movsbl %dil,%ecx
shl    $0x18,%edi
add    $0xbfffffff,%edi
lea    0x20(%rcx),%eax
cmp    $0x1affffff,%edi
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
br label %18
15: ; preds = %7, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %11
%19 = phi i32 [ %14, %11 ], [ %17, %15 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add i32 %2, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = add nsw i32 %3, 32
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
int test_imm_04int64_midword_reg(long long val) {
  return ((val >> 16) & (0x04 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_04int64_midword_reg(i64 %0) {
%2 = and i64 %0, 262144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CompileString(int /*<<< orphan*/);
void DoCommaQuote(void) { CompileString(0); }


x86 assembly (clang, -O0):
<DoCommaQuote>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <CompileString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCommaQuote>:
xor    %edi,%edi
jmp    1030 <CompileString@plt>

LLVM IR (-O0):
define void @DoCommaQuote() {
%1 = call i32 @CompileString(i32 0)
ret void
}

LLVM IR (-O2):
define void @DoCommaQuote() {
%1 = tail call i32 @CompileString(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  execlp("ls", "ls", "-l", "./", NULL);
  perror("execlp");
  exit(EXIT_FAILURE);
}


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    0xeb3(%rip),%rsi
lea    0xeaf(%rip),%rdx
lea    0xeab(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1050 <execlp@plt>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec4(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %rdi,%rsi
xor    %r8d,%r8d
call   1050 <execlp@plt>
lea    0xeb1(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [3 x i8] c"./\00"
@.str.3 = [7 x i8] c"execlp\00"
@EXIT_FAILURE = global i32 0
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 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* null)
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [3 x i8] c"./\00"
@.str.3 = [7 x i8] c"execlp\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* null)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char string[256];
  printf("Please enter a long string: ");
  fgets(string, 256, stdin);
  printf("You entered a very long string, %s", string);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x100(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1040 <fgets@plt>
lea    -0x100(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <fgets@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Please enter a long string: \00"
@stdin = global i32 0
@.str.1 = [35 x i8] c"You entered a very long string, %s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 256, i32 %4)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Please enter a long string: \00"
@stdin = global i32 0
@.str.1 = [35 x i8] c"You entered a very long string, %s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 256, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) {
  printf("Hello, library world.`\n");
  printf("Hello, this is a security fix.`\n");
}


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

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Hello, library world.`\0A\00"
@.str.1 = [33 x i8] c"Hello, this is a security fix.`\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Hello, library world.`\00"
@str.2 = [32 x i8] c"Hello, this is a security fix.`\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret void
}
void DPMI_SetRealModeVector(int num, unsigned long vector) {}


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

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

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

LLVM IR (-O2):
define void @DPMI_SetRealModeVector(i32 %0, i64 %1) {
ret void
}