#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;
  res = 123;
  for (i = 0; i < 5; i = i + 1) {
    for (j = 0; j < 5; j = j + 1) {
      k = (i + j) / 2;
      if (k > i) {
        for (a = 0; a < 5; a = a + 1) {
          b = (a + k) / 2;
          if (b > j)
            res = res + b;
          else
            res = res + k;
        }
      }
    }
  }
  print_int(res);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7b,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11f1 <main+0xd1>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11de <main+0xbe>
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    11cb <main+0xab>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11c6 <main+0xa6>
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)
jmp    11b8 <main+0x98>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <main+0x55>
jmp    11cb <main+0xab>
jmp    11d0 <main+0xb0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
jmp    11e3 <main+0xc3>
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    0xe00(%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 123, i32* %6
store i32 0, i32* %1
br label %7
7: ; preds = %52, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %55
10: ; preds = %7
store i32 0, i32* %2
br label %11
11: ; preds = %48, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %51
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 %47
22: ; preds = %14
store i32 0, i32* %4
br label %23
23: ; preds = %43, %22
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %46
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
br label %43
43: ; preds = %42
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %23
46: ; preds = %23
br label %47
47: ; preds = %46, %14
br label %48
48: ; preds = %47
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %11
51: ; preds = %11
br label %52
52: ; preds = %51
%53 = load i32, i32* %1
%54 = add nsw i32 %53, 1
store i32 %54, i32* %1
br label %7
55: ; preds = %7
%56 = load i32, i32* %6
%57 = call i32 @print_int(i32 %56)
%58 = 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
}