xunge/DecIR huggingface dataset:
/* Variables and functions */
void *Cyc_Absyn_compress(void *);
int Cyc_Tcutil_is_cvar_type(void *cv) {
  int *_T0;
  int _T1;
  void *_T2 = Cyc_Absyn_compress(cv);
  _T0 = (int *)_T2;
  _T1 = *_T0;
  if (_T1 != 3)
    goto _TL3A;
  return 1;
_TL3A:
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_is_cvar_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Absyn_compress@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
je     1149 <Cyc_Tcutil_is_cvar_type+0x39>
jmp    1155 <Cyc_Tcutil_is_cvar_type+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <Cyc_Tcutil_is_cvar_type+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_is_cvar_type>:
push   %rax
call   1030 <Cyc_Absyn_compress@plt>
xor    %ecx,%ecx
cmpl   $0x3,(%rax)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cyc_Tcutil_is_cvar_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @Cyc_Absyn_compress(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %16
15: ; preds = %1
br label %17
16: ; preds = %1
store i32 1, i32* %2
br label %18
17: ; preds = %15
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @Cyc_Tcutil_is_cvar_type(i8* %0) {
%2 = tail call i8* @Cyc_Absyn_compress(i8* %0)
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ wait(int);
int main(void) {
  unsigned long i = 0;
  (*(volatile unsigned long *)0x56000010) =
      (1 << (5 * 2)) | (1 << (6 * 2)) | (1 << (7 * 2)) | (1 << (8 * 2));
  while (1) {
    wait(100000);
    (*(volatile unsigned long *)0x56000014) = (~(i << 5));
    if (++i == 16)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x56000010,%eax
movq   $0x15400,(%rax)
mov    $0x186a0,%edi
call   1030 <wait@plt>
mov    -0x10(%rbp),%rcx
shl    $0x5,%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0x56000014,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x10,%rax
jne    116f <main+0x5f>
movq   $0x0,-0x10(%rbp)
jmp    1133 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbx
movq   $0x15400,0x56000010
xor    %ebx,%ebx
nop
mov    $0x186a0,%edi
call   1030 <wait@plt>
mov    %rbx,%rax
shl    $0x5,%rax
not    %rax
mov    %rax,0x56000014
56
add    $0x1,%rbx
cmp    $0x10,%rbx
mov    $0x0,%eax
cmove  %rax,%rbx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store volatile i64 87040, i64* inttoptr (i64 1442840592 to i64*)
br label %3
3: ; preds = %0, %12
%4 = call i32 @wait(i32 100000)
%5 = load i64, i64* %2
%6 = shl i64 %5, 5
%7 = xor i64 %6, -1
store volatile i64 %7, i64* inttoptr (i64 1442840596 to i64*)
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %2
%10 = icmp eq i64 %9, 16
br i1 %10, label %11, label %12
11: ; preds = %3
store i64 0, i64* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 87040, i64* inttoptr (i64 1442840592 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 @wait(i32 100000)
%4 = shl i64 %2, 5
%5 = xor i64 %4, -1
store volatile i64 %5, i64* inttoptr (i64 1442840596 to i64*)
%6 = add i64 %2, 1
%7 = icmp eq i64 %6, 16
%8 = select i1 %7, i64 0, i64 %6
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, ...);
unsigned int strlen(char *);
void checkstrlen(char *s, unsigned len, int lineno) {
  if (strlen(s) > len) {

    ;
    printf("String %s longer than %d chars\n", s, len);
    printf("Please fix config file\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<checkstrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0xc(%rbp),%eax
jbe    117e <checkstrlen+0x4e>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkstrlen>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <strlen@plt>
cmp    %ebp,%eax
ja     1158 <checkstrlen+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"String %s longer than %d chars\0A\00"
@.str.1 = [24 x i8] c"Please fix config file\0A\00"
define void @checkstrlen(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = load i32, i32* %5
%10 = icmp ugt i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"String %s longer than %d chars\0A\00"
@str = [23 x i8] c"Please fix config file\00"
define void @checkstrlen(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp ugt i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %3
ret void
}
void func_exit(void) {
  printf("%s\n", __func__);
  exit(0);
}


x86 assembly (clang, -O0):
<func_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.func_exit = [10 x i8] c"func_exit\00"
define void @func_exit() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_exit, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@__func__.func_exit = [10 x i8] c"func_exit\00"
define void @func_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_exit, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
double if_wrapper(double *arg_list) {
  if ((int)arg_list[0] == 0)
    return arg_list[2];
  return arg_list[1];
}


x86 assembly (clang, -O0):
<if_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvttsd2si (%rax),%eax
cmp    $0x0,%eax
jne    112c <if_wrapper+0x2c>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113a <if_wrapper+0x3a>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_wrapper>:
cvttsd2si (%rdi),%eax
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
movsd  0x8(%rdi,%rcx,8),%xmm0
ret

LLVM IR (-O0):
define double @if_wrapper(double* %0) {
%2 = alloca double
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = fptosi double %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
store double %12, double* %2
br label %17
13: ; preds = %1
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
store double %16, double* %2
br label %17
17: ; preds = %13, %9
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @if_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i64 2, i64 1
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
ret double %7
}
/* Variables and functions */
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, scalar_t__);
char *x_malloc(scalar_t__);
char *copystring(char *string) {
  char *tmp;
  if (string == NULL) {
    return NULL;
  }
  tmp = x_malloc(strlen(string) + 1);
  strncpy(tmp, string, strlen(string) + 1);
  return tmp;
}


x86 assembly (clang, -O0):
<copystring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <copystring+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a2 <copystring+0x72>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <x_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystring>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1166 <copystring+0x36>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <x_malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
jmp    1169 <copystring+0x39>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @copystring(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @x_malloc(i64 %5)
%7 = tail call i64 @strlen(i8* %0)
%8 = add nsw i64 %7, 1
%9 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %8)
br label %10
10: ; preds = %1, %3
%11 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ RangefinderDistanceHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void RangefinderDistanceRequestUpdate() {
  UAVObjRequestUpdate(RangefinderDistanceHandle());
}


x86 assembly (clang, -O0):
<RangefinderDistanceRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <RangefinderDistanceHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RangefinderDistanceRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <RangefinderDistanceHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @RangefinderDistanceRequestUpdate() {
%1 = call i32 (...) @RangefinderDistanceHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RangefinderDistanceRequestUpdate() {
%1 = tail call i32 (...) @RangefinderDistanceHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xc2() {
  Assert_real((isgraph(194) == 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_isgraph.c",
              975, ("isgraph should be 0 for 0xc2"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xc2>:
push   %rax
mov    $0xc2,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3cf,%edx
pop    %rax
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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xc2\00"
define void @t_isgraph_0xc2() {
%1 = call i64 @isgraph(i32 194)
%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 975, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xc2\00"
define void @t_isgraph_0xc2() {
%1 = tail call i64 @isgraph(i32 194)
%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 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct unsafevm {
  int dummy;
};

/* Variables and functions */
struct unsafevm *mkuvm_stacksz(int);
struct unsafevm *mkuvm() {
  return mkuvm_stacksz(1024 * 1024);
}


x86 assembly (clang, -O0):
<mkuvm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100000,%edi
call   1030 <mkuvm_stacksz@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkuvm>:
mov    $0x100000,%edi
jmp    1030 <mkuvm_stacksz@plt>

LLVM IR (-O0):
%struct.unsafevm = type { i32 }
define %struct.unsafevm* @mkuvm() {
%1 = call %struct.unsafevm* @mkuvm_stacksz(i32 1048576)
ret %struct.unsafevm* %1
}

LLVM IR (-O2):
%struct.unsafevm = type { i32 }
define %struct.unsafevm* @mkuvm() {
%1 = tail call %struct.unsafevm* @mkuvm_stacksz(i32 1048576)
ret %struct.unsafevm* %1
}
/* Variables and functions */
char getchar();
void ReadStr(char *str) {
  for (;;) {
    char c = getchar();
    if (c == '\n')
      break;
    *str = c;
    str++;
  }
}


x86 assembly (clang, -O0):
<ReadStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1138 <ReadStr+0x28>
jmp    1152 <ReadStr+0x42>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ReadStr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadStr>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1133 <ReadStr+0x23>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    1120 <ReadStr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ReadStr(i8* nocapture writeonly %0) {
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *mpgedit_indexfile_open(char *name, char *mode) {
  FILE *fp = NULL;
  if (name && mode) {
    fp = fopen(name, mode);
  }
  return fp;
}


x86 assembly (clang, -O0):
<mpgedit_indexfile_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <mpgedit_indexfile_open+0x3f>
cmpq   $0x0,-0x10(%rbp)
je     114f <mpgedit_indexfile_open+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpgedit_indexfile_open>:
test   %rdi,%rdi
je     111f <mpgedit_indexfile_open+0xf>
test   %rsi,%rsi
je     111f <mpgedit_indexfile_open+0xf>
jmp    1030 <fopen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i32* @mpgedit_indexfile_open(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32* @fopen(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %2
%9 = phi i32* [ %7, %6 ], [ null, %2 ]
ret i32* %9
}
void rop3_179_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_179_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_179_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_179_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_179_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DecodeEaD_xxxxdddxssmmmrrr();
int /*<<< orphan*/ DoCompare(int /*<<< orphan*/);
void DoCodeCmp(void) { DoCompare(DecodeEaD_xxxxdddxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeCmp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodeEaD_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
call   1040 <DoCompare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeCmp>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeEaD_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoCompare@plt>

LLVM IR (-O0):
define void @DoCodeCmp() {
%1 = call i32 (...) @DecodeEaD_xxxxdddxssmmmrrr()
%2 = call i32 @DoCompare(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeCmp() {
%1 = tail call i32 (...) @DecodeEaD_xxxxdddxssmmmrrr()
%2 = tail call i32 @DoCompare(i32 %1)
ret void
}
int relay_upgrade_save_clients(struct t_upgrade_file *upgrade_file) {
  (void)upgrade_file;
  return 1;
}


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

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

LLVM IR (-O0):
%struct.t_upgrade_file = type opaque
define i32 @relay_upgrade_save_clients(%struct.t_upgrade_file* %0) {
%2 = alloca %struct.t_upgrade_file*
store %struct.t_upgrade_file* %0, %struct.t_upgrade_file** %2
%3 = load %struct.t_upgrade_file*, %struct.t_upgrade_file** %2
ret i32 1
}

LLVM IR (-O2):
%struct.t_upgrade_file = type opaque
define i32 @relay_upgrade_save_clients(%struct.t_upgrade_file* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
scalar_t__ GetBit(unsigned char, unsigned char);
unsigned char IsButtonPressed(unsigned char x, unsigned char k) {
  return GetBit(x, k) == 0;
}


x86 assembly (clang, -O0):
<IsButtonPressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <GetBit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsButtonPressed>:
push   %rax
call   1030 <GetBit@plt>
test   %rax,%rax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @IsButtonPressed(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i64 @GetBit(i8 zeroext %5, i8 zeroext %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @IsButtonPressed(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i64 @GetBit(i8 zeroext %0, i8 zeroext %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ email;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char email[512] = {0};
  int count = 0;
  int i;
  int alpha;
  int flag = 1;
  printf("enter email:");
  fgets(email, sizeof(email), stdin);
  printf("|%s|", email);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x200(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
movl   $0x0,-0x204(%rbp)
movl   $0x1,-0x210(%rbp)
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x200(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1050 <fgets@plt>
lea    -0x200(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"enter email:\00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"|%s|\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [512 x i8]* %1 to i8*
store i32 0, i32* %2
store i32 1, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 512, i32 %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"enter email:\00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"|%s|\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 512, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ russian_recursive(int, int);
int main(void) {
  printf("4 * 2: %lld\n", russian_recursive(4, 2));
  printf("16 * 42: %lld\n", russian_recursive(16, 42));
  printf("999 * 999: %lld\n", russian_recursive(999, 999));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <russian_recursive@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x10,%edi
mov    $0x2a,%esi
call   1030 <russian_recursive@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e7,%esi
mov    %esi,%edi
call   1030 <russian_recursive@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <russian_recursive@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x10,%edi
mov    $0x2a,%esi
call   1030 <russian_recursive@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3e7,%edi
mov    $0x3e7,%esi
call   1030 <russian_recursive@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"4 * 2: %lld\0A\00"
@.str.1 = [15 x i8] c"16 * 42: %lld\0A\00"
@.str.2 = [17 x i8] c"999 * 999: %lld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @russian_recursive(i32 4, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @russian_recursive(i32 16, i32 42)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @russian_recursive(i32 999, i32 999)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"4 * 2: %lld\0A\00"
@.str.1 = [15 x i8] c"16 * 42: %lld\0A\00"
@.str.2 = [17 x i8] c"999 * 999: %lld\0A\00"
define i32 @main() {
%1 = tail call i32 @russian_recursive(i32 4, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @russian_recursive(i32 16, i32 42)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @russian_recursive(i32 999, i32 999)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
double fabs(float);
int i(float x) { return fabs(x) == -0.0; }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
push   %rax
call   1030 <fabs@plt>
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @fabs(float %3)
%5 = fcmp oeq double %4, -0.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @i(float %0) {
%2 = tail call double @fabs(float %0)
%3 = fcmp oeq double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _MP_IndexMasterPage(size_t);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t _MP_IndexMasterPage_Size(size_t idx) {
  assert(_MP_IndexMasterPage(idx));
  return (idx < 8) ? 1 : 8;
}


x86 assembly (clang, -O0):
<_MP_IndexMasterPage_Size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_MP_IndexMasterPage@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdx
mov    $0x8,%eax
mov    $0x1,%ecx
cmp    $0x8,%rdx
cmovb  %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MP_IndexMasterPage_Size>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_MP_IndexMasterPage@plt>
mov    %eax,%edi
call   1030 <assert@plt>
cmp    $0x8,%rbx
mov    $0x1,%ecx
mov    $0x8,%eax
cmovb  %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @_MP_IndexMasterPage_Size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_MP_IndexMasterPage(i64 %3)
%5 = call i32 @assert(i32 %4)
%6 = load i64, i64* %2
%7 = icmp ult i64 %6, 8
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @_MP_IndexMasterPage_Size(i64 %0) {
%2 = tail call i32 @_MP_IndexMasterPage(i64 %0)
%3 = tail call i32 @assert(i32 %2)
%4 = icmp ult i64 %0, 8
%5 = select i1 %4, i64 1, i64 8
ret i64 %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t swap_int64(int64_t val) {
  val = ((val << 8) & 0xFF00FF00FF00FF00ULL) |
        ((val >> 8) & 0x00FF00FF00FF00FFULL);
  val = ((val << 16) & 0xFFFF0000FFFF0000ULL) |
        ((val >> 16) & 0x0000FFFF0000FFFFULL);
  return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL);
}


x86 assembly (clang, -O0):
<swap_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
cltq
movabs $0xff00ff00ff00ff00,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00ff00ff00ff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
cltq
movabs $0xffff0000ffff0000,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
movabs $0xffff0000ffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
cltq
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movabs $0xffffffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap_int64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = sext i32 %4 to i64
%6 = and i64 %5, -71777214294589696
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71777214294589695
%11 = or i64 %6, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = sext i32 %14 to i64
%16 = and i64 %15, -281470681808896
%17 = load i32, i32* %2
%18 = ashr i32 %17, 16
%19 = sext i32 %18 to i64
%20 = and i64 %19, 281470681808895
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = shl i32 %23, 32
%25 = sext i32 %24 to i64
%26 = load i32, i32* %2
%27 = ashr i32 %26, 32
%28 = sext i32 %27 to i64
%29 = and i64 %28, 4294967295
%30 = or i64 %25, %29
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @swap_int64(i32 %0) {
ret i32 poison
}
int get_cpu_count(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_cpu_count() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_cpu_count() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *str) {
  char const *ptr = str;
  while (*ptr != '\0')
    ++ptr;
  write(1, str, ptr - str);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <ft_putstr+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ft_putstr+0x14>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = tail call i32 @write(i32 1, i8* %0, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(void const *, void *, int);
void *malloc(int);
void *y_memdup(const void *addr, int n) {
  void *new_chunk = malloc(n);
  if (new_chunk) {
    bcopy((addr), (new_chunk), (n));
  }
  return new_chunk;
}


x86 assembly (clang, -O0):
<y_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <y_memdup+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <bcopy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <y_memdup+0x28>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @y_memdup(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* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = load i32, i32* %4
%14 = call i32 @bcopy(i8* %11, i8* %12, i32 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @y_memdup(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %3, i8* align 1 %0, i32 %1, i1 false)
br label %6
6: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xa4() {
  Assert_real((isupper(164) == 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_isupper.c",
              825, ("isupper should be 0 for 0xa4"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x339,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xa4\00"
define void @t_isupper_0xa4() {
%1 = call i64 @isupper(i32 164)
%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 825, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xa4\00"
define void @t_isupper_0xa4() {
%1 = tail call i64 @isupper(i32 164)
%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 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double kernel__Float___45d(double self, double p0) {
  double var;
  double var1;
  var1 = self - p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<kernel__Float___45d>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @kernel__Float___45d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
store double %10, double* %5
br label %11
11: ; preds = %2
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @kernel__Float___45d(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
int trans_2_y(int x, int y) { return x; }


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

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

LLVM IR (-O0):
define i32 @trans_2_y(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @trans_2_y(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int futimens(int, char const *, struct timespec const *);
int utimens(char const *file, struct timespec const timespec[2]) {
  return futimens(-1, file, timespec);
}


x86 assembly (clang, -O0):
<utimens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
call   1030 <futimens@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utimens>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <futimens@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @utimens(i8* %0, %struct.timespec* %1) {
%3 = alloca i8*
%4 = alloca %struct.timespec*
store i8* %0, i8** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i8*, i8** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @futimens(i32 -1, i8* %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @utimens(i8* %0, %struct.timespec* %1) {
%3 = tail call i32 @futimens(i32 -1, i8* %0, %struct.timespec* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void element_output_non_element(char *s, FILE *output_file) {
  fprintf(output_file, "<td>%s", s);
  fprintf(output_file, "</td>\n");
}


x86 assembly (clang, -O0):
<element_output_non_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_output_non_element>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec8(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<td>%s\00"
@.str.1 = [7 x i8] c"</td>\0A\00"
define void @element_output_non_element(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 = load i8*, i8** %3
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<td>%s\00"
@.str.1 = [7 x i8] c"</td>\0A\00"
define void @element_output_non_element(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 6, i64 1, i32* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ cos_t(scalar_t__);
int32_t sin_t(int32_t x) { return cos_t(x - 512); }


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

x86 assembly (clang, -O2):
<sin_t>:
add    $0xfffffffffffffe00,%rdi
jmp    1030 <cos_t@plt>

LLVM IR (-O0):
define i64 @sin_t(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 512
%5 = call i64 @cos_t(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @sin_t(i64 %0) {
%2 = add nsw i64 %0, -512
%3 = tail call i64 @cos_t(i64 %2)
ret i64 %3
}
/* Variables and functions */
int lengthOfLastWord(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char s[] = "   asddf...,   ";
  int ret = lengthOfLastWord(s);
  printf("%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <lengthOfLastWord@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <lengthOfLastWord@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [16 x i8] c" asddf..., \00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [16 x i8]* %6 to i8*
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%10 = call i32 @lengthOfLastWord(i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [16 x i8] c" asddf..., \00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @lengthOfLastWord(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}