#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void pintar_rombo(int lado, char relleno) {
  int i, j, espais;
  for (i = 1; i <= lado; i = i + 2) {
    espais = (lado - i) / 2;
    for (j = 0; j < espais; j = j + 1) {
      fprintf(stdout, " ");
    }
    for (j = 0; j < i; j = j + 1) {
      fprintf(stdout, "%c", relleno);
    }
    fprintf(stdout, "\n");
  }
  for (i = lado - 2; i > 0; i = i - 2) {
    espais = (lado - i) / 2;
    for (j = 0; j < espais; j = j + 1) {
      fprintf(stdout, " ");
    }
    for (j = 0; j < i; j = j + 1) {
      fprintf(stdout, "%c", relleno);
    }
    fprintf(stdout, "\n");
  }
}


x86 assembly (clang, -O0):
<pintar_rombo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11de <pintar_rombo+0xce>
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117d <pintar_rombo+0x6d>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <pintar_rombo+0x3c>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b9 <pintar_rombo+0xa9>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
movsbl -0x5(%rbp),%edx
lea    0xe5e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1184 <pintar_rombo+0x74>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <pintar_rombo+0x18>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    129b <pintar_rombo+0x18b>
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123a <pintar_rombo+0x12a>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
lea    0xddb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1209 <pintar_rombo+0xf9>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1276 <pintar_rombo+0x166>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
movsbl -0x5(%rbp),%edx
lea    0xda1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1241 <pintar_rombo+0x131>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    11e7 <pintar_rombo+0xd7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pintar_rombo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
jle    126b <pintar_rombo+0x15b>
movsbl %sil,%ebp
mov    $0x1,%r12d
mov    0x2ea9(%rip),%r15
lea    0xec2(%rip),%rbx
lea    0xebd(%rip),%r13
mov    %rdi,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
sub    %r12d,%eax
cmp    $0x2,%eax
jl     1183 <pintar_rombo+0x73>
mov    %eax,%r14d
shr    $0x1f,%r14d
add    %eax,%r14d
sar    %r14d
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0xffffffff,%r14d
jne    1170 <pintar_rombo+0x60>
mov    %rbx,%r14
mov    %r12d,%ebx
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1190 <pintar_rombo+0x80>
mov    (%r15),%edi
lea    0xe57(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x2,%r12d
mov    0x8(%rsp),%rdi
cmp    %edi,%r12d
mov    %r14,%rbx
jle    1150 <pintar_rombo+0x40>
cmp    $0x3,%edi
jl     126b <pintar_rombo+0x15b>
mov    $0x1,%eax
lea    0xe25(%rip),%r14
lea    0xe20(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdi,0x8(%rsp)
lea    -0x2(%rdi),%ecx
mov    %ecx,0x10(%rsp)
mov    %eax,0x14(%rsp)
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1210 <pintar_rombo+0x100>
mov    $0x2,%r12d
mov    0x8(%rsp),%rbx
nopl   (%rax)
mov    (%r15),%edi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%r12d
cmp    %r12d,%ebx
jne    1230 <pintar_rombo+0x120>
mov    (%r15),%edi
lea    0xdb3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x14(%rsp),%eax
add    $0x1,%eax
cmp    $0x4,%ebx
mov    0x10(%rsp),%ecx
mov    %ecx,%edi
jg     11f0 <pintar_rombo+0xe0>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @pintar_rombo(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 1, i32* %5
br label %8
8: ; preds = %43, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %46
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
%16 = sdiv i32 %15, 2
store i32 %16, i32* %7
store i32 0, i32* %6
br label %17
17: ; preds = %24, %12
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32, i32* @stdout
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %21
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %17
27: ; preds = %17
store i32 0, i32* %6
br label %28
28: ; preds = %37, %27
%29 = load i32, i32* %6
%30 = load i32, i32* %5
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %40
32: ; preds = %28
%33 = load i32, i32* @stdout
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %32
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %28
40: ; preds = %28
%41 = load i32, i32* @stdout
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %40
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 2
store i32 %45, i32* %5
br label %8
46: ; preds = %8
%47 = load i32, i32* %3
%48 = sub nsw i32 %47, 2
store i32 %48, i32* %5
br label %49
49: ; preds = %83, %46
%50 = load i32, i32* %5
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %86
52: ; preds = %49
%53 = load i32, i32* %3
%54 = load i32, i32* %5
%55 = sub nsw i32 %53, %54
%56 = sdiv i32 %55, 2
store i32 %56, i32* %7
store i32 0, i32* %6
br label %57
57: ; preds = %64, %52
%58 = load i32, i32* %6
%59 = load i32, i32* %7
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %67
61: ; preds = %57
%62 = load i32, i32* @stdout
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %64
64: ; preds = %61
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %57
67: ; preds = %57
store i32 0, i32* %6
br label %68
68: ; preds = %77, %67
%69 = load i32, i32* %6
%70 = load i32, i32* %5
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %80
72: ; preds = %68
%73 = load i32, i32* @stdout
%74 = load i8, i8* %4
%75 = sext i8 %74 to i32
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %75)
br label %77
77: ; preds = %72
%78 = load i32, i32* %6
%79 = add nsw i32 %78, 1
store i32 %79, i32* %6
br label %68
80: ; preds = %68
%81 = load i32, i32* @stdout
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %83
83: ; preds = %80
%84 = load i32, i32* %5
%85 = sub nsw i32 %84, 2
store i32 %85, i32* %5
br label %49
86: ; preds = %49
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @pintar_rombo(i32 %0, i8 signext %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %56, label %4
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %10
6: ; preds = %28
%7 = icmp sgt i32 %0, 2
br i1 %7, label %8, label %56
8: ; preds = %6
%9 = sext i8 %1 to i32
br label %33
10: ; preds = %4, %28
%11 = phi i32 [ 1, %4 ], [ %31, %28 ]
%12 = sub nsw i32 %0, %11
%13 = sdiv i32 %12, 2
%14 = icmp sgt i32 %12, 1
br i1 %14, label %15, label %21
15: ; preds = %10, %15
%16 = phi i32 [ %19, %15 ], [ 0, %10 ]
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = add nuw nsw i32 %16, 1
%20 = icmp eq i32 %19, %13
br i1 %20, label %21, label %15
21: ; preds = %15, %10
br label %22
22: ; preds = %21, %22
%23 = phi i32 [ %26, %22 ], [ 0, %21 ]
%24 = load i32, i32* @stdout
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%26 = add nuw nsw i32 %23, 1
%27 = icmp eq i32 %26, %11
br i1 %27, label %28, label %22
28: ; preds = %22
%29 = load i32, i32* @stdout
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = add nuw nsw i32 %11, 2
%32 = icmp sgt i32 %31, %0
br i1 %32, label %6, label %10
33: ; preds = %51, %8
%34 = phi i32 [ %0, %8 ], [ %37, %51 ]
%35 = phi i32 [ 1, %8 ], [ %55, %51 ]
%36 = phi i32 [ %0, %8 ], [ %38, %51 ]
%37 = add i32 %34, -2
%38 = add nsw i32 %36, -2
br label %39
39: ; preds = %33, %39
%40 = phi i32 [ %43, %39 ], [ 0, %33 ]
%41 = load i32, i32* @stdout
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%43 = add nuw nsw i32 %40, 1
%44 = icmp eq i32 %43, %35
br i1 %44, label %45, label %39
45: ; preds = %39, %45
%46 = phi i32 [ %49, %45 ], [ 0, %39 ]
%47 = load i32, i32* @stdout
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%49 = add nuw nsw i32 %46, 1
%50 = icmp eq i32 %49, %37
br i1 %50, label %51, label %45
51: ; preds = %45
%52 = load i32, i32* @stdout
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%54 = icmp sgt i32 %36, 4
%55 = add nuw nsw i32 %35, 1
br i1 %54, label %33, label %56
56: ; preds = %51, %2, %6
ret void
}