xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sqrt(double);
int distance(int y1, int x1, int y2, int x2) {
  return (int)sqrt((double)(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    -0x4(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %esi,%ecx
imul   %ecx,%ecx
sub    %edi,%edx
imul   %edx,%edx
add    %ecx,%edx
cvtsi2sd %edx,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %8
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = sitofp i32 %23 to double
%25 = call i64 @sqrt(double %24)
%26 = trunc i64 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %3, %1
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %2, %0
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = tail call i64 @sqrt(double %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}
void convertToUppercase(char *buf) {
  char *ptr = buf;
  while (*ptr != '\0') {
    if (*ptr >= 97 && *ptr <= 122) {
      *ptr -= 32;
    }
    ptr++;
  }
  return;
}


x86 assembly (clang, -O0):
<convertToUppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <convertToUppercase+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <convertToUppercase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <convertToUppercase+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <convertToUppercase+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToUppercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <convertToUppercase+0x2a>
add    $0x1,%rdi
jmp    111b <convertToUppercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <convertToUppercase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <convertToUppercase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <convertToUppercase+0x10>
ret

LLVM IR (-O0):
define void @convertToUppercase(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 = %26, %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 %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @convertToUppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
void RTFileIoCtl(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileIoCtl() {
ret void
}
/* Variables and functions */
unsigned int row_index(unsigned int, unsigned int);
unsigned int column_index(unsigned int i, unsigned int M) {
  unsigned int row = row_index(i, M);
  return i - M * row + row * (row + 1) / 2;
}


x86 assembly (clang, -O0):
<column_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <row_index@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
shr    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<column_index>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <row_index@plt>
imul   %eax,%ebx
sub    %ebx,%ebp
lea    0x1(%rax),%ecx
imul   %ecx,%eax
shr    %eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @column_index(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* %3
%7 = load i32, i32* %4
%8 = call i32 @row_index(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = mul i32 %10, %11
%13 = sub i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = add i32 %15, 1
%17 = mul i32 %14, %16
%18 = udiv i32 %17, 2
%19 = add i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @column_index(i32 %0, i32 %1) {
%3 = tail call i32 @row_index(i32 %0, i32 %1)
%4 = mul i32 %3, %1
%5 = sub i32 %0, %4
%6 = add i32 %3, 1
%7 = mul i32 %6, %3
%8 = lshr i32 %7, 1
%9 = add i32 %5, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *dll_popen(char const *, char const *);
FILE *__wrap_popen(const char *command, const char *mode) {
  return dll_popen(command, mode);
}


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

x86 assembly (clang, -O2):
<__wrap_popen>:
jmp    1030 <dll_popen@plt>

LLVM IR (-O0):
define i32* @__wrap_popen(i8* %0, i8* %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 i32* @dll_popen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define i32* @__wrap_popen(i8* %0, i8* %1) {
%3 = tail call i32* @dll_popen(i8* %0, i8* %1)
ret i32* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void timer_set_value(uint32_t *timer, uint32_t value) {
  timer[0x028 / 4] = value;
}


x86 assembly (clang, -O0):
<timer_set_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @timer_set_value(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 10
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @timer_set_value(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 10
store i32 %1, i32* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
  int height;
};
typedef TYPE_1__ XResizeRequestEvent;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
void do_ResizeRequest(FILE *out_f, XEvent *eventp) {
  XResizeRequestEvent *e = (XResizeRequestEvent *)eventp;
  fprintf(out_f, "    width %d, height %d\n", e->width, e->height);
}


x86 assembly (clang, -O0):
<do_ResizeRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ResizeRequest>:
mov    (%rsi),%edx
mov    0x4(%rsi),%ecx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [25 x i8] c" width %d, height %d\0A\00"
define void @do_ResizeRequest(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.TYPE_2__*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to %struct.TYPE_2__*
store %struct.TYPE_2__* %7, %struct.TYPE_2__** %5
%8 = load i32*, i32** %3
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load %struct.TYPE_2__*, %struct.TYPE_2__** %5
%13 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c" width %d, height %d\0A\00"
define void @do_ResizeRequest(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0, b = 0, i = 0;
  a++;
  while (i < 5) {
    b++;
    i++;
    a++;
  };
  printf("%i\n", a);
  printf("%i\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1167 <main+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x2d>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\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 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cblas_scopy(int const, float const *, int const, float *,
                               int const);
void c_scopy(const int N, const float *X, const int strideX, float *Y,
             const int strideY) {
  cblas_scopy(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_scopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_scopy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_scopy>:
jmp    1030 <cblas_scopy@plt>

LLVM IR (-O0):
define void @c_scopy(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store float* %1, float** %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load float*, float** %7
%13 = load i32, i32* %8
%14 = load float*, float** %9
%15 = load i32, i32* %10
%16 = call i32 @cblas_scopy(i32 %11, float* %12, i32 %13, float* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @c_scopy(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = tail call i32 @cblas_scopy(i32 %0, float* %1, i32 %2, float* %3, i32 %4)
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSPP(const char *the_title) { return any_decrqss(the_title, "+w"); }


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

x86 assembly (clang, -O2):
<rpt_DECSPP>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"+w\00"
define i32 @rpt_DECSPP(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
char **sys_errlist;
int sys_nerr;
char *strerror(int error_number) {
  if (error_number >= 0 && error_number < sys_nerr)
    return sys_errlist[error_number];
  else
    return "Bad error code";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113e <strerror+0x3e>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jge    113e <strerror+0x3e>
mov    0x2ece(%rip),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <strerror+0x49>
lea    0xebb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1126 <strerror+0x26>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1126 <strerror+0x26>
mov    0x2edb(%rip),%rax
mov    (%rax),%rax
mov    %edi,%ecx
mov    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = global i32 0
@sys_errlist = global i8** null
@.str = [15 x i8] c"Bad error code\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8**, i8*** @sys_errlist
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %17
16: ; preds = %6, %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
17: ; preds = %16, %10
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@sys_nerr = global i32 0
@sys_errlist = global i8** null
@.str = [15 x i8] c"Bad error code\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8**, i8*** @sys_errlist
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i8*, i8** %9
br label %11
11: ; preds = %1, %6
%12 = phi i8* [ %10, %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
double lgamma(int /*<<< orphan*/);
double log_gamma(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double);
int main(int argc, char *argv[]) {
  printf("lgamma is %0.5f log_gamma is %0.5f \n", lgamma(atof(argv[1])),
         log_gamma(atof(argv[1])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1060 <lgamma@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1040 <log_gamma@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1060 <lgamma@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x8(%rbx),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1040 <log_gamma@plt>
movaps %xmm0,%xmm1
lea    0xe88(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"lgamma is %0.5f log_gamma is %0.5f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @atof(i8* %7)
%9 = call double @lgamma(i32 %8)
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atof(i8* %12)
%14 = call double @log_gamma(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %9, double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"lgamma is %0.5f log_gamma is %0.5f \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atof(i8* %4)
%6 = tail call double @lgamma(i32 %5)
%7 = load i8*, i8** %3
%8 = tail call i32 @atof(i8* %7)
%9 = tail call double @log_gamma(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %6, double %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int dirfd(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int main(void) {
  DIR *dir = opendir(".");
  return dirfd(dir);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <dirfd@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dirfd(i32* %1)
ret i32 %2
}
int test_imm_28int8_reg(signed char val) {
  return ((val) & (-0x28 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_28int8_reg(i8 signext %0) {
%2 = and i8 %0, -40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void termop_report(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      446, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1be,%r8d
lea    0xf37(%rip),%r9
lea    0xf3e(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_report>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf65(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1be,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_report = [14 x i8] c"termop_report\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_report(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_report, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_report = [14 x i8] c"termop_report\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_report(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_report, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  printf("%.2f %.2f %.2f", c, b, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [15 x i8] c"%.2f %.2f %.2f\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%5 = load double, double* %3
%6 = load double, double* %2
%7 = load double, double* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %5, double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [15 x i8] c"%.2f %.2f %.2f\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %3
%9 = load double, double* %2
%10 = load double, double* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %8, double %9, double %10)
ret i32 0
}
int ieee80211_freq_to_dsss_chan(int freq) {
  if ((freq >= 2410) && (freq < 2475))
    return (freq - 2405) / 5;
  else if ((freq >= 2482) && (freq < 2487))
    return 14;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ieee80211_freq_to_dsss_chan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x96a,-0x8(%rbp)
jl     1139 <ieee80211_freq_to_dsss_chan+0x39>
cmpl   $0x9ab,-0x8(%rbp)
jge    1139 <ieee80211_freq_to_dsss_chan+0x39>
mov    -0x8(%rbp),%eax
sub    $0x965,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1166 <ieee80211_freq_to_dsss_chan+0x66>
cmpl   $0x9b2,-0x8(%rbp)
jl     115f <ieee80211_freq_to_dsss_chan+0x5f>
cmpl   $0x9b7,-0x8(%rbp)
jge    115f <ieee80211_freq_to_dsss_chan+0x5f>
movl   $0xe,-0x4(%rbp)
jmp    1166 <ieee80211_freq_to_dsss_chan+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_freq_to_dsss_chan>:
lea    -0x96a(%rdi),%eax
cmp    $0x40,%eax
ja     111d <ieee80211_freq_to_dsss_chan+0x1d>
add    $0x9b,%dil
movzbl %dil,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
ret
add    $0xfffff64e,%edi
cmp    $0x5,%edi
mov    $0xe,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ieee80211_freq_to_dsss_chan(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 2410
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2475
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 2405
%12 = sdiv i32 %11, 5
store i32 %12, i32* %2
br label %21
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 2482
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 2487
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 14, i32* %2
br label %21
20: ; preds = %16, %13
store i32 -1, i32* %2
br label %21
21: ; preds = %20, %19, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @ieee80211_freq_to_dsss_chan(i32 %0) {
%2 = add i32 %0, -2410
%3 = icmp ult i32 %2, 65
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = trunc i32 %0 to i8
%6 = add i8 %5, -101
%7 = udiv i8 %6, 5
%8 = zext i8 %7 to i32
br label %13
9: ; preds = %1
%10 = add i32 %0, -2482
%11 = icmp ult i32 %10, 5
%12 = select i1 %11, i32 14, i32 -1
br label %13
13: ; preds = %9, %4
%14 = phi i32 [ %8, %4 ], [ %12, %9 ]
ret i32 %14
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void bf_unset(uint8_t field[], size_t idx) {
  field[idx / 8] &= ~(1u << (7 - (idx % 8)));
}


x86 assembly (clang, -O0):
<bf_unset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x7,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_unset>:
mov    %esi,%ecx
not    %cl
and    $0x7,%cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
shr    $0x3,%rsi
and    %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @bf_unset(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = urem i64 %5, 8
%7 = sub i64 7, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
%11 = load i32*, i32** %3
%12 = load i64, i64* %4
%13 = udiv i64 %12, 8
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = and i32 %15, %10
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
define void @bf_unset(i32* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 7
%5 = xor i32 %4, 7
%6 = shl nuw i32 1, %5
%7 = xor i32 %6, -1
%8 = lshr i64 %1, 3
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = and i32 %10, %7
store i32 %11, i32* %9
ret void
}
int al_msix_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @al_msix_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun(char s[100]) { printf("sizeof(s):%d\n", sizeof(s)); }


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

x86 assembly (clang, -O2):
<fun>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"sizeof(s):%d\0A\00"
define void @fun(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
void midi_getdevs(char *indevlist, int *nindevs, char *outdevlist,
                  int *noutdevs, int maxndev, int devdescsize) {}


x86 assembly (clang, -O0):
<midi_getdevs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @midi_getdevs(i8* %0, i32* %1, i8* %2, i32* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @midi_getdevs(i8* nocapture %0, i32* nocapture %1, i8* nocapture %2, i32* nocapture %3, i32 %4, i32 %5) {
ret void
}
void jac_chain_nm2_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @jac_chain_nm2_decref() {
ret void
}
/* Variables and functions */
scalar_t__ read_and_test(char *, int);
int main(void) {
  int result = 0;
  result += read_and_test("./spellable.txt", true);
  result += read_and_test("./not_spellable.txt", false);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x1,%esi
call   1030 <read_and_test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
lea    0xec5(%rip),%rdi
xor    %esi,%esi
call   1030 <read_and_test@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <read_and_test@plt>
mov    %rax,%rbx
lea    0xee4(%rip),%rdi
xor    %esi,%esi
call   1030 <read_and_test@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"./spellable.txt\00"
@.str.1 = [20 x i8] c"./not_spellable.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @read_and_test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 @read_and_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"./spellable.txt\00"
@.str.1 = [20 x i8] c"./not_spellable.txt\00"
define i32 @main() {
%1 = tail call i64 @read_and_test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i64 @read_and_test(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = add i64 %2, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct Record {
  int dummy;
};

/* Variables and functions */
int gzGetNewRecord(struct Record *);
int textGetNewRecord(struct Record *);
int getNewRecord(struct Record *record, int isZip) {
  if (isZip) {
    return gzGetNewRecord(record);
  } else {
    return textGetNewRecord(record);
  }
}


x86 assembly (clang, -O0):
<getNewRecord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114a <getNewRecord+0x2a>
mov    -0x10(%rbp),%rdi
call   1040 <gzGetNewRecord@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <getNewRecord+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <textGetNewRecord@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNewRecord>:
test   %esi,%esi
je     1129 <getNewRecord+0x9>
jmp    1040 <gzGetNewRecord@plt>
jmp    1030 <textGetNewRecord@plt>

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

LLVM IR (-O2):
%struct.Record = type { i32 }
define i32 @getNewRecord(%struct.Record* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @gzGetNewRecord(%struct.Record* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @textGetNewRecord(%struct.Record* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int shlibfunc2();
int statlibfunc();
int main(void) {
  if (statlibfunc() != 42)
    return 1;
  if (shlibfunc2() != 24)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <statlibfunc@plt>
cmp    $0x2a,%eax
je     114b <main+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    $0x0,%al
call   1040 <shlibfunc2@plt>
cmp    $0x18,%eax
je     1167 <main+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <statlibfunc@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2a,%ecx
jne    1145 <main+0x25>
xor    %eax,%eax
call   1040 <shlibfunc2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x18,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @statlibfunc()
%3 = icmp ne i32 %2, 42
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %10
5: ; preds = %0
%6 = call i32 (...) @shlibfunc2()
%7 = icmp ne i32 %6, 24
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @statlibfunc()
%2 = icmp eq i32 %1, 42
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @shlibfunc2()
%5 = icmp ne i32 %4, 24
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
unsigned long type_of(void *x) {
  return ((unsigned long)x) & 0x7ffe00000000ull;
}


x86 assembly (clang, -O0):
<type_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x7ffe00000000,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_of>:
movabs $0x7ffe00000000,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @type_of(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 140728898420736
ret i64 %5
}

LLVM IR (-O2):
define i64 @type_of(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 140728898420736
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
unsigned int get_cidr_value(char cidr[]) {
  unsigned int cidrValue;
  sscanf(cidr, "/%u", &cidrValue);
  return cidrValue;
}


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

x86 assembly (clang, -O2):
<get_cidr_value>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"/%u\00"
define i32 @get_cidr_value(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"/%u\00"
define i32 @get_cidr_value(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ ceil(double);
int /*<<< orphan*/ printf(char *, int, double);
int write_word(int, unsigned int);
int set_flash_mode(double microseconds, double mclk) {
  int r, clks;
  unsigned int mode;
  clks = (int)ceil(mclk * microseconds);
  printf("%d clocks per %.1f us\n", clks, microseconds * 1e6);
  mode = ((clks & 255) << 16) | 0x00000100;
  r = write_word(0xFFFFFF60, mode);
  return r;
}


x86 assembly (clang, -O0):
<set_flash_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
movsd  0xea1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
or     $0x100,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0xffffff60,%edi
call   1050 <write_word@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flash_mode>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
mulsd  0xea7(%rip),%xmm0
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
movzbl %bl,%esi
shl    $0x10,%esi
or     $0x100,%esi
mov    $0xffffff60,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <write_word@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%d clocks per %.1f us\0A\00"
define i32 @set_flash_mode(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = call i64 @ceil(double %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load double, double* %3
%15 = fmul double %14, 1.000000e+06
%16 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %13, double %15)
%17 = load i32, i32* %6
%18 = and i32 %17, 255
%19 = shl i32 %18, 16
%20 = or i32 %19, 256
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = call i32 @write_word(i32 -160, i32 %21)
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [23 x i8] c"%d clocks per %.1f us\0A\00"
define i32 @set_flash_mode(double %0, double %1) {
%3 = fmul double %0, %1
%4 = tail call i64 @ceil(double %3)
%5 = trunc i64 %4 to i32
%6 = fmul double %0, 1.000000e+06
%7 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, double %6)
%8 = shl i32 %5, 16
%9 = and i32 %8, 16711680
%10 = or i32 %9, 256
%11 = tail call i32 @write_word(i32 -160, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_unsigned_less_or_equal() {
  gen_pop();
  gen_call("ccule");
}


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

x86 assembly (clang, -O2):
<gen_unsigned_less_or_equal>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccule\00"
define i32 @gen_unsigned_less_or_equal() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccule\00"
define i32 @gen_unsigned_less_or_equal() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x4e() {
  Assert_real((islower(78) == 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_islower.c",
              395, ("islower should be 0 for N"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x4e>:
push   %rax
mov    $0x4e,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x18b,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for N\00"
define void @t_islower_0x4e() {
%1 = call i64 @islower(i32 78)
%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 395, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for N\00"
define void @t_islower_0x4e() {
%1 = tail call i64 @islower(i32 78)
%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 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}