#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*/ printf(char *);
void printRamp() {
  int xx = 10;
  int yy = 10;
  int zz = 0;
  for (int i = 0; i < yy; i++) {
    for (int i = 0; i < xx; i++) {
      printf("-");
    }
    xx -= 1;
    for (int i = 0; i < zz; i++) {
      printf("*");
    }
    zz += 1;
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printRamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c6 <printRamp+0xb6>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <printRamp+0x5d>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <printRamp+0x37>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <printRamp+0x93>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117d <printRamp+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printRamp+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printRamp>:
push   %rbp
push   %r14
push   %rbx
mov    $0xa,%r14d
xor    %ebx,%ebx
jmp    1136 <printRamp+0x26>
xchg   %ax,%ax
add    $0xffffffff,%r14d
add    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0xa,%ebx
je     1171 <printRamp+0x61>
mov    %r14d,%ebp
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1140 <printRamp+0x30>
mov    %ebx,%ebp
test   %ebx,%ebx
je     1120 <printRamp+0x10>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1160 <printRamp+0x50>
jmp    1120 <printRamp+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @printRamp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 10, i32* %1
store i32 10, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %37, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %40
11: ; preds = %7
store i32 0, i32* %5
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %1
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %12
21: ; preds = %12
%22 = load i32, i32* %1
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %1
store i32 0, i32* %6
br label %24
24: ; preds = %30, %21
%25 = load i32, i32* %6
%26 = load i32, i32* %3
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %24
33: ; preds = %24
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
%36 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %33
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %7
40: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @printRamp() {
br label %1
1: ; preds = %13, %0
%2 = phi i32 [ 0, %0 ], [ %14, %13 ]
%3 = phi i32 [ 10, %0 ], [ %6, %13 ]
br label %8
4: ; preds = %13
ret void
5: ; preds = %8
%6 = add nsw i32 %3, -1
%7 = icmp eq i32 %2, 0
br i1 %7, label %13, label %17
8: ; preds = %1, %8
%9 = phi i32 [ %11, %8 ], [ 0, %1 ]
%10 = tail call i32 @putchar(i32 45)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %3
br i1 %12, label %5, label %8
13: ; preds = %17, %5
%14 = add nuw nsw i32 %2, 1
%15 = tail call i32 @putchar(i32 10)
%16 = icmp eq i32 %14, 10
br i1 %16, label %4, label %1
17: ; preds = %5, %17
%18 = phi i32 [ %20, %17 ], [ 0, %5 ]
%19 = tail call i32 @putchar(i32 42)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, %2
br i1 %21, label %13, label %17
}