#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*/ printZeile(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int starcounter;
  starcounter = 1;
  printf("Please insert n: ");
  scanf("%i", &n);
  for (int i = 1; i <= n; ++i) {
    printZeile(n - i, starcounter);
    starcounter += 2;
  }
  starcounter -= 2;
  for (int i = (n - 1); i > 0; --i) {
    starcounter -= 2;
    printZeile((n - i), starcounter);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     119a <main+0x6a>
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <printZeile@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <main+0x39>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11db <main+0xab>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <printZeile@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11ac <main+0x7c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    11cd <main+0x9d>
mov    $0xfffffffb,%r14d
xor    %r15d,%r15d
mov    $0xffffffff,%ebp
nopw   0x0(%rax,%rax,1)
lea    0x6(%r14),%esi
add    %ebp,%ebx
mov    %ebx,%edi
call   1050 <printZeile@plt>
mov    0x4(%rsp),%ebx
add    $0x2,%r14d
add    $0x1,%r15d
add    $0xffffffff,%ebp
cmp    %r15d,%ebx
jg     1170 <main+0x40>
cmp    $0x2,%ebx
jl     11cd <main+0x9d>
lea    0x2(%r14),%esi
mov    $0x1,%edi
call   1050 <printZeile@plt>
cmp    $0x2,%ebx
je     11cd <main+0x9d>
mov    $0x2,%ebp
sub    %ebx,%ebp
mov    0x4(%rsp),%edi
add    %ebp,%edi
mov    %r14d,%esi
call   1050 <printZeile@plt>
add    $0xfffffffe,%r14d
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jg     11b0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Please insert n: \00"
@.str.1 = [3 x i8] c"%i\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 1, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 1, i32* %4
br label %8
8: ; preds = %20, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = load i32, i32* %3
%17 = call i32 @printZeile(i32 %15, i32 %16)
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 2
store i32 %19, i32* %3
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %8
23: ; preds = %8
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 2
store i32 %25, i32* %3
%26 = load i32, i32* %2
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %39, %23
%29 = load i32, i32* %5
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %28
%32 = load i32, i32* %3
%33 = sub nsw i32 %32, 2
store i32 %33, i32* %3
%34 = load i32, i32* %2
%35 = load i32, i32* %5
%36 = sub nsw i32 %34, %35
%37 = load i32, i32* %3
%38 = call i32 @printZeile(i32 %36, i32 %37)
br label %39
39: ; preds = %31
%40 = load i32, i32* %5
%41 = add nsw i32 %40, -1
store i32 %41, i32* %5
br label %28
42: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Please insert n: \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %25, label %15
7: ; preds = %15
%8 = icmp sgt i32 %23, 1
br i1 %8, label %9, label %25
9: ; preds = %7
%10 = add nsw i32 %18, -2
%11 = call i32 @printZeile(i32 1, i32 %10)
%12 = icmp eq i32 %23, 2
br i1 %12, label %25, label %13
13: ; preds = %9
%14 = add nsw i32 %23, -1
br label %26
15: ; preds = %0, %15
%16 = phi i32 [ %23, %15 ], [ %5, %0 ]
%17 = phi i32 [ %22, %15 ], [ 1, %0 ]
%18 = phi i32 [ %21, %15 ], [ 1, %0 ]
%19 = sub nsw i32 %16, %17
%20 = call i32 @printZeile(i32 %19, i32 %18)
%21 = add nuw nsw i32 %18, 2
%22 = add nuw nsw i32 %17, 1
%23 = load i32, i32* %1
%24 = icmp sgt i32 %23, %17
br i1 %24, label %15, label %7
25: ; preds = %26, %9, %0, %7
ret i32 0
26: ; preds = %13, %26
%27 = phi i32 [ %10, %13 ], [ %31, %26 ]
%28 = phi i32 [ %14, %13 ], [ %30, %26 ]
%29 = load i32, i32* %1
%30 = add nsw i32 %28, -1
%31 = add nsw i32 %27, -2
%32 = sub nsw i32 %29, %30
%33 = call i32 @printZeile(i32 %32, i32 %31)
%34 = icmp sgt i32 %28, 2
br i1 %34, label %26, label %25
}