xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strlen(char *);
char toupper(char);
void SU_Make_Uppercase(char *The_String) {
  int i;
  for (i = 0; i < (int)strlen(The_String); i++) {
    The_String[i] = toupper(The_String[i]);
  }
}


x86 assembly (clang, -O0):
<SU_Make_Uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117c <SU_Make_Uppercase+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <SU_Make_Uppercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SU_Make_Uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <SU_Make_Uppercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <SU_Make_Uppercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @SU_Make_Uppercase(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %7
%10 = add nuw nsw i64 %6, 1
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = icmp slt i64 %10, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
uint32_t bitScan_fun_int8_t(int8_t x) {
  uint32_t r = 0;
  int8_t s = (x & 0x80);
  if (x == 0)
    return 7;
  while ((int8_t)((x <<= 1) & 0x80) == s)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <bitScan_fun_int8_t+0x2f>
movl   $0x7,-0x4(%rbp)
jmp    115f <bitScan_fun_int8_t+0x5f>
jmp    1134 <bitScan_fun_int8_t+0x34>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
and    $0x80,%eax
cmp    -0x10(%rbp),%eax
jne    1159 <bitScan_fun_int8_t+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <bitScan_fun_int8_t+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_int8_t>:
test   %edi,%edi
je     111f <bitScan_fun_int8_t+0x1f>
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
mov    %ecx,%edx
xor    %edi,%edx
add    $0x1,%eax
test   $0x80,%dl
je     1110 <bitScan_fun_int8_t+0x10>
ret
mov    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_int8_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = xor i32 %6, %0
%8 = and i32 %7, 128
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %5, 1
br i1 %9, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 7, %1 ], [ %5, %3 ]
ret i32 %12
}
double SIM_power_gatecappass(width, wirelength)
double width;
double wirelength;
{ return (SIM_power_gatecap(width, wirelength)); }


x86 assembly (clang, -O0):
<SIM_power_gatecappass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <SIM_power_gatecap@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_gatecappass>:
push   %rax
mov    $0x2,%al
call   1030 <SIM_power_gatecap@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SIM_power_gatecappass(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double %5, double %6)
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @SIM_power_gatecappass(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double %0, double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
void os_log_close(void *facility) { (void)facility; }


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

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

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

LLVM IR (-O2):
define void @os_log_close(i8* nocapture %0) {
ret void
}
int rdtsc() { __asm__ __volatile__("rdtsc"); }


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

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

LLVM IR (-O0):
define i32 @rdtsc() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @rdtsc() {
tail call void asm sideeffect "rdtsc", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ check_status(char **, int);
int run(char **);
void modprobe(char *name) {
  char *args[] = {"/sbin/modprobe", name, NULL};
  int status;
  status = run(args);
  check_status(args, status);
}


x86 assembly (clang, -O0):
<modprobe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <run@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <check_status@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modprobe>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rax
mov    %rax,(%rsp)
mov    %rdi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <run@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <check_status@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/sbin/modprobe\00"
define void @modprobe(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8*]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %2
store i8* %7, i8** %6
%8 = getelementptr inbounds i8*, i8** %6, i64 1
store i8* null, i8** %8
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%10 = call i32 @run(i8** %9)
store i32 %10, i32* %4
%11 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @check_status(i8** %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/sbin/modprobe\00"
define void @modprobe(i8* %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 1
store i8* %0, i8** %5
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 2
store i8* null, i8** %6
%7 = call i32 @run(i8** %4)
%8 = call i32 @check_status(i8** %4, i32 %7)
ret void
}
int isSeparator(char c) {
  char *separators = "MIDNSHPX=";
  int i;
  for (i = 0; i < 9; i++)
    if (c == separators[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    115d <isSeparator+0x5d>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114a <isSeparator+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <isSeparator+0x64>
jmp    114f <isSeparator+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <isSeparator+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSeparator>:
add    $0xc3,%dil
cmp    $0x1b,%dil
ja     111f <isSeparator+0x1f>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0x84b1881,%edx
bt     %rcx,%rdx
jae    111f <isSeparator+0x1f>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"MIDNSHPX=\00"
define i32 @isSeparator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %11, %17
br i1 %18, label %19, label %20
19: ; preds = %9
store i32 1, i32* %2
br label %25
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isSeparator(i8 signext %0) {
switch i8 %0, label %2 [
i8 77, label %3
i8 73, label %3
i8 68, label %3
i8 78, label %3
i8 83, label %3
i8 72, label %3
i8 80, label %3
i8 88, label %3
i8 61, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int mystrlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void _fail(char *reason) {
  char s[] = "\nfailed: ";
  int len = mystrlen(reason);
  write(1, s, sizeof(s) - 1);
  write(1, reason, len);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mystrlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x12(%rbp),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe8c(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fail>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movabs $0x3a64656c6961660a,%rax
65 64 3a
mov    %rax,0x8(%rsp)
movw   $0x20,0x10(%rsp)
call   1040 <mystrlen@plt>
mov    %eax,%ebp
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <write@plt>
lea    0xe9a(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@__const._fail.s = [10 x i8] c"\0Afailed: \00"
@.str = [2 x i8] c"\0A\00"
define void @_fail(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast [10 x i8]* %3 to i8*
%6 = load i8*, i8** %2
%7 = call i32 @mystrlen(i8* %6)
store i32 %7, i32* %4
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @write(i32 1, i8* %8, i32 9)
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = call i32 @write(i32 1, i8* %10, i32 %11)
%13 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@__const._fail.s = [10 x i8] c"\0Afailed: \00"
@.str = [2 x i8] c"\0A\00"
define void @_fail(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @mystrlen(i8* %0)
%5 = call i32 @write(i32 1, i8* %3, i32 9)
%6 = tail call i32 @write(i32 1, i8* %0, i32 %4)
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int ft_strcmp(const char *s1, const char *s2) {
  while ((unsigned char)*s1 && ((unsigned char)*s1 == (unsigned char)*s2)) {
    s1++;
    s2++;
  }
  return ((unsigned char)*s1 - (unsigned char)*s2);
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <ft_strcmp+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <ft_strcmp+0x47>
jmp    1164 <ft_strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <ft_strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <ft_strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <ft_strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <ft_strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
scalar_t__ malloc(int);
char *allocstr(int n) {
  char *s;
  s = (char *)malloc(n * sizeof(char));
  *s = 0;
  return s;
}


x86 assembly (clang, -O0):
<allocstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocstr>:
push   %rax
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @allocstr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
store i8 0, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @allocstr(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
store i8 0, i8* %3
ret i8* %3
}
/* Variables and functions */
int errno;
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *nptr) {
  int res, tmp;
  tmp = errno;
  res = (int)strtol(nptr, NULL, 10);
  errno = tmp;
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %4
%6 = load i8*, i8** %2
%7 = call i64 @strtol(i8* %6, i32* null, i32 10)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %4
store i32 %9, i32* @errno
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @atoi(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%4 = trunc i64 %3 to i32
store i32 %2, i32* @errno
ret i32 %4
}
void write_u32(unsigned char *dest, unsigned int src) {
  dest[0] = src >> 0;
  dest[1] = src >> 8;
  dest[2] = src >> 16;
  dest[3] = src >> 24;
}


x86 assembly (clang, -O0):
<write_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @write_u32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 0
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 16
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = lshr i32 %20, 24
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @write_u32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
double doublemod(double, double);
double edisrnd(double *r) {
  double value;
  *r = doublemod(*r, 65536.0);
  *r = doublemod((*r) * 2053.0 + 13849.0, 65536.0);
  value = *r / 65536.0;
  return value;
}


x86 assembly (clang, -O0):
<edisrnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <doublemod@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
call   1030 <doublemod@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edisrnd>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <doublemod@plt>
movsd  %xmm0,(%rbx)
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
movsd  0xebf(%rip),%xmm1
call   1030 <doublemod@plt>
movsd  %xmm0,(%rbx)
mulsd  0xec6(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @edisrnd(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = call double @doublemod(double %5, double 6.553600e+04)
%7 = load double*, double** %2
store double %6, double* %7
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = call double @llvm.fmuladd.f64(double %9, double 2.053000e+03, double 1.384900e+04)
%11 = call double @doublemod(double %10, double 6.553600e+04)
%12 = load double*, double** %2
store double %11, double* %12
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = fdiv double %14, 6.553600e+04
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @edisrnd(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @doublemod(double %2, double 6.553600e+04)
store double %3, double* %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double 2.053000e+03, double 1.384900e+04)
%5 = tail call double @doublemod(double %4, double 6.553600e+04)
store double %5, double* %0
%6 = fmul double %5, 0x3EF0000000000000
ret double %6
}
int egsy_gcm_csr_hashout3_set(unsigned int dev_id,
                              union egsy_gcm_csr_hashout3_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_gcm_csr_hashout3_u = type opaque
define i32 @egsy_gcm_csr_hashout3_set(i32 %0, %union.egsy_gcm_csr_hashout3_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_csr_hashout3_u*
store i32 %0, i32* %3
store %union.egsy_gcm_csr_hashout3_u* %1, %union.egsy_gcm_csr_hashout3_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_csr_hashout3_u = type opaque
define i32 @egsy_gcm_csr_hashout3_set(i32 %0, %union.egsy_gcm_csr_hashout3_u* nocapture readnone %1) {
ret i32 1
}
int jit_imm_overflow(struct jit *jit, int signed_op, long value) {
  unsigned long mask = ~((1UL << (31)) - 1);
  unsigned long high_bits = value & mask;
  if (signed_op) {
    if ((high_bits != 0) && (high_bits != mask))
      return 1;
  } else {
    if (high_bits != 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<jit_imm_overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0xffffffff80000000,-0x28(%rbp)
80
mov    -0x20(%rbp),%rax
and    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1157 <jit_imm_overflow+0x57>
cmpq   $0x0,-0x30(%rbp)
je     1152 <jit_imm_overflow+0x52>
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1152 <jit_imm_overflow+0x52>
movl   $0x1,-0x4(%rbp)
jmp    117a <jit_imm_overflow+0x7a>
jmp    1173 <jit_imm_overflow+0x73>
cmpq   $0x0,-0x30(%rbp)
je     116e <jit_imm_overflow+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    117a <jit_imm_overflow+0x7a>
jmp    1173 <jit_imm_overflow+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jit_imm_overflow>:
test   %esi,%esi
je     1114 <jit_imm_overflow+0x14>
movslq %edx,%rcx
mov    $0x1,%eax
cmp    %rdx,%rcx
jne    1113 <jit_imm_overflow+0x13>
xor    %eax,%eax
ret
mov    $0x1,%eax
cmp    $0x7fffffff,%rdx
jbe    1111 <jit_imm_overflow+0x11>
jmp    1113 <jit_imm_overflow+0x13>

LLVM IR (-O0):
%struct.jit = type opaque
define i32 @jit_imm_overflow(%struct.jit* %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.jit*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store %struct.jit* %0, %struct.jit** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 -2147483648, i64* %8
%10 = load i64, i64* %7
%11 = load i64, i64* %8
%12 = and i64 %10, %11
store i64 %12, i64* %9
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %3
%16 = load i64, i64* %9
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = icmp ne i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %4
br label %30
23: ; preds = %18, %15
br label %29
24: ; preds = %3
%25 = load i64, i64* %9
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %4
br label %30
28: ; preds = %24
br label %29
29: ; preds = %28, %23
store i32 0, i32* %4
br label %30
30: ; preds = %29, %27, %22
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
%struct.jit = type opaque
define i32 @jit_imm_overflow(%struct.jit* nocapture readnone %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = add i64 %2, 2147483648
%7 = icmp ult i64 %6, 4294967296
br i1 %7, label %10, label %11
8: ; preds = %3
%9 = icmp ult i64 %2, 2147483648
br i1 %9, label %10, label %11
10: ; preds = %8, %5
br label %11
11: ; preds = %8, %5, %10
%12 = phi i32 [ 0, %10 ], [ 1, %5 ], [ 1, %8 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void *my_alloc(int, int);
void *copy_to_heap(void *data, int size) {
  void *tmp = my_alloc(1, size);
  memcpy(tmp, data, (unsigned int)size);
  return tmp;
}


x86 assembly (clang, -O0):
<copy_to_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <my_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_to_heap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <my_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @copy_to_heap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @my_alloc(i32 1, i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @copy_to_heap(i8* %0, i32 %1) {
%3 = tail call i8* @my_alloc(i32 1, i32 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printLine(int);
int /*<<< orphan*/ printf(char *);
void triangleMake(int magn) {
  for (int l = 1; l <= magn + 1; l++) {
    printLine(l);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<triangleMake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1165 <triangleMake+0x45>
mov    -0x8(%rbp),%edi
call   1040 <printLine@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <triangleMake+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangleMake>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     1164 <triangleMake+0x44>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <printLine@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x2,%eax
jne    1140 <triangleMake+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @triangleMake(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = add i32 %0, 1
br label %6
5: ; preds = %6, %1
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = tail call i32 @printLine(i32 %7)
%9 = tail call i32 @putchar(i32 10)
%10 = add nuw i32 %7, 1
%11 = icmp eq i32 %7, %4
br i1 %11, label %5, label %6
}
long long_fetch_xor_acq_rel(long *ptr, long value) {
  return __atomic_fetch_xor(ptr, value, 4);
}


x86 assembly (clang, -O0):
<long_fetch_xor_acq_rel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
xor    %rsi,%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %rax,-0x40(%rbp)
test   $0x1,%cl
mov    %rax,-0x28(%rbp)
jne    115b <long_fetch_xor_acq_rel+0x5b>
jmp    112b <long_fetch_xor_acq_rel+0x2b>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_fetch_xor_acq_rel>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
xor    %rsi,%rcx
lock cmpxchg %rcx,(%rdi)
jne    1110 <long_fetch_xor_acq_rel+0x10>
ret

LLVM IR (-O0):
define i64 @long_fetch_xor_acq_rel(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw xor i64* %7, i64 %9 acq_rel
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @long_fetch_xor_acq_rel(i64* nocapture %0, i64 %1) {
%3 = atomicrmw xor i64* %0, i64 %1 acq_rel
ret i64 %3
}
void protocol_smtp_free_client_data(struct client *c) {}


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

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

LLVM IR (-O0):
%struct.client = type opaque
define void @protocol_smtp_free_client_data(%struct.client* %0) {
%2 = alloca %struct.client*
store %struct.client* %0, %struct.client** %2
ret void
}

LLVM IR (-O2):
%struct.client = type opaque
define void @protocol_smtp_free_client_data(%struct.client* nocapture %0) {
ret void
}
int test_imm_E4uint16_mem(unsigned short *val) {
  return ((*val) & (0xE4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E4uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 228
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long numanuma__get_mem_size(const int node) { return -1; }


x86 assembly (clang, -O0):
<numanuma__get_mem_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numanuma__get_mem_size>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @numanuma__get_mem_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i64 -1
}

LLVM IR (-O2):
define i64 @numanuma__get_mem_size(i32 %0) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x0e() {
  Assert_real((isascii(14)),
              "/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_isascii.c",
              75, ("isascii should be 1 for 0x0e"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x0e>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x4b,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0e\00"
define void @t_isascii_0x0e() {
%1 = call i32 @isascii(i32 14)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0e\00"
define void @t_isascii_0x0e() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float Cubic__easeIn(float t, float b, float c, float d, float p0, float p1) {
  return c * (t /= d) * t * t + b;
}


x86 assembly (clang, -O0):
<Cubic__easeIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,-0x4(%rbp)
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cubic__easeIn>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Cubic__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = load float, float* %10
%15 = load float, float* %7
%16 = fdiv float %15, %14
store float %16, float* %7
%17 = fmul float %13, %16
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = load float, float* %7
%21 = load float, float* %8
%22 = call float @llvm.fmuladd.f32(float %19, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @Cubic__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fdiv float %0, %3
%8 = fmul float %7, %2
%9 = fmul float %7, %8
%10 = tail call float @llvm.fmuladd.f32(float %9, float %7, float %1)
ret float %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int mac_equal(uint8_t a[6], uint8_t b[6]) { return !memcmp(a, b, 6); }


x86 assembly (clang, -O0):
<mac_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_equal>:
push   %rax
mov    $0x6,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mac_equal(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 = call i32 @memcmp(i32* %5, i32* %6, i32 6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mac_equal(i32* %0, i32* %1) {
%3 = tail call i32 @memcmp(i32* %0, i32* %1, i32 6)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, int, int, int /*<<< orphan*/ *);
size_t read_data(FILE *in, void *buffer) {
  return fread(buffer, 1, 150000, in);
}


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

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

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

LLVM IR (-O2):
define i64 @read_data(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @fread(i8* %1, i32 1, i32 150000, i32* %0)
ret i64 %3
}
/* Variables and functions */
int strlen(char *);
void rstrip(char str[], const char del) {
  int index = strlen(str) - 1;
  while (str[index] == del)
    index--;
  str[index + 1] = 0;
}


x86 assembly (clang, -O0):
<rstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1157 <rstrip+0x47>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <rstrip+0x21>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstrip>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdx
lea    (%rdx,%rbx,1),%rcx
add    $0xffffffffffffffff,%rcx
shl    $0x20,%rdx
movabs $0x100000000,%rax
add    %rdx,%rax
movabs $0xffffffff00000000,%rdx
ff ff ff
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rdx,%rax
lea    -0x1(%rcx),%rsi
cmp    %bpl,(%rcx)
mov    %rsi,%rcx
je     1150 <rstrip+0x40>
sar    $0x20,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rstrip(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ %7, %5 ], [ %4, %2 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
br i1 %10, label %5, label %11
11: ; preds = %5
%12 = shl i64 %6, 32
%13 = ashr exact i64 %12, 32
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret void
}
int test_imm_83int8_reg(signed char val) {
  return ((val) & (-0x83 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_83int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -131
%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_83int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -131
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void _exit() {
  char *buf = "\n\n!!! Exit Processor #0x___ !!!\n";
  unsigned int proc_id = _procid();
  buf[24] = (char)((proc_id >> 8) & 0xF) + 0x30;
  buf[25] = (char)((proc_id >> 4) & 0xF) + 0x30;
  buf[26] = (char)((proc_id >> 0) & 0xF) + 0x30;
  _putk(buf);
  while (1)
    asm volatile("nop");
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_procid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
movsbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x18(%rax)
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
and    $0xf,%eax
movsbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x19(%rax)
mov    -0x14(%rbp),%eax
shr    $0x0,%eax
and    $0xf,%eax
movsbl %al,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1a(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <_putk@plt>
nop
jmp    1193 <_exit+0x73>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
xor    %eax,%eax
call   1030 <_procid@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <_putk@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1140 <_exit+0x20>

LLVM IR (-O0):
@.str = [33 x i8] c"\0A\0A!!! Exit Processorx___ !!!\0A\00"
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = call i32 (...) @_procid()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = lshr i32 %6, 8
%8 = and i32 %7, 15
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 24
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = lshr i32 %15, 4
%17 = and i32 %16, 15
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 25
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = lshr i32 %24, 0
%26 = and i32 %25, 15
%27 = trunc i32 %26 to i8
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, 48
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 26
store i8 %30, i8* %32
%33 = load i8*, i8** %3
%34 = call i32 (i8*, ...) bitcast (i32 (...)* @_putk to i32 (i8*, ...)*)(i8* %33)
br label %35
35: ; preds = %1, %35
br label %35
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A\0A!!! Exit Processorx___ !!!\0A\00"
define void @_exit(i32 %0) {
%2 = tail call i32 (...) @_procid()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @_putk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %1
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %4
}