#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*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int i, j, k, a, b;
  int res;
  i = 0;
  res = 123;
  while (i < 5) {
    j = 0;
    while (j < 5) {
      k = (i + j) / 2;
      if (k > i) {
        a = 0;
        while (a < 5) {
          b = (a + k) / 2;
          if (b > j)
            res = res + b;
          else
            res = res + k;
          a = a + 1;
        }
      }
      j = j + 1;
    }
    i = i + 1;
  }
  print_int(res);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x18(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11e2 <main+0xc2>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11d4 <main+0xb4>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    11c6 <main+0xa6>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11c1 <main+0xa1>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11aa <main+0x8a>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11b3 <main+0x93>
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <main+0x55>
jmp    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
mov    -0x18(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe0f(%rip),%rdi
call   1030 <print_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb2,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %6
br label %7
7: ; preds = %49, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %52
10: ; preds = %7
store i32 0, i32* %2
br label %11
11: ; preds = %46, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %49
14: ; preds = %11
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = add nsw i32 %15, %16
%18 = sdiv i32 %17, 2
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* %1
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %46
22: ; preds = %14
store i32 0, i32* %4
br label %23
23: ; preds = %42, %22
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %45
26: ; preds = %23
%27 = load i32, i32* %4
%28 = load i32, i32* %3
%29 = add nsw i32 %27, %28
%30 = sdiv i32 %29, 2
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = load i32, i32* %2
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %26
%35 = load i32, i32* %6
%36 = load i32, i32* %5
%37 = add nsw i32 %35, %36
store i32 %37, i32* %6
br label %42
38: ; preds = %26
%39 = load i32, i32* %6
%40 = load i32, i32* %3
%41 = add nsw i32 %39, %40
store i32 %41, i32* %6
br label %42
42: ; preds = %38, %34
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %23
45: ; preds = %23
br label %46
46: ; preds = %45, %14
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %11
49: ; preds = %11
%50 = load i32, i32* %1
%51 = add nsw i32 %50, 1
store i32 %51, i32* %1
br label %7
52: ; preds = %7
%53 = load i32, i32* %6
%54 = call i32 @print_int(i32 %53)
%55 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i32 178)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}