xunge/DecIR huggingface dataset:
double svd_dmin(double a, double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<svd_dmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <svd_dmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <svd_dmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_dmin>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @svd_dmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ left(double);
int rotate_left(float degrees) {
  if (degrees < 0.0)
    degrees = degrees * (-1);
  if (degrees < 90.0) {
    left(degrees);
  } else {
    left(45.0);
    left(45.0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1145 <rotate_left+0x35>
movss  0xec5(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1173 <rotate_left+0x63>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <left@plt>
jmp    118d <rotate_left+0x7d>
movsd  0xe95(%rip),%xmm0
call   1030 <left@plt>
movsd  0xe88(%rip),%xmm0
call   1030 <left@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
push   %rax
movaps 0xee8(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movss  0xed9(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <rotate_left+0x35>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
jmp    115a <rotate_left+0x4a>
movsd  0xecb(%rip),%xmm0
call   1030 <left@plt>
movsd  0xebe(%rip),%xmm0
call   1030 <left@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rotate_left(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float %7, -1.000000e+00
store float %8, float* %2
br label %9
9: ; preds = %6, %1
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 9.000000e+01
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = call i32 @left(double %15)
br label %20
17: ; preds = %9
%18 = call i32 @left(double 4.500000e+01)
%19 = call i32 @left(double 4.500000e+01)
br label %20
20: ; preds = %17, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @rotate_left(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp olt float %4, 9.000000e+01
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = fpext float %4 to double
br label %10
8: ; preds = %1
%9 = tail call i32 @left(double 4.500000e+01)
br label %10
10: ; preds = %8, %6
%11 = phi double [ 4.500000e+01, %8 ], [ %7, %6 ]
%12 = tail call i32 @left(double %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int first_line_len(FILE *fp) {
  int len = 0;
  while (fgetc(fp) != '\n')
    ++len;
  rewind(fp);
  return len;
}


x86 assembly (clang, -O0):
<first_line_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1156 <first_line_len+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <first_line_len+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_line_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <fgetc@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1130 <first_line_len+0x10>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @first_line_len(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @fgetc(i32* %5)
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32*, i32** %2
%14 = call i32 @rewind(i32* %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @first_line_len(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @rewind(i32* %0)
ret i32 %3
}
/* Variables and functions */
int mkdir(char const *);
int mymkdir(const char *dirname) { return (mkdir(dirname)); }


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

x86 assembly (clang, -O2):
<mymkdir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @mymkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _sram_to_pio();
void sram_to_pio(void) { _sram_to_pio(); }


x86 assembly (clang, -O0):
<sram_to_pio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_sram_to_pio@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sram_to_pio() {
%1 = call i32 (...) @_sram_to_pio()
ret void
}

LLVM IR (-O2):
define void @sram_to_pio() {
%1 = tail call i32 (...) @_sram_to_pio()
ret void
}
/* Type definitions */
struct List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_free(struct List *);
void trie_search_free(struct List *result) { list_free(result); }


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

x86 assembly (clang, -O2):
<trie_search_free>:
jmp    1030 <list_free@plt>

LLVM IR (-O0):
%struct.List = type { i32 }
define void @trie_search_free(%struct.List* %0) {
%2 = alloca %struct.List*
store %struct.List* %0, %struct.List** %2
%3 = load %struct.List*, %struct.List** %2
%4 = call i32 @list_free(%struct.List* %3)
ret void
}

LLVM IR (-O2):
%struct.List = type { i32 }
define void @trie_search_free(%struct.List* %0) {
%2 = tail call i32 @list_free(%struct.List* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum = 0, i = 1;
  do {
    sum += i;
    ++i;
  } while (i <= 5);
  printf("sum of first 5 natural numbers = %d", sum);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [36 x i8] c"sum of first 5 natural numbers = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Type definitions */
struct os_time {
  int dummy;
};

/* Variables and functions */
int os_get_time(struct os_time *t) { return -1; }


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

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

LLVM IR (-O0):
%struct.os_time = type { i32 }
define i32 @os_get_time(%struct.os_time* %0) {
%2 = alloca %struct.os_time*
store %struct.os_time* %0, %struct.os_time** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.os_time = type { i32 }
define i32 @os_get_time(%struct.os_time* nocapture readnone %0) {
ret i32 -1
}
int odd_bit_toggle(int o_num) {
  int bit_length;
  int mask;
  mask = 1;
  bit_length = 4 * sizeof(void *);
  for (; bit_length >= 1; bit_length--) {
    o_num = o_num ^ mask;
    mask = mask << 2;
  }
  return o_num;
}


x86 assembly (clang, -O0):
<odd_bit_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     113f <odd_bit_toggle+0x3f>
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <odd_bit_toggle+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd_bit_toggle>:
mov    %edi,%eax
xor    $0x55555555,%eax
ret

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

LLVM IR (-O2):
define i32 @odd_bit_toggle(i32 %0) {
%2 = xor i32 %0, 1431655765
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char *);
void main(void) { unsetenv("PATH"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
define void @main() {
%1 = tail call i32 @unsetenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void modulo_signed_Good2(int i) {
  char arr[5];
  int j = i % 5;
  if (j >= 0) {
    arr[j] = 123;
  }
}


x86 assembly (clang, -O0):
<modulo_signed_Good2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1128 <modulo_signed_Good2+0x28>
movslq -0x10(%rbp),%rax
movb   $0x7b,-0x9(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_signed_Good2(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %11
store i8 123, i8* %12
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @modulo_signed_Good2(i32 %0) {
ret void
}
void RTAvlGCPhysDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlGCPhysDoWithAll() {
ret void
}
int ReleaseLock(int sock) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ReleaseLock(i32 %0) {
ret i32 0
}
/* Variables and functions */
int time_total_milliseconds(float);
int time_hours(float t) {
  return time_total_milliseconds(t) / (60 * 60 * 1000);
}


x86 assembly (clang, -O0):
<time_hours>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <time_total_milliseconds@plt>
mov    $0x36ee80,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_hours>:
push   %rax
call   1030 <time_total_milliseconds@plt>
cltq
imul   $0x4a90be59,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x34,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time_hours(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @time_total_milliseconds(float %3)
%5 = sdiv i32 %4, 3600000
ret i32 %5
}

LLVM IR (-O2):
define i32 @time_hours(float %0) {
%2 = tail call i32 @time_total_milliseconds(float %0)
%3 = sdiv i32 %2, 3600000
ret i32 %3
}
void websils_xml_abi_0() {}


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

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

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

LLVM IR (-O2):
define void @websils_xml_abi_0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scrn_print(int, int /*<<< orphan*/, char *);
void imprimir(char *buf[], int row) {
  int i;
  for (i = 0; i < 4;) {
    scrn_print(row, 0, buf[i]);
    i = (i + 1) % 4;
  }
}


x86 assembly (clang, -O0):
<imprimir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115c <imprimir+0x4c>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
xor    %esi,%esi
call   1030 <scrn_print@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1126 <imprimir+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
nopl   0x0(%rax)
movslq %eax,%rbp
mov    (%rbx,%rbp,8),%rdx
mov    %r14d,%edi
xor    %esi,%esi
call   1030 <scrn_print@plt>
lea    0x1(%rbp),%eax
lea    0x4(%rbp),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
lea    (%rcx,%rbp,1),%eax
add    $0x1,%eax
jmp    1120 <imprimir+0x10>

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

LLVM IR (-O2):
define void @imprimir(i8** nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %10, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @scrn_print(i32 %1, i32 0, i8* %7)
%9 = add nsw i32 %4, 1
%10 = srem i32 %9, 4
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, ...);
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %f\n", h, g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef3(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
movss  0xec5(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
movss  0xeb3(%rip),%xmm0
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [7 x i8] c"%d %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 4, i32* %2
store i32 5, i32* %3
store float 5.000000e+00, float* %4
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = load i32, i32* %3
%8 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6, i32 %7)
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = load float, float* %4
%13 = load i32, i32* %3
%14 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), float %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [7 x i8] c"%d %f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, i32 5)
%2 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float 4.000000e+00)
%3 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), float 5.000000e+00, i32 5)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t get_s(int32_t value) {
  value = value / 256;
  return value & 0xf;
}


x86 assembly (clang, -O0):
<get_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_s>:
lea    0xff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
shr    $0x8,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @get_s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 256
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_s(i32 %0) {
%2 = sdiv i32 %0, 256
%3 = and i32 %2, 15
ret i32 %3
}
/* Variables and functions */
char *sprintf_char(char *, int /*<<< orphan*/);
char *_sprintf_string(char *buffer, const char *str) {
  while (*str)
    buffer = sprintf_char(buffer, *str++);
  return buffer;
}


x86 assembly (clang, -O0):
<_sprintf_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <_sprintf_string+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <sprintf_char@plt>
mov    %rax,-0x8(%rbp)
jmp    1120 <_sprintf_string+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sprintf_string>:
push   %rbx
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1146 <_sprintf_string+0x36>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%esi
mov    %rax,%rdi
call   1030 <sprintf_char@plt>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <_sprintf_string+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_sprintf_string(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i32
%11 = tail call i8* @sprintf_char(i8* %8, i32 %10)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i8* [ %0, %2 ], [ %11, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ RTFCheckCMM(int, int, int);
int /*<<< orphan*/ RTFGetToken();
int /*<<< orphan*/ RTFRouteToken();
int /*<<< orphan*/ RTFSkipGroup();
void SkipFieldResult(void) {
  while (!RTFCheckCMM(3, 3, 78))
    RTFGetToken();
  RTFSkipGroup();
  RTFRouteToken();
}


x86 assembly (clang, -O0):
<SkipFieldResult>:
push   %rbp
mov    %rsp,%rbp
jmp    1149 <SkipFieldResult+0x9>
mov    $0x3,%esi
mov    $0x4e,%edx
mov    %esi,%edi
call   1050 <RTFCheckCMM@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116f <SkipFieldResult+0x2f>
jmp    117b <SkipFieldResult+0x3b>
mov    $0x0,%al
call   1030 <RTFGetToken@plt>
jmp    1149 <SkipFieldResult+0x9>
mov    $0x0,%al
call   1040 <RTFSkipGroup@plt>
mov    $0x0,%al
call   1060 <RTFRouteToken@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipFieldResult>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x4e,%edx
call   1050 <RTFCheckCMM@plt>
test   %eax,%eax
jne    1171 <SkipFieldResult+0x31>
xor    %eax,%eax
call   1030 <RTFGetToken@plt>
jmp    1150 <SkipFieldResult+0x10>
xor    %eax,%eax
call   1040 <RTFSkipGroup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <RTFRouteToken@plt>

LLVM IR (-O0):
define void @SkipFieldResult() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @RTFCheckCMM(i32 3, i32 3, i32 78)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @RTFGetToken()
br label %1
7: ; preds = %1
%8 = call i32 (...) @RTFSkipGroup()
%9 = call i32 (...) @RTFRouteToken()
ret void
}

LLVM IR (-O2):
define void @SkipFieldResult() {
%1 = tail call i32 @RTFCheckCMM(i32 3, i32 3, i32 78)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @RTFGetToken()
%5 = tail call i32 @RTFCheckCMM(i32 3, i32 3, i32 78)
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @RTFSkipGroup()
%9 = tail call i32 (...) @RTFRouteToken()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int /*<<< orphan*/ PAPI_perror(char *);
void papif_perror__(char *message, int message_len) {
  char tmp[128];
  Fortran2cstring(tmp, message, 128, message_len);
  PAPI_perror(tmp);
}


x86 assembly (clang, -O0):
<papif_perror__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x80,%edx
call   1030 <Fortran2cstring@plt>
lea    -0x90(%rbp),%rdi
call   1040 <PAPI_perror@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_perror__>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ecx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
call   1030 <Fortran2cstring@plt>
mov    %rbx,%rdi
call   1040 <PAPI_perror@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_perror__(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @Fortran2cstring(i8* %6, i8* %7, i32 128, i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @PAPI_perror(i8* %10)
ret void
}

LLVM IR (-O2):
define void @papif_perror__(i8* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @Fortran2cstring(i8* %4, i8* %0, i32 128, i32 %1)
%6 = call i32 @PAPI_perror(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DataFree(void *h, char *k, void *d) { free(d); }


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

x86 assembly (clang, -O2):
<DataFree>:
mov    %rdx,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @DataFree(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @DataFree(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fatal(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int work_long(const void *arg1, const void *arg2) {
  const long *data1 = (const long *)arg1;
  const long *data2 = (const long *)arg2;
  if ((*data1) < (*data2)) {
    return -1;
  } else if ((*data1) > (*data2)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<work_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    113c <work_long+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <work_long+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    115c <work_long+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1168 <work_long+0x68>
jmp    1161 <work_long+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @work_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int _GetNonWh(get, ioarg, apeek) int (*get)();
int *apeek;
{
  int c;
  while (isspace(c = (*get)(ioarg)))
    ;
  *apeek = c;
  return (c == 0x1a || c == -1 || c == 0);
}


x86 assembly (clang, -O0):
<_GetNonWh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   *%rcx
mov    %eax,%edi
mov    %edi,-0x1c(%rbp)
call   1030 <isspace@plt>
cmp    $0x0,%eax
je     1146 <_GetNonWh+0x36>
jmp    1123 <_GetNonWh+0x13>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%al
cmpl   $0x1a,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
je     1177 <_GetNonWh+0x67>
mov    $0x1,%al
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
je     1177 <_GetNonWh+0x67>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_GetNonWh>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
mov    %r15d,%edi
xor    %eax,%eax
call   *%rbx
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <_GetNonWh+0x10>
mov    %ebp,(%r14)
mov    $0x1,%eax
cmp    $0xffffffff,%ebp
je     114d <_GetNonWh+0x3d>
cmp    $0x1a,%ebp
je     114d <_GetNonWh+0x3d>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_GetNonWh(i32 (...)* %0, i32 %1, i32* %2) {
%4 = alloca i32 (...)*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 (...)* %0, i32 (...)** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
br label %8
8: ; preds = %15, %3
%9 = load i32 (...)*, i32 (...)** %4
%10 = load i32, i32* %5
%11 = bitcast i32 (...)* %9 to i32 (i32, ...)*
%12 = call i32 (i32, ...) %11(i32 %10)
store i32 %12, i32* %7
%13 = call i32 @isspace(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %8
16: ; preds = %8
%17 = load i32, i32* %7
%18 = load i32*, i32** %6
store i32 %17, i32* %18
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 26
br i1 %20, label %27, label %21
21: ; preds = %16
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, -1
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, 0
br label %27
27: ; preds = %24, %21, %16
%28 = phi i1 [ true, %21 ], [ true, %16 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @_GetNonWh(i32 (...)* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = bitcast i32 (...)* %0 to i32 (i32, ...)*
br label %5
5: ; preds = %5, %3
%6 = tail call i32 (i32, ...) %4(i32 %1)
%7 = tail call i32 @isspace(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
store i32 %6, i32* %2
switch i32 %6, label %10 [
i32 -1, label %13
i32 26, label %13
]
10: ; preds = %9
%11 = icmp eq i32 %6, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %9, %10
%14 = phi i32 [ 1, %9 ], [ %12, %10 ], [ 1, %9 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ iptables_fw_clear_authservers();
void fw_clear_authservers(void) {
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sxpert/wifidog-ffw/refs/heads/master/src/"
         "firewall.c",
         185, LOG_INFO, "Clearing the authservers list");
  iptables_fw_clear_authservers();
}


x86 assembly (clang, -O0):
<fw_clear_authservers>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
mov    $0xb9,%esi
lea    0xf4e(%rip),%rcx
call   1040 <_debug@plt>
mov    $0x0,%al
call   1030 <iptables_fw_clear_authservers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_clear_authservers>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xf56(%rip),%rcx
mov    $0xb9,%esi
call   1040 <_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <iptables_fw_clear_authservers@plt>

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sxpert/wifidog-ffw/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Clearing the authservers list\00"
define void @fw_clear_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @_debug(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 185, i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @iptables_fw_clear_authservers()
ret void
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sxpert/wifidog-ffw/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Clearing the authservers list\00"
define void @fw_clear_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @_debug(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 185, i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @iptables_fw_clear_authservers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int _openssl_passwd(char *buf, int size, int rwflag, void *ud) {
  strncpy(buf, "help", size);
  return 0;
}


x86 assembly (clang, -O0):
<_openssl_passwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xecc(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_openssl_passwd>:
push   %rax
mov    %esi,%edx
lea    0xee6(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"help\00"
define i32 @_openssl_passwd(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"help\00"
define i32 @_openssl_passwd(i8* %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned char casefold(unsigned char c) {
  if ((c >= 0x61) && (c <= 0x7a)) {
    return c - 0x20;
  }
  return c;
}


x86 assembly (clang, -O0):
<casefold>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <casefold+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <casefold+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <casefold+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<casefold>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @casefold(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @casefold(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void progExecuteREM(void *vp) {}


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

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

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

LLVM IR (-O2):
define void @progExecuteREM(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ copiar(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void cat(char a1[50], char a2[50]) {
  FILE *f1 = fopen(a1, "r");
  FILE *f2 = fopen(a2, "a");
  copiar(f1, f2);
  fclose(f1);
  fclose(f2);
}


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <copiar@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r15
lea    0xeb4(%rip),%rsi
mov    %r14,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <copiar@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"a\00"
define void @cat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = call i32 @copiar(i32* %11, i32* %12)
%14 = load i32*, i32** %5
%15 = call i32 @fclose(i32* %14)
%16 = load i32*, i32** %6
%17 = call i32 @fclose(i32* %16)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"a\00"
define void @cat(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @copiar(i32* %3, i32* %4)
%6 = tail call i32 @fclose(i32* %3)
%7 = tail call i32 @fclose(i32* %4)
ret void
}
void X509_digest(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_digest() {
ret void
}
/* Type definitions */
struct sockaddr {
  int sa_family;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
                size_t hostlen, char *serv, size_t servlen, int flags) {
  switch (sa->sa_family) {
  default:
    return (1);
  }
}


x86 assembly (clang, -O0):
<getnameinfo>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getnameinfo(%struct.sockaddr* %0, i32 %1, i8* %2, i64 %3, i8* %4, i64 %5, i32 %6) {
%8 = alloca %struct.sockaddr*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i64 %3, i64* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
store i32 %6, i32* %14
%15 = load %struct.sockaddr*, %struct.sockaddr** %8
%16 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %15, i32 0, i32 0
%17 = load i32, i32* %16
switch i32 %17, label %18 [
]
18: ; preds = %7
ret i32 1
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getnameinfo(%struct.sockaddr* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64 %3, i8* nocapture readnone %4, i64 %5, i32 %6) {
ret i32 1
}
void inccolor(unsigned char *p) {
  if (*p == 0xc0)
    *p = 0xff;
  else if (*p > 0xc0)
    *p = 0x00;
  else
    *p = *p + 0x40;
}


x86 assembly (clang, -O0):
<inccolor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xc0,%eax
jne    1126 <inccolor+0x26>
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
jmp    115b <inccolor+0x5b>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xc0,%eax
jle    1144 <inccolor+0x44>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1156 <inccolor+0x56>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x40,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    115b <inccolor+0x5b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inccolor>:
mov    (%rdi),%al
xor    %ecx,%ecx
mov    $0xc0,%dl
sub    %al,%dl
movzbl %dl,%edx
cmovb  %ecx,%edx
neg    %dl
cmp    $0xc0,%al
movzbl %dl,%eax
mov    $0xff,%ecx
cmovne %eax,%ecx
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @inccolor(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -64
%4 = call i8 @llvm.usub.sat.i8(i8 -64, i8 %2)
%5 = sub i8 0, %4
%6 = select i1 %3, i8 -1, i8 %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
const char *skip_prefix(const char *str, const char *prefix) {
  size_t len = strlen(prefix);
  return strncmp(str, prefix, len) ? NULL : str + len;
}


x86 assembly (clang, -O0):
<skip_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1163 <skip_prefix+0x43>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    116f <skip_prefix+0x4f>
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_prefix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
add    %r15,%rbx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @skip_prefix(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
void ct_debug_init() {}


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

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

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

LLVM IR (-O2):
define void @ct_debug_init() {
ret void
}