#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 *);
int main() {
  int i, j;
  for (i = 1; i <= 5; i++) {
    for (j = 1; j <= 5 - i; j++) {
      printf(".");
    }
    for (j = 1; j <= i; j++) {
      printf("x");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     11ab <main+0x9b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     1164 <main+0x54>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1191 <main+0x81>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <main+0x5b>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0x78,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 46)
%2 = tail call i32 @putchar(i32 46)
%3 = tail call i32 @putchar(i32 46)
%4 = tail call i32 @putchar(i32 46)
%5 = tail call i32 @putchar(i32 120)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @putchar(i32 46)
%8 = tail call i32 @putchar(i32 46)
%9 = tail call i32 @putchar(i32 46)
%10 = tail call i32 @putchar(i32 120)
%11 = tail call i32 @putchar(i32 120)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @putchar(i32 46)
%14 = tail call i32 @putchar(i32 46)
%15 = tail call i32 @putchar(i32 120)
%16 = tail call i32 @putchar(i32 120)
%17 = tail call i32 @putchar(i32 120)
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @putchar(i32 46)
%20 = tail call i32 @putchar(i32 120)
%21 = tail call i32 @putchar(i32 120)
%22 = tail call i32 @putchar(i32 120)
%23 = tail call i32 @putchar(i32 120)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @putchar(i32 120)
%26 = tail call i32 @putchar(i32 120)
%27 = tail call i32 @putchar(i32 120)
%28 = tail call i32 @putchar(i32 120)
%29 = tail call i32 @putchar(i32 120)
%30 = tail call i32 @putchar(i32 10)
ret i32 0
}