xunge/DecIR huggingface dataset:
int qsort_cmp_char(const void *x, const void *y) {
  if (*((char *)x) < *((char *)y))
    return (-1);
  else
    return (*((char *)x) > *((char *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <qsort_cmp_char+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <qsort_cmp_char+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_char>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
double potential(double r) { return 1.0 / r; }


x86 assembly (clang, -O0):
<potential>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<potential>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @potential(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @potential(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int, unsigned int);
int shim_pidfd_getfd(int pidfd, int targetfd, unsigned int flags) {
  return shim_enosys(0, pidfd, targetfd, flags);
}


x86 assembly (clang, -O0):
<shim_pidfd_getfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_pidfd_getfd>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_pidfd_getfd(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 = load i32, i32* %6
%10 = call i32 @shim_enosys(i32 0, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @shim_pidfd_getfd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int main(void) {
  0 < 2;
  2.0 < 5.0;
  "a" < "b";
  'B' < 'b';
  0 > 2;
  2.0 > 5.0;
  "a" > "b";
  'B' > 'b';
  0 <= 2;
  2.0 <= 5.0;
  "a" <= "b";
  'B' <= 'b';
  0 >= 2;
  2.0 >= 5.0;
  "a" >= "b";
  'B' >= 'b';
  0 == 2;
  2.0 == 5.0;
  "a" == "b";
  'B' == 'b';
  0 == 2;
  2.0 == 5.0;
  "a" == "b";
  'B' == 'b';
  0 != 2;
  2.0 != 5.0;
  "a" != "b";
  'B' != 'b';
  0 + 2;
  2.0 + 5.0;
  'B' + 'b';
  0 / 2;
  2.0 / 5.0;
  'B' / 'b';
  0 * 2;
  2.0 * 5.0;
  'B' * 'b';
  0 % 2;
  'B' % 'b';
  1 || 2;
  0 || 0;
  5 || 5;
  5 || 5 || 6 && 0;
  5 && 4 || 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void EPIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000210))) &= ~ui32IntFlags;
}


x86 assembly (clang, -O0):
<EPIIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x210(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x210(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x210(%rcx)
ret

LLVM IR (-O0):
define void @EPIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 528
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @EPIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add i64 %7, 528
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
int /*<<< orphan*/ *authunix_create_default();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int test_status = 1;
  AUTH *authUnx = NULL;
  authUnx = authunix_create_default();
  test_status = ((AUTH *)authUnx != NULL) ? 0 : 1;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <authunix_create_default@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <authunix_create_default@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32* null, i32** %3
%4 = call i32* (...) @authunix_create_default()
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* (...) @authunix_create_default()
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
/* Type definitions */
struct flag {
  int dummy;
};
struct copt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ copt_register_option(struct copt *, struct flag *);
struct flag *new_str_flag(char const *);
void copt_str_option(struct copt *slf, const char *optstr) {
  struct flag *f = new_str_flag(optstr);
  copt_register_option(slf, f);
}


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

x86 assembly (clang, -O2):
<copt_str_option>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <new_str_flag@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <copt_register_option@plt>

LLVM IR (-O0):
%struct.copt = type { i32 }
%struct.flag = type { i32 }
define void @copt_str_option(%struct.copt* %0, i8* %1) {
%3 = alloca %struct.copt*
%4 = alloca i8*
%5 = alloca %struct.flag*
store %struct.copt* %0, %struct.copt** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call %struct.flag* @new_str_flag(i8* %6)
store %struct.flag* %7, %struct.flag** %5
%8 = load %struct.copt*, %struct.copt** %3
%9 = load %struct.flag*, %struct.flag** %5
%10 = call i32 @copt_register_option(%struct.copt* %8, %struct.flag* %9)
ret void
}

LLVM IR (-O2):
%struct.copt = type { i32 }
%struct.flag = type { i32 }
define void @copt_str_option(%struct.copt* %0, i8* %1) {
%3 = tail call %struct.flag* @new_str_flag(i8* %1)
%4 = tail call i32 @copt_register_option(%struct.copt* %0, %struct.flag* %3)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int height(struct node *);
int /*<<< orphan*/ printlevelorder(struct node *, int);
void printlevel(struct node *root) {
  int h = height(root);
  int i;
  for (i = 1; i <= h; i++) {
    printlevelorder(root, i);
  }
}


x86 assembly (clang, -O0):
<printlevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <height@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1165 <printlevel+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <printlevelorder@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <printlevel+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlevel>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <height@plt>
test   %eax,%eax
jle    115d <printlevel+0x3d>
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printlevelorder@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <printlevel+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @printlevel(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca i32
%4 = alloca i32
store %struct.node* %0, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @height(%struct.node* %5)
store i32 %6, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load %struct.node*, %struct.node** %2
%13 = load i32, i32* %4
%14 = call i32 @printlevelorder(%struct.node* %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @printlevel(%struct.node* %0) {
%2 = tail call i32 @height(%struct.node* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 @printlevelorder(%struct.node* %0, i32 %5)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, GitHub!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello, GitHub!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
scalar_t__ iswalpha(scalar_t__);
void skip_alpha(wchar_t **text) {
  while (**text && iswalpha(**text))
    (*text)++;
}


x86 assembly (clang, -O0):
<skip_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
je     114b <skip_alpha+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <iswalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115b <skip_alpha+0x4b>
jmp    116e <skip_alpha+0x5e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_alpha+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_alpha>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     113d <skip_alpha+0x2d>
nop
call   1030 <iswalpha@plt>
test   %rax,%rax
je     113d <skip_alpha+0x2d>
mov    (%rbx),%rax
lea    0x8(%rax),%rcx
mov    %rcx,(%rbx)
mov    0x8(%rax),%rdi
test   %rdi,%rdi
jne    1120 <skip_alpha+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skip_alpha(i64** nocapture %0) {
%2 = load i64*, i64** %0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i64 [ %12, %9 ], [ %3, %1 ]
%7 = tail call i64 @iswalpha(i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load i64*, i64** %0
%11 = getelementptr inbounds i64, i64* %10, i64 1
store i64* %11, i64** %0
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sync();
int main() {
  sync();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sync@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sync@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sync()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sync()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x15() {
  Assert_real((isalnum(21) == 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_isalnum.c",
              110, ("isalnum should be 0 for 0x15"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x6e,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x15\00"
define void @t_isalnum_0x15() {
%1 = call i64 @isalnum(i32 21)
%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 110, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x15\00"
define void @t_isalnum_0x15() {
%1 = tail call i64 @isalnum(i32 21)
%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 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void Reshape(int width, int height) { glViewport(0, 0, width, height); }


x86 assembly (clang, -O0):
<Reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reshape>:
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <glViewport@plt>

LLVM IR (-O0):
define void @Reshape(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @Reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
ret void
}
double f4_sum_double_post_double(double v, double v0) {
  return v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_double_post_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_double_post_double>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f4_sum_double_post_double(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
void sort(struct list **head) {}


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

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

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

LLVM IR (-O2):
%struct.list = type opaque
define void @sort(%struct.list** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wait(int);
int main(int argc, char **argv) {
  int pid;
  int child_pid;
  for (;;) {
    sleep(1);
    child_pid = fork();
    if (child_pid > 0) {
      wait(child_pid);
    } else if (child_pid == 0) {
      printf("Child Running\n\0");
      exit(1);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1191 <main+0x41>
mov    -0x18(%rbp),%edi
call   1060 <wait@plt>
jmp    11b6 <main+0x66>
cmpl   $0x0,-0x18(%rbp)
jne    11b1 <main+0x61>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
jmp    11b6 <main+0x66>
jmp    1166 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1167 <main+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1060 <wait@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
jg     1160 <main+0x10>
jne    1167 <main+0x17>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Child Running\0A\00\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %23, %2
%9 = call i32 @sleep(i32 1)
%10 = call i32 (...) @fork()
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %7
%15 = call i32 @wait(i32 %14)
br label %23
16: ; preds = %8
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %16
br label %23
23: ; preds = %22, %13
br label %8
}

LLVM IR (-O2):
@str = [14 x i8] c"Child Running\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %11, %2
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 (...) @fork()
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @wait(i32 %5)
br label %11
9: ; preds = %3
%10 = icmp eq i32 %5, 0
br i1 %10, label %12, label %11
11: ; preds = %9, %7
br label %3
12: ; preds = %9
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ cosl(long double);
int /*<<< orphan*/ link_failure_cosl();
void test_cosl(long double ld) {
  if (cosl(ld) != cosl(ld))
    link_failure_cosl();
}


x86 assembly (clang, -O0):
<test_cosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cosl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_cosl+0x43>
mov    $0x0,%al
call   1040 <link_failure_cosl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cosl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <cosl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <cosl@plt>
cmp    %rax,%rbx
jne    1151 <test_cosl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_cosl@plt>

LLVM IR (-O0):
define void @test_cosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @cosl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @cosl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_cosl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_cosl(x86_fp80 %0) {
%2 = tail call i64 @cosl(x86_fp80 %0)
%3 = tail call i64 @cosl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cosl()
br label %7
7: ; preds = %5, %1
ret void
}
int base64_decode_length(const int len) { return (len * 6 + 7) / 8; }


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

x86 assembly (clang, -O2):
<base64_decode_length>:
add    %edi,%edi
lea    (%rdi,%rdi,2),%ecx
add    $0x7,%ecx
lea    (%rdi,%rdi,2),%eax
add    $0xe,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @base64_decode_length(i32 %0) {
%2 = mul nsw i32 %0, 6
%3 = add nsw i32 %2, 7
%4 = sdiv i32 %3, 8
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double rand_norm();
double sample_exp();
double sample_gauss();
double sample_sum3(void) {
  return (sample_exp() + sample_gauss() +
          (2.0 * rand_norm() - 1.0) * pow(1.5, 1.0 / 3.0)) /
         3.0;
}


x86 assembly (clang, -O0):
<sample_sum3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <sample_exp@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <sample_gauss@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand_norm@plt>
addsd  %xmm0,%xmm0
movsd  0xe99(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe78(%rip),%xmm0
movsd  0xe78(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_sum3>:
push   %rax
xor    %eax,%eax
call   1050 <sample_exp@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <sample_gauss@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rand_norm@plt>
addsd  %xmm0,%xmm0
addsd  0xe9f(%rip),%xmm0
mulsd  0xe9f(%rip),%xmm0
addsd  (%rsp),%xmm0
divsd  0xe9a(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sample_sum3() {
%1 = call double (...) @sample_exp()
%2 = call double (...) @sample_gauss()
%3 = fadd double %1, %2
%4 = call double (...) @rand_norm()
%5 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %4, double -1.000000e+00)
%6 = call double @pow(double 1.500000e+00, double 0x3FD5555555555555)
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double %3)
%8 = fdiv double %7, 3.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @sample_sum3() {
%1 = tail call double (...) @sample_exp()
%2 = tail call double (...) @sample_gauss()
%3 = fadd double %1, %2
%4 = tail call double (...) @rand_norm()
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double -1.000000e+00)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FF250BFE1B082F5, double %3)
%7 = fdiv double %6, 3.000000e+00
ret double %7
}
/* Type definitions */
struct ringbuffer {
  int dummy;
};

/* Variables and functions */
int rb_recvfrom(int, struct ringbuffer *, int /*<<< orphan*/ *);
int rb_read(int fd, struct ringbuffer *rb) {
  if (!rb) {
    return -1;
  }
  return rb_recvfrom(fd, rb, NULL);
}


x86 assembly (clang, -O0):
<rb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <rb_read+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <rb_read+0x39>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <rb_recvfrom@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_read>:
test   %rsi,%rsi
je     111c <rb_read+0xc>
xor    %edx,%edx
jmp    1030 <rb_recvfrom@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.ringbuffer = type { i32 }
define i32 @rb_read(i32 %0, %struct.ringbuffer* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ringbuffer*
store i32 %0, i32* %4
store %struct.ringbuffer* %1, %struct.ringbuffer** %5
%6 = load %struct.ringbuffer*, %struct.ringbuffer** %5
%7 = icmp ne %struct.ringbuffer* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load %struct.ringbuffer*, %struct.ringbuffer** %5
%12 = call i32 @rb_recvfrom(i32 %10, %struct.ringbuffer* %11, i32* null)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.ringbuffer = type { i32 }
define i32 @rb_read(i32 %0, %struct.ringbuffer* %1) {
%3 = icmp eq %struct.ringbuffer* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @rb_recvfrom(i32 %0, %struct.ringbuffer* %1, i32* null)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ isgraph(char);
char _ch(char c) {
  if (isgraph(c))
    return c;
  return '.';
}


x86 assembly (clang, -O0):
<_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%rax
je     113c <_ch+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1140 <_ch+0x30>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ch>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @_ch(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isgraph(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* %3
store i8 %8, i8* %2
br label %10
9: ; preds = %1
store i8 46, i8* %2
br label %10
10: ; preds = %9, %7
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @_ch(i8 signext %0) {
%2 = tail call i64 @isgraph(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8 46, i8 %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PutInteger(int x) { printf("%d\n", x); }


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

x86 assembly (clang, -O2):
<PutInteger>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @PutInteger(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned int, char const *);
void __assert(const char *function, const char *file, unsigned int line,
              const char *assertion) {
  printf("ASSERT: %s <%d> : %s\n\r", function, line, assertion);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    113e <__assert+0x2e>

x86 assembly (clang, -O2):
<__assert>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <__assert+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"ASSERT: %s <%d> : %s\0A\0D\00"
define void @__assert(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11)
br label %13
13: ; preds = %4, %13
br label %13
}

LLVM IR (-O2):
@.str = [23 x i8] c"ASSERT: %s <%d> : %s\0A\0D\00"
define void @__assert(i8* %0, i8* nocapture readnone %1, i32 %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %3)
br label %6
6: ; preds = %4, %6
br label %6
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
ssize_t clampss(ssize_t v, ssize_t min, ssize_t max) {
  if (v < min) {
    return min;
  } else if (v > max) {
    return max;
  }
  return v;
}


x86 assembly (clang, -O0):
<clampss>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <clampss+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <clampss+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <clampss+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <clampss+0x53>
jmp    114b <clampss+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampss>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clampss(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
void int_timer_display(void) {}


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

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

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

LLVM IR (-O2):
define void @int_timer_display() {
ret void
}
int ft_isalpha(int c) {
  if ((c > 64 && c < 91) || (c > 96 && c < 123))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jle    111b <ft_isalpha+0x1b>
cmpl   $0x5b,-0x8(%rbp)
jl     112f <ft_isalpha+0x2f>
cmpl   $0x60,-0x8(%rbp)
jle    113b <ft_isalpha+0x3b>
cmpl   $0x7b,-0x8(%rbp)
jge    113b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 64
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 91
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 96
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 123
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *dummy_thread_func(void *arg) { pthread_exit(NULL); }


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

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

LLVM IR (-O0):
define i8* @dummy_thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @pthread_exit(i32* null)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @dummy_thread_func(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t min_u64(uint64_t a, uint64_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_u64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_u64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_u64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min_u64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_u64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
signed int rt_mutex_destroy(union anon$40 *mp) {
  signed int status = 0;
  status = pthread_mutex_destroy(mp);
  return status;
}


x86 assembly (clang, -O0):
<rt_mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%"union.anon$40" = type opaque
define i32 @rt_mutex_destroy(%"union.anon$40"* %0) {
%2 = alloca %"union.anon$40"*
%3 = alloca i32
store %"union.anon$40"* %0, %"union.anon$40"** %2
store i32 0, i32* %3
%4 = load %"union.anon$40"*, %"union.anon$40"** %2
%5 = call i32 (%"union.anon$40"*, ...) bitcast (i32 (...)* @pthread_mutex_destroy to i32 (%"union.anon$40"*, ...)*)(%"union.anon$40"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%"union.anon$40" = type opaque
define i32 @rt_mutex_destroy(%"union.anon$40"* %0) {
%2 = tail call i32 (%"union.anon$40"*, ...) bitcast (i32 (...)* @pthread_mutex_destroy to i32 (%"union.anon$40"*, ...)*)(%"union.anon$40"* %0)
ret i32 %2
}
void putdmv(dmv) int dmv;
{
  if (dmv == 0)
    putbits(0, 1);
  else if (dmv > 0)
    putbits(2, 2);
  else
    putbits(3, 2);
}


x86 assembly (clang, -O0):
<putdmv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <putdmv+0x28>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <putbits@plt>
jmp    116b <putdmv+0x5b>
cmpl   $0x0,-0x4(%rbp)
jle    1155 <putdmv+0x45>
mov    $0x2,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <putbits@plt>
jmp    1166 <putdmv+0x56>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <putbits@plt>
jmp    116b <putdmv+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putdmv>:
test   %edi,%edi
je     111d <putdmv+0xd>
jle    112b <putdmv+0x1b>
mov    $0x2,%edi
jmp    1130 <putdmv+0x20>
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <putbits@plt>
mov    $0x3,%edi
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <putbits@plt>

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

LLVM IR (-O2):
define void @putdmv(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 0, i32 1)
br label %11
5: ; preds = %1
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 2, i32 2)
br label %11
9: ; preds = %5
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 3, i32 2)
br label %11
11: ; preds = %7, %9, %3
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int gcd(int, int);
uint64_t lcm(uint64_t dividend, uint64_t divisor) {
  uint64_t valGcd;
  valGcd = gcd(dividend, divisor);
  if (valGcd < 0)
    return -1;
  return (dividend * divisor / valGcd);
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1142 <lcm+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <lcm+0x40>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <gcd@plt>
test   %eax,%eax
js     112c <lcm+0x1c>
mov    %eax,%ecx
imul   %ebp,%ebx
mov    %ebx,%eax
cltd
idiv   %ecx
jmp    1131 <lcm+0x21>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = tail call i32 @gcd(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = mul nsw i32 %1, %0
%7 = sdiv i32 %6, %3
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ chk_curs();
scalar_t__ chk_term();
int /*<<< orphan*/ curs_endwin();
int /*<<< orphan*/ curs_refresh();
int /*<<< orphan*/ dis_term();
void reset_scrn(void) {
  while (chk_term())
    dis_term();
  curs_refresh();
  while (chk_curs()) {
    curs_endwin();
  }
}


x86 assembly (clang, -O0):
<reset_scrn>:
push   %rbp
mov    %rsp,%rbp
jmp    1159 <reset_scrn+0x9>
mov    $0x0,%al
call   1070 <chk_term@plt>
cmp    $0x0,%rax
je     1176 <reset_scrn+0x26>
mov    $0x0,%al
call   1030 <dis_term@plt>
jmp    1159 <reset_scrn+0x9>
mov    $0x0,%al
call   1060 <curs_refresh@plt>
mov    $0x0,%al
call   1040 <chk_curs@plt>
cmp    $0x0,%rax
je     119a <reset_scrn+0x4a>
mov    $0x0,%al
call   1050 <curs_endwin@plt>
jmp    117d <reset_scrn+0x2d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_scrn>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <chk_term@plt>
test   %rax,%rax
je     1175 <reset_scrn+0x25>
xor    %eax,%eax
call   1030 <dis_term@plt>
jmp    1160 <reset_scrn+0x10>
xor    %eax,%eax
call   1060 <curs_refresh@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <chk_curs@plt>
test   %rax,%rax
je     1195 <reset_scrn+0x45>
xor    %eax,%eax
call   1050 <curs_endwin@plt>
jmp    1180 <reset_scrn+0x30>
pop    %rax
ret

LLVM IR (-O0):
define void @reset_scrn() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @chk_term()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @dis_term()
br label %1
6: ; preds = %1
%7 = call i32 (...) @curs_refresh()
br label %8
8: ; preds = %11, %6
%9 = call i64 (...) @chk_curs()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @curs_endwin()
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @reset_scrn() {
%1 = tail call i64 (...) @chk_term()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @dis_term()
%5 = tail call i64 (...) @chk_term()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
%8 = tail call i32 (...) @curs_refresh()
%9 = tail call i64 (...) @chk_curs()
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7, %11
%12 = tail call i32 (...) @curs_endwin()
%13 = tail call i64 (...) @chk_curs()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %11
15: ; preds = %11, %7
ret void
}
char *func(void *p) { return (char *)p; }


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

x86 assembly (clang, -O2):
<func>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @func(i8* readnone returned %0) {
ret i8* %0
}