#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*/ printBorder(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int breite = 6;
  int hoehe = 3;
  printBorder(breite);
  for (int rowHeight = 0; rowHeight < hoehe; rowHeight++) {
    printf("A");
    for (int rowWidth = 0; rowWidth < breite; rowWidth++) {
      printf("B");
    }
    printf("A\n");
  }
  printBorder(breite);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <printBorder@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ab <main+0x8b>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1191 <main+0x71>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <main+0x4b>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <main+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <printBorder@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6,%edi
call   1050 <printBorder@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
lea    0xe78(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x6,%edi
call   1050 <printBorder@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"A\00"
define i32 @main() {
%1 = tail call i32 @printBorder(i32 6)
%2 = tail call i32 @putchar(i32 65)
%3 = tail call i32 @putchar(i32 66)
%4 = tail call i32 @putchar(i32 66)
%5 = tail call i32 @putchar(i32 66)
%6 = tail call i32 @putchar(i32 66)
%7 = tail call i32 @putchar(i32 66)
%8 = tail call i32 @putchar(i32 66)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 65)
%11 = tail call i32 @putchar(i32 66)
%12 = tail call i32 @putchar(i32 66)
%13 = tail call i32 @putchar(i32 66)
%14 = tail call i32 @putchar(i32 66)
%15 = tail call i32 @putchar(i32 66)
%16 = tail call i32 @putchar(i32 66)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%18 = tail call i32 @putchar(i32 65)
%19 = tail call i32 @putchar(i32 66)
%20 = tail call i32 @putchar(i32 66)
%21 = tail call i32 @putchar(i32 66)
%22 = tail call i32 @putchar(i32 66)
%23 = tail call i32 @putchar(i32 66)
%24 = tail call i32 @putchar(i32 66)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @printBorder(i32 6)
ret i32 0
}