#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_while() {
  int acc = 0;
  int i = 0;
  while (i <= 100)
    acc = acc + i++;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          74, 5050, acc);
  ;
  acc = 1;
  i = 0;
  while (i <= 100) {
    acc = acc + i++;
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          81, 5051, acc);
  ;
  acc = 0;
  i = 0;
  while (i < 10) {
    if (i++ < 5)
      continue;
    acc += i;
    if (i == 9)
      break;
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          90, 6 + 7 + 8 + 9, acc);
  ;
  i = 0;
  while (i++ < 100)
    ;
  i = 0;
  while (0.5) {
    i = 67;
    break;
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          101, 67, i);
  ;
}


x86 assembly (clang, -O0):
<test_while>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1148 <test_while+0x38>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <test_while+0x16>
mov    -0x4(%rbp),%ecx
lea    0xeae(%rip),%rdi
mov    $0x4a,%esi
mov    $0x13ba,%edx
call   1030 <fexpect@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1191 <test_while+0x81>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <test_while+0x5f>
mov    -0x4(%rbp),%ecx
lea    0xe65(%rip),%rdi
mov    $0x51,%esi
mov    $0x13bb,%edx
call   1030 <fexpect@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11f8 <test_while+0xe8>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x5,%eax
jge    11db <test_while+0xcb>
jmp    11b8 <test_while+0xa8>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    11f3 <test_while+0xe3>
jmp    11f8 <test_while+0xe8>
jmp    11b8 <test_while+0xa8>
mov    -0x4(%rbp),%ecx
lea    0xdfe(%rip),%rdi
mov    $0x5a,%esi
mov    $0x1e,%edx
call   1030 <fexpect@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x64,%eax
jge    1231 <test_while+0x121>
jmp    1218 <test_while+0x108>
movl   $0x0,-0x8(%rbp)
movl   $0x43,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xdb7(%rip),%rdi
mov    $0x65,%esi
mov    $0x43,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_while>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4a,%esi
mov    $0x13ba,%edx
mov    $0x13ba,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
mov    $0x13bb,%edx
mov    $0x13bb,%ecx
call   1030 <fexpect@plt>
xor    %ecx,%ecx
xor    %eax,%eax
cmp    $0x9,%eax
mov    $0x8,%edx
cmovae %eax,%edx
neg    %edx
lea    0x1(%rax),%esi
nopw   0x0(%rax,%rax,1)
cmp    $0x5,%eax
jl     1180 <test_while+0x70>
add    %esi,%ecx
lea    (%rdx,%rsi,1),%edi
add    $0x1,%edi
add    $0x1,%esi
cmp    $0x2,%edi
jne    1160 <test_while+0x50>
jmp    1184 <test_while+0x74>
nopw   0x0(%rax,%rax,1)
mov    %esi,%eax
jmp    114a <test_while+0x3a>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5a,%esi
mov    $0x1e,%edx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
mov    $0x43,%edx
mov    $0x43,%ecx
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
define void @test_while() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = add nsw i32 %7, %8
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
%13 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 74, i32 5050, i32 %12)
store i32 1, i32* %1
store i32 0, i32* %2
br label %14
14: ; preds = %17, %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 100
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = add nsw i32 %18, %19
store i32 %21, i32* %1
br label %14
22: ; preds = %14
%23 = load i32, i32* %1
%24 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 81, i32 5051, i32 %23)
store i32 0, i32* %1
store i32 0, i32* %2
br label %25
25: ; preds = %40, %32, %22
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 10
br i1 %27, label %28, label %41
28: ; preds = %25
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
%31 = icmp slt i32 %29, 5
br i1 %31, label %32, label %33
32: ; preds = %28
br label %25
33: ; preds = %28
%34 = load i32, i32* %2
%35 = load i32, i32* %1
%36 = add nsw i32 %35, %34
store i32 %36, i32* %1
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 9
br i1 %38, label %39, label %40
39: ; preds = %33
br label %41
40: ; preds = %33
br label %25
41: ; preds = %39, %25
%42 = load i32, i32* %1
%43 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 90, i32 30, i32 %42)
store i32 0, i32* %2
br label %44
44: ; preds = %48, %41
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
store i32 %46, i32* %2
%47 = icmp slt i32 %45, 100
br i1 %47, label %48, label %49
48: ; preds = %44
br label %44
49: ; preds = %44
store i32 0, i32* %2
br label %50
50: ; preds = %49
store i32 67, i32* %2
br label %51
51: ; preds = %50
%52 = load i32, i32* %2
%53 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 101, i32 67, i32 %52)
ret void
}

LLVM IR (-O2):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
define void @test_while() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 74, i32 5050, i32 5050)
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 81, i32 5051, i32 5051)
br label %3
3: ; preds = %8, %0
%4 = phi i32 [ 0, %0 ], [ %9, %8 ]
%5 = phi i32 [ 0, %0 ], [ %11, %8 ]
%6 = call i32 @llvm.umax.i32(i32 %5, i32 8)
%7 = icmp slt i32 %5, 5
br label %8
8: ; preds = %3, %12
%9 = phi i32 [ %4, %3 ], [ %13, %12 ]
%10 = phi i32 [ %5, %3 ], [ %11, %12 ]
%11 = add i32 %10, 1
br i1 %7, label %3, label %12
12: ; preds = %8
%13 = add nsw i32 %11, %9
%14 = icmp eq i32 %10, %6
br i1 %14, label %15, label %8
15: ; preds = %12
%16 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 90, i32 30, i32 %13)
%17 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 101, i32 67, i32 67)
ret void
}