#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 nd();
int main() {
  int i, x, y, offset_x, offset_y;
  x = 0;
  y = 0;
  for (i = 0; i < nd(); i++) {
    offset_x = nd();
    offset_x += i + 4;
    offset_y = nd();
    offset_y += i + 4;
    x += offset_x;
    y += offset_y;
  }
  return 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    119a <main+0x8a>
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    $0x2a,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <nd@plt>
test   %eax,%eax
jle    113c <main+0x2c>
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <nd@plt>
xor    %eax,%eax
call   1030 <nd@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <nd@plt>
cmp    %eax,%ebx
jl     1120 <main+0x10>
mov    $0x2a,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @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 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %2
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %2
%9 = call i32 (...) @nd()
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = call i32 (...) @nd()
store i32 %12, i32* %5
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, %14
store i32 %16, i32* %5
%17 = call i32 (...) @nd()
store i32 %17, i32* %6
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 4
%20 = load i32, i32* %6
%21 = add nsw i32 %20, %19
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = add nsw i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = add nsw i32 %26, %25
store i32 %27, i32* %4
br label %28
28: ; preds = %11
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %7
31: ; preds = %7
ret i32 42
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nd()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = tail call i32 (...) @nd()
%6 = tail call i32 (...) @nd()
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 (...) @nd()
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 42
}