xunge/DecIR huggingface dataset:
void vec_zero(double z[], int n) {
  int i;
  for (i = 0; i < n; i++)
    z[i] = 0.0;
}


x86 assembly (clang, -O0):
<vec_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <vec_zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <vec_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_zero>:
test   %esi,%esi
jle    1126 <vec_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @vec_zero(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @vec_zero(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
int __attribute__((weak)) _fork() { return -1; }


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

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

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

LLVM IR (-O2):
define weak i32 @_fork() {
ret i32 -1
}
/* Variables and functions */
int execve(char const *, char const **, char **);
int execle(const char *_path, const char *_arg, ...) {
  char **p;
  p = (char **)&_arg;
  while (*p++)
    ;
  return (execve(_path, &_arg, (char **)*p));
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,(%rax)
je     1146 <execle+0x36>
jmp    1128 <execle+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    -0x10(%rbp),%rsi
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    %rsi,(%rsp)
test   %rsi,%rsi
je     113f <execle+0x2f>
lea    0x10(%rsp),%rax
xor    %ecx,%ecx
test   %cl,%cl
je     1130 <execle+0x20>
mov    %rax,%rcx
jmp    1144 <execle+0x34>
nopw   0x0(%rax,%rax,1)
lea    0x8(%rax),%rcx
cmpq   $0x0,(%rax)
mov    %rcx,%rax
jne    1130 <execle+0x20>
jmp    1144 <execle+0x34>
lea    0x8(%rsp),%rcx
mov    (%rcx),%rdx
mov    %rsp,%rsi
call   1030 <execve@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = icmp eq i8* %1, null
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %3, i64 2
br i1 undef, label %13, label %8
8: ; preds = %6, %8
%9 = phi i8** [ %11, %8 ], [ %7, %6 ]
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = icmp eq i8* %10, null
br i1 %12, label %13, label %8
13: ; preds = %8, %6, %2
%14 = phi i8** [ %4, %2 ], [ %7, %6 ], [ %11, %8 ]
%15 = bitcast i8** %14 to i8***
%16 = load i8**, i8*** %15
%17 = call i32 @execve(i8* %0, i8** %3, i8** %16)
ret i32 %17
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char ch = getchar();
  switch (ch) {
  case 'A':
    break;
  default:
    break;
  }
  char str[10];
  char *test = "hello";
  strcpy(str, test);
  switch (str[0]) {
  case 'h':
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
sub    $0x41,%al
jne    114e <main+0x2e>
jmp    1149 <main+0x29>
jmp    1153 <main+0x33>
jmp    1153 <main+0x33>
lea    0xea6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0xf(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0xf(%rbp),%al
sub    $0x68,%al
jne    1180 <main+0x60>
jmp    117b <main+0x5b>
jmp    1185 <main+0x65>
jmp    1185 <main+0x65>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xece(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [10 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
switch i32 %7, label %9 [
i32 65, label %8
]
8: ; preds = %0
br label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %8
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %4
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %18 [
i32 104, label %17
]
17: ; preds = %10
br label %19
18: ; preds = %10
br label %19
19: ; preds = %18, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = tail call signext i8 (...) @getchar()
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int powr(int base, int exp) {
  int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp /= 2;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<powr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1151 <powr+0x51>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <powr+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <powr+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powr>:
test   %esi,%esi
je     1142 <powr+0x42>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
imul   %edi,%edi
add    $0x1,%esi
cmp    $0x2,%esi
mov    %edx,%esi
ja     1120 <powr+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @powr(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = sdiv i32 %6, 2
%13 = mul nsw i32 %7, %7
%14 = add i32 %6, 1
%15 = icmp ult i32 %14, 3
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double strtod(char *, int /*<<< orphan*/ *);
int main(void) {
  char ns[] = "-.0987654321";
  printf("string:\n\tns = [%s]\n", ns);
  printf("double:\n\tns = [%.10f]\n", strtod(ns, NULL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x11(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x31323334353637,%rax
mov    %rax,0x5(%rsp)
movabs $0x3536373839302e2d,%rax
37 36 35
mov    %rax,(%rsp)
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.ns = [13 x i8] c"-.0987654321\00"
@.str = [20 x i8] c"string:\0A\09ns = [%s]\0A\00"
@.str.1 = [23 x i8] c"double:\0A\09ns = [%.10f]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = bitcast [13 x i8]* %2 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = call double @strtod(i8* %6, i32* null)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ns = [13 x i8] c"-.0987654321\00"
@.str = [20 x i8] c"string:\0A\09ns = [%s]\0A\00"
@.str.1 = [23 x i8] c"double:\0A\09ns = [%.10f]\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call double @strtod(i8* nocapture %2, i32* null)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
struct word_list_struct {
  int dummy;
};
struct line_list_struct {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct word_list_struct *convert_lines_to_words(struct line_list_struct *);
int /*<<< orphan*/ free(struct line_list_struct *);
struct line_list_struct *read_the_lines(int /*<<< orphan*/ *, int *);
struct word_list_struct *read_a_paragraph(FILE *input_file, int *file_done) {
  struct line_list_struct *line_list;
  struct word_list_struct *result;
  line_list = read_the_lines(input_file, file_done);
  result = convert_lines_to_words(line_list);
  free(line_list);
  return (result);
}


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

x86 assembly (clang, -O2):
<read_a_paragraph>:
push   %r14
push   %rbx
push   %rax
call   1040 <read_the_lines@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <convert_lines_to_words@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.word_list_struct = type { i32 }
%struct.line_list_struct = type { i32 }
define %struct.word_list_struct* @read_a_paragraph(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.line_list_struct*
%6 = alloca %struct.word_list_struct*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call %struct.line_list_struct* @read_the_lines(i32* %7, i32* %8)
store %struct.line_list_struct* %9, %struct.line_list_struct** %5
%10 = load %struct.line_list_struct*, %struct.line_list_struct** %5
%11 = call %struct.word_list_struct* @convert_lines_to_words(%struct.line_list_struct* %10)
store %struct.word_list_struct* %11, %struct.word_list_struct** %6
%12 = load %struct.line_list_struct*, %struct.line_list_struct** %5
%13 = call i32 @free(%struct.line_list_struct* %12)
%14 = load %struct.word_list_struct*, %struct.word_list_struct** %6
ret %struct.word_list_struct* %14
}

LLVM IR (-O2):
%struct.word_list_struct = type { i32 }
%struct.line_list_struct = type { i32 }
define %struct.word_list_struct* @read_a_paragraph(i32* %0, i32* %1) {
%3 = tail call %struct.line_list_struct* @read_the_lines(i32* %0, i32* %1)
%4 = tail call %struct.word_list_struct* @convert_lines_to_words(%struct.line_list_struct* %3)
%5 = tail call i32 @free(%struct.line_list_struct* %3)
ret %struct.word_list_struct* %4
}
int shmobile_suspend_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @shmobile_suspend_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rdvl_sve();
int main(void) {
  int vl = rdvl_sve();
  printf("%d\n", vl);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rdvl_sve()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int array_sortCondition(char key, int valueA, int valueB) {
  if (key == 'r') {
    return valueA > valueB;
  } else {
    return valueA < valueB;
  }
}


x86 assembly (clang, -O0):
<array_sortCondition>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x72,%eax
jne    1133 <array_sortCondition+0x33>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <array_sortCondition+0x44>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_sortCondition>:
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%esi
setg   %al
setl   %cl
cmp    $0x72,%dil
cmove  %eax,%ecx
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @array_sortCondition(i8 signext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 114
%5 = icmp sgt i32 %1, %2
%6 = icmp slt i32 %1, %2
%7 = select i1 %4, i1 %5, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
reg0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (r0 <= (*((double *)(11111111 & ~(__alignof__(double) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    $0xa98ac0,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1140 <reg0adr1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <reg0adr1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adr1>:
movsd  0xa98ac0,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @reg0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* %8
%15 = load double, double* inttoptr (i64 11111104 to double*)
%16 = fcmp ole double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @reg0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 11111104 to double*)
%8 = fcmp oge double %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
void t1(int len) { __asm__ volatile("" : "=&r"(len), "+&r"(len)); }


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

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

LLVM IR (-O0):
define void @t1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call { i32, i32 } asm sideeffect "", "=&r,=&r,1,~{dirflag},~{fpsr},~{flags}"(i32 %3)
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %2
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @t1(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "", "=&r,=&r,1,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
signed short _sshort(signed short x) { return x; }


x86 assembly (clang, -O0):
<_sshort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @_sshort(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void sigalint(int dummy) {
  (void)dummy;
  printf("\n:-: %s Interrupt ): ..%s\n", "\e[31m", "\e[0m");
  exit(1);
}


x86 assembly (clang, -O0):
<sigalint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigalint>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xeeb(%rip),%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\0A:-: %s Interrupt ): ..%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @sigalint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A:-: %s Interrupt ): ..%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @sigalint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x3a() {
  Assert_real((isprint(58)),
              "/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_isprint.c",
              295, ("isprint should be 1 for :"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x3a>:
push   %rax
mov    $0x3a,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x127,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for :\00"
define void @t_isprint_0x3a() {
%1 = call i32 @isprint(i32 58)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for :\00"
define void @t_isprint_0x3a() {
%1 = tail call i32 @isprint(i32 58)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_fire5() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_FIRE5"
                                             : "INPUT_KEYB_FIRE5");
}


x86 assembly (clang, -O0):
<f_input_fire5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xedb(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_fire5>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xede(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"INPUT_JOY_FIRE5\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE5\00"
define i8* @f_input_fire5() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"INPUT_JOY_FIRE5\00"
@.str.1 = [17 x i8] c"INPUT_KEYB_FIRE5\00"
define i8* @f_input_fire5() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char error(int argc) {
  if (argc < 2) {
    printf("Usage:  dozword <dozenal number>\n");
    return 1;
  } else if (argc > 2) {
    printf("Too many arguments.  Usage:  dozword <dozenal number>\n");
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113a <error+0x2a>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
movb   $0x1,-0x1(%rbp)
jmp    115d <error+0x4d>
cmpl   $0x2,-0x8(%rbp)
jle    1159 <error+0x49>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movb   $0x1,-0x1(%rbp)
jmp    115d <error+0x4d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
cmp    $0x2,%edi
jge    111e <error+0xe>
lea    0xef9(%rip),%rdi
jmp    112a <error+0x1a>
jne    1123 <error+0x13>
xor    %eax,%eax
ret
lea    0xed6(%rip),%rdi
push   %rax
call   1030 <puts@plt>
mov    $0x1,%al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: dozword <dozenal number>\0A\00"
@.str.1 = [55 x i8] c"Too many arguments. Usage: dozword <dozenal number>\0A\00"
define signext i8 @error(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i8 1, i8* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
store i8 1, i8* %2
br label %14
13: ; preds = %8
store i8 0, i8* %2
br label %14
14: ; preds = %13, %11, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@str = [54 x i8] c"Too many arguments. Usage: dozword <dozenal number>\00"
@str.2 = [33 x i8] c"Usage: dozword <dozenal number>\00"
define signext i8 @error(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %3, %1
%6 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0), %1 ], [ getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0), %3 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %5, %3
%9 = phi i8 [ 0, %3 ], [ 1, %5 ]
ret i8 %9
}
/* Variables and functions */
int f208(int *);
int f209(int *p) { return f208(p); }


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

x86 assembly (clang, -O2):
<f209>:
jmp    1030 <f208@plt>

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

LLVM IR (-O2):
define i32 @f209(i32* %0) {
%2 = tail call i32 @f208(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("alpha"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"alpha\00"
define void @get_subdirname() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"alpha\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int p6n(long n) {
  printf("\n%******d\n", n);
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ iv_size(int /*<<< orphan*/ *);
uint32_t iv_len(int32_t *v) { return (v == NULL) ? 0 : iv_size(v); }


x86 assembly (clang, -O0):
<iv_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <iv_len+0x21>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <iv_len+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <iv_size@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iv_len>:
test   %rdi,%rdi
je     111a <iv_len+0xa>
jmp    1030 <iv_size@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iv_len(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @iv_size(i32* %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iv_len(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @iv_size(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void rop3_193_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = *D & stk4;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_193_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)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %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_193_1_0>:
mov    %esi,%r8d
not    %r8b
mov    (%rdi),%al
mov    %eax,%ecx
and    %r8b,%cl
or     %dl,%cl
xor    %sil,%cl
not    %cl
and    %sil,%al
and    %r8b,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_193_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
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %10
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %9
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %5
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_193_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %2
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = and i8 %9, %4
%12 = or i8 %11, %10
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int ocfs2_find_next_bit_set(void *, int, int /*<<< orphan*/);
int ocfs2_find_first_bit_set(void *addr, int size) {
  return ocfs2_find_next_bit_set(addr, size, 0);
}


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

x86 assembly (clang, -O2):
<ocfs2_find_first_bit_set>:
xor    %edx,%edx
jmp    1030 <ocfs2_find_next_bit_set@plt>

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

LLVM IR (-O2):
define i32 @ocfs2_find_first_bit_set(i8* %0, i32 %1) {
%3 = tail call i32 @ocfs2_find_next_bit_set(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t crc_ibm_shift_reflex(unsigned bit, uint16_t bcc) {
  unsigned val = (bcc ^ bit) & 1;
  if (val != 0) {
    bcc >>= 1;
    bcc ^= 0xa001;
  } else {
    bcc >>= 1;
  }
  return bcc & 0xffff;
}


x86 assembly (clang, -O0):
<crc_ibm_shift_reflex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <crc_ibm_shift_reflex+0x39>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xa001,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <crc_ibm_shift_reflex+0x42>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_ibm_shift_reflex>:
xor    %esi,%edi
shr    %esi
mov    %esi,%eax
xor    $0xa001,%eax
test   $0x1,%dil
cmove  %esi,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @crc_ibm_shift_reflex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = and i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = lshr i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = xor i32 %15, 40961
store i32 %16, i32* %4
br label %20
17: ; preds = %2
%18 = load i32, i32* %4
%19 = lshr i32 %18, 1
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %12
%21 = load i32, i32* %4
%22 = and i32 %21, 65535
ret i32 %22
}

LLVM IR (-O2):
define i32 @crc_ibm_shift_reflex(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = lshr i32 %1, 1
%7 = xor i32 %6, 40961
%8 = select i1 %5, i32 %6, i32 %7
%9 = and i32 %8, 65535
ret i32 %9
}
void foo710(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo710(i32 %0) {
ret void
}
int Scale2(int counter) {
  int a;
  int result = 0;
  result = 0x01;
  for (a = 1; a <= counter; a++) {
    result = result * 0x02;
  }
  return result;
}


x86 assembly (clang, -O0):
<Scale2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113f <Scale2+0x3f>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <Scale2+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scale2>:
test   %edi,%edi
jle    1118 <Scale2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <Scale2+0x1e>
mov    $0x1,%eax
jmp    1138 <Scale2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <Scale2+0x30>
test   %ecx,%ecx
je     1147 <Scale2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <Scale2+0x40>
ret

LLVM IR (-O0):
define i32 @Scale2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %4
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @Scale2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
int /*<<< orphan*/ scrprintf(char *, int, int);
void csrmove(int l, int c) { scrprintf("\033[%d;%dH", l, c); }


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

x86 assembly (clang, -O2):
<csrmove>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <scrprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @csrmove(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 @scrprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @csrmove(i32 %0, i32 %1) {
%3 = tail call i32 @scrprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 1 + 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t TRNGIntStatus(bool bMasked) {
  uint32_t ui32Mask;
  if (bMasked) {
    ui32Mask = (*((volatile unsigned long *)(0x40028000 + 0x0000000C)));
    return (ui32Mask &
            (*((volatile unsigned long *)(0x40028000 + 0x00000008))));
  } else {
    return ((*((volatile unsigned long *)(0x40028000 + 0x00000008))) &
            0x00000003);
  }
}


x86 assembly (clang, -O0):
<TRNGIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <TRNGIntStatus+0x35>
mov    $0x4002800c,%eax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x40028008,%ecx
mov    (%rcx),%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <TRNGIntStatus+0x45>
mov    $0x40028008,%eax
mov    (%rax),%rax
and    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRNGIntStatus>:
test   %edi,%edi
je     111f <TRNGIntStatus+0x1f>
mov    0x4002800c,%rax
40
mov    %rax,-0x8(%rsp)
mov    -0x8(%rsp),%rax
and    0x40028008,%rax
40
ret
mov    $0x3,%eax
and    0x40028008,%rax
40
ret

LLVM IR (-O0):
define i64 @TRNGIntStatus(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 1073905676 to i64*)
store volatile i64 %8, i64* %4
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* inttoptr (i64 1073905672 to i64*)
%11 = and i64 %9, %10
store i64 %11, i64* %2
br label %15
12: ; preds = %1
%13 = load volatile i64, i64* inttoptr (i64 1073905672 to i64*)
%14 = and i64 %13, 3
store i64 %14, i64* %2
br label %15
15: ; preds = %12, %7
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @TRNGIntStatus(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = icmp eq i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 1073905676 to i64*)
store volatile i64 %6, i64* %2
%7 = load volatile i64, i64* %2
br label %8
8: ; preds = %1, %5
%9 = phi i64 [ %7, %5 ], [ 3, %1 ]
%10 = load volatile i64, i64* inttoptr (i64 1073905672 to i64*)
%11 = and i64 %10, %9
ret i64 %11
}
char *BTSHASP_EatWhiteOnly(char *s) {
  while (*s && (*s <= ' '))
    s++;
  return (s);
}


x86 assembly (clang, -O0):
<BTSHASP_EatWhiteOnly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <BTSHASP_EatWhiteOnly+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <BTSHASP_EatWhiteOnly+0x3d>
jmp    114e <BTSHASP_EatWhiteOnly+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <BTSHASP_EatWhiteOnly+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTSHASP_EatWhiteOnly>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <BTSHASP_EatWhiteOnly+0x21>
cmp    $0x21,%cl
jl     1110 <BTSHASP_EatWhiteOnly+0x10>
ret

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

LLVM IR (-O2):
define i8* @BTSHASP_EatWhiteOnly(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = icmp slt i8 %4, 33
%7 = and i1 %5, %6
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i8* %3
}