#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 /*<<< orphan*/ schreibe_die_tage(int, int);
int /*<<< orphan*/ schreibe_linie(char *, int);
void schreibe_den_kalender(int startspalte, int anzahl_tage, int monat,
                           int jahr) {
  switch (monat) {
  case 1:
    printf("\nJanuar");
    break;
  case 2:
    printf("\nFebruar");
    break;
  case 3:
    printf("\nMärz");
    break;
  case 4:
    printf("\nApril");
    break;
  case 5:
    printf("\nMai");
    break;
  case 6:
    printf("\nJuni");
    break;
  case 7:
    printf("\nJuli");
    break;
  case 8:
    printf("\nAugust");
    break;
  case 9:
    printf("\nSeptember");
    break;
  case 10:
    printf("\nOktober");
    break;
  case 11:
    printf("\nNovember");
    break;
  case 12:
    printf("\nDezember");
    break;
  default:
    break;
  }
  printf(" %d\n", jahr);
  for (int i = 0; i < 7; i++) {
    switch (i) {
    case 0:
      printf("%4s", "So");
      break;
    case 1:
      printf("%4s", "Mo");
      break;
    case 2:
      printf("%4s", "Di");
      break;
    case 3:
      printf("%4s", "Mi");
      break;
    case 4:
      printf("%4s", "Do");
      break;
    case 5:
      printf("%4s", "Fr");
      break;
    case 6:
      printf("%4s", "Sa\n");
      break;
    default:
      break;
    }
  }
  char *zeichen = "=";
  schreibe_linie(zeichen, 30);
  schreibe_die_tage(startspalte, anzahl_tage);
  schreibe_linie(zeichen, 30);
}


x86 assembly (clang, -O0):
<schreibe_den_kalender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0xb,%eax
ja     1251 <schreibe_den_kalender+0x121>
mov    -0x28(%rbp),%rax
lea    0xe9c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <schreibe_den_kalender+0x126>
jmp    1256 <schreibe_den_kalender+0x126>
mov    -0x10(%rbp),%esi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    136b <schreibe_den_kalender+0x23b>
mov    -0x14(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0x6,%rax
ja     1353 <schreibe_den_kalender+0x223>
mov    -0x30(%rbp),%rax
lea    0xd9c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe0d(%rip),%rdi
lea    0xe0a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xdf3(%rip),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xdd9(%rip),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xdbf(%rip),%rdi
lea    0xdc5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xda5(%rip),%rdi
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xd8b(%rip),%rdi
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
lea    0xd71(%rip),%rdi
lea    0xd80(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1358 <schreibe_den_kalender+0x228>
jmp    1358 <schreibe_den_kalender+0x228>
jmp    135d <schreibe_den_kalender+0x22d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    126e <schreibe_den_kalender+0x13e>
lea    0xd59(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <schreibe_linie@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <schreibe_die_tage@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <schreibe_linie@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schreibe_den_kalender>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0xffffffff,%edx
cmp    $0xb,%edx
ja     115b <schreibe_den_kalender+0x2b>
movslq %edx,%rax
lea    0xf37(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rbx
lea    0xef0(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1050 <schreibe_linie@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <schreibe_die_tage@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <schreibe_linie@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0AJanuar\00"
@.str.1 = [9 x i8] c"\0AFebruar\00"
@.str.2 = [7 x i8] c"\0AM\C3\A4rz\00"
@.str.3 = [7 x i8] c"\0AApril\00"
@.str.4 = [5 x i8] c"\0AMai\00"
@.str.5 = [6 x i8] c"\0AJuni\00"
@.str.6 = [6 x i8] c"\0AJuli\00"
@.str.7 = [8 x i8] c"\0AAugust\00"
@.str.8 = [11 x i8] c"\0ASeptember\00"
@.str.9 = [9 x i8] c"\0AOktober\00"
@.str.10 = [10 x i8] c"\0ANovember\00"
@.str.11 = [10 x i8] c"\0ADezember\00"
@.str.12 = [5 x i8] c" %d\0A\00"
@.str.13 = [4 x i8] c"%4s\00"
@.str.14 = [3 x i8] c"So\00"
@.str.15 = [3 x i8] c"Mo\00"
@.str.16 = [3 x i8] c"Di\00"
@.str.17 = [3 x i8] c"Mi\00"
@.str.18 = [3 x i8] c"Do\00"
@.str.19 = [3 x i8] c"Fr\00"
@.str.20 = [4 x i8] c"Sa\0A\00"
@.str.21 = [2 x i8] c"=\00"
define void @schreibe_den_kalender(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
switch i32 %11, label %36 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
i32 5, label %20
i32 6, label %22
i32 7, label %24
i32 8, label %26
i32 9, label %28
i32 10, label %30
i32 11, label %32
i32 12, label %34
]
12: ; preds = %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %37
14: ; preds = %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %37
16: ; preds = %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %37
18: ; preds = %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %37
20: ; preds = %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %37
22: ; preds = %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %37
24: ; preds = %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %37
26: ; preds = %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %37
28: ; preds = %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %37
30: ; preds = %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
br label %37
32: ; preds = %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %37
34: ; preds = %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %37
36: ; preds = %4
br label %37
37: ; preds = %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12
%38 = load i32, i32* %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %38)
store i32 0, i32* %9
br label %40
40: ; preds = %61, %37
%41 = load i32, i32* %9
%42 = icmp slt i32 %41, 7
br i1 %42, label %43, label %64
43: ; preds = %40
%44 = load i32, i32* %9
switch i32 %44, label %59 [
i32 0, label %45
i32 1, label %47
i32 2, label %49
i32 3, label %51
i32 4, label %53
i32 5, label %55
i32 6, label %57
]
45: ; preds = %43
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
br label %60
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %60
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
br label %60
51: ; preds = %43
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
br label %60
53: ; preds = %43
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
br label %60
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
br label %60
57: ; preds = %43
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
br label %60
59: ; preds = %43
br label %60
60: ; preds = %59, %57, %55, %53, %51, %49, %47, %45
br label %61
61: ; preds = %60
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 1
store i32 %63, i32* %9
br label %40
64: ; preds = %40
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0), i8** %10
%65 = load i8*, i8** %10
%66 = call i32 @schreibe_linie(i8* %65, i32 30)
%67 = load i32, i32* %5
%68 = load i32, i32* %6
%69 = call i32 @schreibe_die_tage(i32 %67, i32 %68)
%70 = load i8*, i8** %10
%71 = call i32 @schreibe_linie(i8* %70, i32 30)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0AJanuar\00"
@.str.1 = [9 x i8] c"\0AFebruar\00"
@.str.2 = [7 x i8] c"\0AM\C3\A4rz\00"
@.str.3 = [7 x i8] c"\0AApril\00"
@.str.4 = [5 x i8] c"\0AMai\00"
@.str.5 = [6 x i8] c"\0AJuni\00"
@.str.6 = [6 x i8] c"\0AJuli\00"
@.str.7 = [8 x i8] c"\0AAugust\00"
@.str.8 = [11 x i8] c"\0ASeptember\00"
@.str.9 = [9 x i8] c"\0AOktober\00"
@.str.10 = [10 x i8] c"\0ANovember\00"
@.str.11 = [10 x i8] c"\0ADezember\00"
@.str.12 = [5 x i8] c" %d\0A\00"
@.str.13 = [4 x i8] c"%4s\00"
@.str.14 = [3 x i8] c"So\00"
@.str.15 = [3 x i8] c"Mo\00"
@.str.16 = [3 x i8] c"Di\00"
@.str.17 = [3 x i8] c"Mi\00"
@.str.18 = [3 x i8] c"Do\00"
@.str.19 = [3 x i8] c"Fr\00"
@.str.20 = [4 x i8] c"Sa\0A\00"
@.str.21 = [2 x i8] c"=\00"
@reltable.schreibe_den_kalender = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.schreibe_den_kalender to i64)) to i32)]
define void @schreibe_den_kalender(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %2, -1
%6 = icmp ult i32 %5, 12
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.schreibe_den_kalender to i8*), i64 %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %10)
br label %12
12: ; preds = %4, %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %3)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
%21 = tail call i32 @schreibe_linie(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0), i32 30)
%22 = tail call i32 @schreibe_die_tage(i32 %0, i32 %1)
%23 = tail call i32 @schreibe_linie(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0), i32 30)
ret void
}