#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*/ log_printf(int, char *, char);
void printMultiZeichen(int breite, char beginEnd, char between) {
  log_printf(1, "  %c", beginEnd);
  int i = breite * breite + breite + 1;
  while (i) {
    log_printf(1, "%c", between);
    i--;
  }
  log_printf(1, "%c\n", beginEnd);
}


x86 assembly (clang, -O0):
<printMultiZeichen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    $0x1,%edi
lea    0xece(%rip),%rsi
movsbl -0x5(%rbp),%edx
call   1030 <log_printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1178 <printMultiZeichen+0x68>
mov    $0x1,%edi
lea    0xea1(%rip),%rsi
movsbl -0x6(%rbp),%edx
call   1030 <log_printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <printMultiZeichen+0x3b>
mov    $0x1,%edi
lea    0xe81(%rip),%rsi
movsbl -0x5(%rbp),%edx
call   1030 <log_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMultiZeichen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xeda(%rip),%rsi
mov    $0x1,%edi
mov    %r14d,%edx
call   1030 <log_printf@plt>
mov    %ebp,%ebx
imul   %ebp,%ebx
add    %ebp,%ebx
inc    %ebx
je     1164 <printMultiZeichen+0x54>
movsbl %r15b,%ebp
lea    0xeb9(%rip),%r15
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <log_printf@plt>
add    $0xffffffff,%ebx
jne    1150 <printMultiZeichen+0x40>
movsbl %r14b,%edx
lea    0xe96(%rip),%rsi
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <log_printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define void @printMultiZeichen(i32 %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @log_printf(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%5 = mul nsw i32 %0, %0
%6 = add i32 %0, 1
%7 = add i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %3, %9
%10 = phi i32 [ %12, %9 ], [ %7, %3 ]
%11 = tail call i32 @log_printf(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %2)
%12 = add nsw i32 %10, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %3
%15 = tail call i32 @log_printf(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %1)
ret void
}