#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*/ draw_circle(int, int, int);
void draw_cylinder() {
  int x = 100, y = 100, r = 50, n = 50, i;
  for (i = 0; i < n; i += 3)
    draw_circle(x, y + i, r);
}


x86 assembly (clang, -O0):
<draw_cylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x64,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
movl   $0x32,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1166 <draw_cylinder+0x56>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <draw_circle@plt>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <draw_cylinder+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_cylinder>:
push   %rax
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x67,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x6a,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x6d,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x70,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x73,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x76,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x79,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x7c,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x7f,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x82,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x85,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x88,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x8b,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x8e,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x91,%esi
mov    $0x32,%edx
call   1030 <draw_circle@plt>
mov    $0x64,%edi
mov    $0x94,%esi
mov    $0x32,%edx
pop    %rax
jmp    1030 <draw_circle@plt>

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

LLVM IR (-O2):
define void @draw_cylinder() {
%1 = tail call i32 @draw_circle(i32 100, i32 100, i32 50)
%2 = tail call i32 @draw_circle(i32 100, i32 103, i32 50)
%3 = tail call i32 @draw_circle(i32 100, i32 106, i32 50)
%4 = tail call i32 @draw_circle(i32 100, i32 109, i32 50)
%5 = tail call i32 @draw_circle(i32 100, i32 112, i32 50)
%6 = tail call i32 @draw_circle(i32 100, i32 115, i32 50)
%7 = tail call i32 @draw_circle(i32 100, i32 118, i32 50)
%8 = tail call i32 @draw_circle(i32 100, i32 121, i32 50)
%9 = tail call i32 @draw_circle(i32 100, i32 124, i32 50)
%10 = tail call i32 @draw_circle(i32 100, i32 127, i32 50)
%11 = tail call i32 @draw_circle(i32 100, i32 130, i32 50)
%12 = tail call i32 @draw_circle(i32 100, i32 133, i32 50)
%13 = tail call i32 @draw_circle(i32 100, i32 136, i32 50)
%14 = tail call i32 @draw_circle(i32 100, i32 139, i32 50)
%15 = tail call i32 @draw_circle(i32 100, i32 142, i32 50)
%16 = tail call i32 @draw_circle(i32 100, i32 145, i32 50)
%17 = tail call i32 @draw_circle(i32 100, i32 148, i32 50)
ret void
}