#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*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, unsigned int *, unsigned int *, unsigned int *);
int /*<<< orphan*/ stdin;
int main(void) {
  char input, run = 1;
  unsigned int days, months, years;
  unsigned int nday, nmonth, nyear, ok = 1;
  printf("Folgedatum zu einem Datum\n");
  printf("=========================\n");
  printf("Druecke 'q' zum beenden\n");
  while (run) {
    printf("\nDieses Programm liest ein Kalender-Datum ein, und gibt dann\n");
    printf("das Datum des nachfolgenden Tages aus.\n\n");
    printf("Gib ein Datum ein (tt.mm.jjj): ");
    int res = scanf("%2u.%2u.%4u", &days, &months, &years);
    if (!res) {
      printf("Keine gueltige Datumseingabe erkannt.\n");
      input = getchar();
      if (input == 'q' || input == 'Q')
        run = 0;
      fflush(stdin);
      continue;
    }
    nday = days;
    nmonth = months;
    nyear = years;
    if (months > 12)
      ok = 0;
    else
      switch (days) {
      case 28:
        if (months == 2) {
          if ((!(years % 4) && years % 100) || !(years % 400))
            nday++;
          else {
            nday = 1;
            nmonth++;
          }
        } else
          nday++;
        break;
      case 29:
        if (months == 2) {
          if (!(years % 4) && years % 100 || !(years % 400)) {
            nmonth++;
            nday = 1;
          } else
            ok = 0;
        } else
          nday++;
        break;
      case 30:
        if (months == 1 || months == 3 || months == 5 || months == 7 ||
            months == 8 || months == 10 || months == 12)
          nday++;
        else {
          nmonth++;
          nday = 1;
        }
        break;
      case 31:
        if (months == 2 || months == 4 || months == 6 || months == 9 ||
            months == 11)
          ok = 0;
        else if (months == 12) {
          nyear++;
          nmonth = 1;
          nday = 1;
        } else {
          nmonth++;
          nday = 1;
        }
        break;
      default:
        if (days < 28)
          nday++;
        else
          ok = 0;
        break;
      }
    if (ok)
      printf("%2u.%2u.%4u ---> %2u.%2u.%4u", days, months, years, nday, nmonth,
             nyear);
    else
      printf("%2u.%2u.%4u ist kein gueltiges Datum.\n", days, months, years);
  }
  printf("Die Anwendung wurde vom Benutzer beendet.");
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x6(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpb   $0x0,-0x6(%rbp)
je     14bd <main+0x37d>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5f(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1060 <scanf@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    1226 <main+0xe6>
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     120f <main+0xcf>
movsbl -0x5(%rbp),%eax
cmp    $0x51,%eax
jne    1213 <main+0xd3>
movb   $0x0,-0x6(%rbp)
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1184 <main+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0xc,-0x10(%rbp)
jbe    124e <main+0x10e>
movl   $0x0,-0x24(%rbp)
jmp    146d <main+0x32d>
mov    -0xc(%rbp),%eax
add    $0xffffffe4,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x3,%eax
ja     1444 <main+0x304>
mov    -0x30(%rbp),%rax
lea    0xd92(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x2,-0x10(%rbp)
jne    12dd <main+0x19d>
mov    -0x14(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    12a5 <main+0x165>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    12ba <main+0x17a>
mov    -0x14(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    12c8 <main+0x188>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12d8 <main+0x198>
movl   $0x1,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12e6 <main+0x1a6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1468 <main+0x328>
cmpl   $0x2,-0x10(%rbp)
jne    134f <main+0x20f>
mov    -0x14(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1319 <main+0x1d9>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    132e <main+0x1ee>
mov    -0x14(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1343 <main+0x203>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    134a <main+0x20a>
movl   $0x0,-0x24(%rbp)
jmp    1358 <main+0x218>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1468 <main+0x328>
cmpl   $0x1,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0x3,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0x5,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0x7,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0x8,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0xa,-0x10(%rbp)
je     13a3 <main+0x263>
cmpl   $0xc,-0x10(%rbp)
jne    13b1 <main+0x271>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13c1 <main+0x281>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    1468 <main+0x328>
cmpl   $0x2,-0x10(%rbp)
je     13f8 <main+0x2b8>
cmpl   $0x4,-0x10(%rbp)
je     13f8 <main+0x2b8>
cmpl   $0x6,-0x10(%rbp)
je     13f8 <main+0x2b8>
cmpl   $0x9,-0x10(%rbp)
je     13f8 <main+0x2b8>
cmpl   $0xb,-0x10(%rbp)
jne    1404 <main+0x2c4>
movl   $0x0,-0x24(%rbp)
jmp    143f <main+0x2ff>
cmpl   $0xc,-0x10(%rbp)
jne    142a <main+0x2ea>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    143a <main+0x2fa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
jmp    143f <main+0x2ff>
jmp    1468 <main+0x328>
cmpl   $0x1c,-0xc(%rbp)
jae    145c <main+0x31c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1463 <main+0x323>
movl   $0x0,-0x24(%rbp)
jmp    1468 <main+0x328>
jmp    146d <main+0x32d>
cmpl   $0x0,-0x24(%rbp)
je     14a1 <main+0x361>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
lea    0xc7b(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14b8 <main+0x378>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <main+0x44>
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r15d
lea    0x14(%rsp),%r13
lea    0x10(%rsp),%rbp
lea    0xc(%rsp),%r14
mov    0x2e4a(%rip),%rbx
jmp    11cb <main+0x7b>
lea    0xfa8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x51,%al
setne  %r12b
mov    (%rbx),%edi
call   1060 <fflush@plt>
test   %r12b,%r12b
je     13bd <main+0x26d>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
lea    0xe26(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
call   1070 <scanf@plt>
test   %eax,%eax
je     11a0 <main+0x50>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
cmp    $0xc,%edx
ja     13a0 <main+0x250>
lea    -0x1c(%rsi),%eax
cmp    $0x3,%eax
ja     1303 <main+0x1b3>
lea    0xdce(%rip),%rdi
movslq (%rdi,%rax,4),%rax
add    %rdi,%rax
jmp    *%rax
mov    $0x1d,%r8d
cmp    $0x2,%edx
jne    1310 <main+0x1c0>
test   $0x3,%cl
jne    1273 <main+0x123>
mov    %ecx,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%r10d
mov    %ecx,%edi
mov    $0x2,%r9d
mov    %ecx,%eax
sub    %r10d,%edi
jne    137c <main+0x22c>
imul   $0xc28f5c29,%ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
mov    $0x1,%r8d
mov    $0x1d,%eax
cmovb  %eax,%r8d
mov    $0x3,%r9d
sbb    $0x0,%r9d
jmp    137a <main+0x22a>
cmp    $0xc,%edx
ja     1370 <main+0x220>
mov    $0x1f,%r8d
mov    $0x15aa,%eax
bt     %edx,%eax
mov    %edx,%r9d
mov    %ecx,%eax
jb     137c <main+0x22c>
jmp    1370 <main+0x220>
cmp    $0xc,%edx
ja     1370 <main+0x220>
mov    $0xa54,%eax
bt     %edx,%eax
jb     13a0 <main+0x250>
cmp    $0xc,%edx
jne    1370 <main+0x220>
lea    0x1(%rcx),%eax
mov    $0x1,%r8d
mov    $0x1,%r9d
test   %r15d,%r15d
jne    1381 <main+0x231>
jmp    13a0 <main+0x250>
cmp    $0x1b,%esi
ja     13a0 <main+0x250>
lea    0x1(%rsi),%r8d
mov    %edx,%r9d
jmp    137a <main+0x22a>
mov    $0x1e,%r8d
mov    %edx,%r9d
mov    %ecx,%eax
cmp    $0x2,%edx
jne    137c <main+0x22c>
mov    %rbx,%r10
test   $0x3,%cl
sete   %al
imul   $0xc28f5c29,%ecx,%edi
ror    $0x2,%edi
cmp    $0x28f5c29,%edi
setae  %bl
mov    $0x3,%r9d
mov    $0x1,%r8d
test   %bl,%al
jne    1394 <main+0x244>
mov    %ecx,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x27,%rax
imul   $0x190,%eax,%edi
mov    %ecx,%ebx
mov    %ecx,%eax
sub    %edi,%ebx
mov    %r10,%rbx
jne    13a0 <main+0x250>
jmp    137c <main+0x22c>
lea    0x1(%rdx),%r9d
mov    $0x1,%r8d
mov    %ecx,%eax
test   %r15d,%r15d
je     13a0 <main+0x250>
mov    %eax,(%rsp)
lea    0xca5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    13b1 <main+0x261>
mov    %ecx,%eax
mov    %r10,%rbx
test   %r15d,%r15d
jne    1381 <main+0x231>
xchg   %ax,%ax
xor    %r15d,%r15d
lea    0xca3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r12b
test   %r12b,%r12b
jne    11cb <main+0x7b>
lea    0xcb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Folgedatum zu einem Datum\0A\00"
@.str.1 = [27 x i8] c"=========================\0A\00"
@.str.2 = [25 x i8] c"Druecke 'q' zum beenden\0A\00"
@.str.3 = [62 x i8] c"\0ADieses Programm liest ein Kalender-Datum ein, und gibt dann\0A\00"
@.str.4 = [41 x i8] c"das Datum des nachfolgenden Tages aus.\0A\0A\00"
@.str.5 = [32 x i8] c"Gib ein Datum ein (tt.mm.jjj): \00"
@.str.6 = [12 x i8] c"%2u.%2u.%4u\00"
@.str.7 = [39 x i8] c"Keine gueltige Datumseingabe erkannt.\0A\00"
@stdin = global i32 0
@.str.8 = [29 x i8] c"%2u.%2u.%4u ---> %2u.%2u.%4u\00"
@.str.9 = [39 x i8] c"%2u.%2u.%4u ist kein gueltiges Datum.\0A\00"
@.str.10 = [42 x i8] c"Die Anwendung wurde vom Benutzer beendet.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i8 1, i8* %3
store i32 1, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %178, %36, %0
%16 = load i8, i8* %3
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %179
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
store i32 %22, i32* %11
%23 = load i32, i32* %11
%24 = icmp ne i32 %23, 0
br i1 %24, label %39, label %25
25: ; preds = %18
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
%27 = call signext i8 (...) @getchar()
store i8 %27, i8* %2
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 113
br i1 %30, label %35, label %31
31: ; preds = %25
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 81
br i1 %34, label %35, label %36
35: ; preds = %31, %25
store i8 0, i8* %3
br label %36
36: ; preds = %35, %31
%37 = load i32, i32* @stdin
%38 = call i32 @fflush(i32 %37)
br label %15
39: ; preds = %18
%40 = load i32, i32* %4
store i32 %40, i32* %7
%41 = load i32, i32* %5
store i32 %41, i32* %8
%42 = load i32, i32* %6
store i32 %42, i32* %9
%43 = load i32, i32* %5
%44 = icmp ugt i32 %43, 12
br i1 %44, label %45, label %46
45: ; preds = %39
store i32 0, i32* %10
br label %162
46: ; preds = %39
%47 = load i32, i32* %4
switch i32 %47, label %153 [
i32 28, label %48
i32 29, label %74
i32 30, label %98
i32 31, label %126
]
48: ; preds = %46
%49 = load i32, i32* %5
%50 = icmp eq i32 %49, 2
br i1 %50, label %51, label %70
51: ; preds = %48
%52 = load i32, i32* %6
%53 = urem i32 %52, 4
%54 = icmp ne i32 %53, 0
br i1 %54, label %59, label %55
55: ; preds = %51
%56 = load i32, i32* %6
%57 = urem i32 %56, 100
%58 = icmp ne i32 %57, 0
br i1 %58, label %63, label %59
59: ; preds = %55, %51
%60 = load i32, i32* %6
%61 = urem i32 %60, 400
%62 = icmp ne i32 %61, 0
br i1 %62, label %66, label %63
63: ; preds = %59, %55
%64 = load i32, i32* %7
%65 = add i32 %64, 1
store i32 %65, i32* %7
br label %69
66: ; preds = %59
store i32 1, i32* %7
%67 = load i32, i32* %8
%68 = add i32 %67, 1
store i32 %68, i32* %8
br label %69
69: ; preds = %66, %63
br label %73
70: ; preds = %48
%71 = load i32, i32* %7
%72 = add i32 %71, 1
store i32 %72, i32* %7
br label %73
73: ; preds = %70, %69
br label %161
74: ; preds = %46
%75 = load i32, i32* %5
%76 = icmp eq i32 %75, 2
br i1 %76, label %77, label %94
77: ; preds = %74
%78 = load i32, i32* %6
%79 = urem i32 %78, 4
%80 = icmp ne i32 %79, 0
br i1 %80, label %85, label %81
81: ; preds = %77
%82 = load i32, i32* %6
%83 = urem i32 %82, 100
%84 = icmp ne i32 %83, 0
br i1 %84, label %89, label %85
85: ; preds = %81, %77
%86 = load i32, i32* %6
%87 = urem i32 %86, 400
%88 = icmp ne i32 %87, 0
br i1 %88, label %92, label %89
89: ; preds = %85, %81
%90 = load i32, i32* %8
%91 = add i32 %90, 1
store i32 %91, i32* %8
store i32 1, i32* %7
br label %93
92: ; preds = %85
store i32 0, i32* %10
br label %93
93: ; preds = %92, %89
br label %97
94: ; preds = %74
%95 = load i32, i32* %7
%96 = add i32 %95, 1
store i32 %96, i32* %7
br label %97
97: ; preds = %94, %93
br label %161
98: ; preds = %46
%99 = load i32, i32* %5
%100 = icmp eq i32 %99, 1
br i1 %100, label %119, label %101
101: ; preds = %98
%102 = load i32, i32* %5
%103 = icmp eq i32 %102, 3
br i1 %103, label %119, label %104
104: ; preds = %101
%105 = load i32, i32* %5
%106 = icmp eq i32 %105, 5
br i1 %106, label %119, label %107
107: ; preds = %104
%108 = load i32, i32* %5
%109 = icmp eq i32 %108, 7
br i1 %109, label %119, label %110
110: ; preds = %107
%111 = load i32, i32* %5
%112 = icmp eq i32 %111, 8
br i1 %112, label %119, label %113
113: ; preds = %110
%114 = load i32, i32* %5
%115 = icmp eq i32 %114, 10
br i1 %115, label %119, label %116
116: ; preds = %113
%117 = load i32, i32* %5
%118 = icmp eq i32 %117, 12
br i1 %118, label %119, label %122
119: ; preds = %116, %113, %110, %107, %104, %101, %98
%120 = load i32, i32* %7
%121 = add i32 %120, 1
store i32 %121, i32* %7
br label %125
122: ; preds = %116
%123 = load i32, i32* %8
%124 = add i32 %123, 1
store i32 %124, i32* %8
store i32 1, i32* %7
br label %125
125: ; preds = %122, %119
br label %161
126: ; preds = %46
%127 = load i32, i32* %5
%128 = icmp eq i32 %127, 2
br i1 %128, label %141, label %129
129: ; preds = %126
%130 = load i32, i32* %5
%131 = icmp eq i32 %130, 4
br i1 %131, label %141, label %132
132: ; preds = %129
%133 = load i32, i32* %5
%134 = icmp eq i32 %133, 6
br i1 %134, label %141, label %135
135: ; preds = %132
%136 = load i32, i32* %5
%137 = icmp eq i32 %136, 9
br i1 %137, label %141, label %138
138: ; preds = %135
%139 = load i32, i32* %5
%140 = icmp eq i32 %139, 11
br i1 %140, label %141, label %142
141: ; preds = %138, %135, %132, %129, %126
store i32 0, i32* %10
br label %152
142: ; preds = %138
%143 = load i32, i32* %5
%144 = icmp eq i32 %143, 12
br i1 %144, label %145, label %148
145: ; preds = %142
%146 = load i32, i32* %9
%147 = add i32 %146, 1
store i32 %147, i32* %9
store i32 1, i32* %8
store i32 1, i32* %7
br label %151
148: ; preds = %142
%149 = load i32, i32* %8
%150 = add i32 %149, 1
store i32 %150, i32* %8
store i32 1, i32* %7
br label %151
151: ; preds = %148, %145
br label %152
152: ; preds = %151, %141
br label %161
153: ; preds = %46
%154 = load i32, i32* %4
%155 = icmp ult i32 %154, 28
br i1 %155, label %156, label %159
156: ; preds = %153
%157 = load i32, i32* %7
%158 = add i32 %157, 1
store i32 %158, i32* %7
br label %160
159: ; preds = %153
store i32 0, i32* %10
br label %160
160: ; preds = %159, %156
br label %161
161: ; preds = %160, %152, %125, %97, %73
br label %162
162: ; preds = %161, %45
%163 = load i32, i32* %10
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %173
165: ; preds = %162
%166 = load i32, i32* %4
%167 = load i32, i32* %5
%168 = load i32, i32* %6
%169 = load i32, i32* %7
%170 = load i32, i32* %8
%171 = load i32, i32* %9
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %166, i32 %167, i32 %168, i32 %169, i32 %170, i32 %171)
br label %178
173: ; preds = %162
%174 = load i32, i32* %4
%175 = load i32, i32* %5
%176 = load i32, i32* %6
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %174, i32 %175, i32 %176)
br label %178
178: ; preds = %173, %165
br label %15
179: ; preds = %15
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%181 = load i32, i32* @stdin
%182 = call i32 @fflush(i32 %181)
%183 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.5 = [32 x i8] c"Gib ein Datum ein (tt.mm.jjj): \00"
@.str.6 = [12 x i8] c"%2u.%2u.%4u\00"
@stdin = global i32 0
@.str.8 = [29 x i8] c"%2u.%2u.%4u ---> %2u.%2u.%4u\00"
@.str.9 = [39 x i8] c"%2u.%2u.%4u ist kein gueltiges Datum.\0A\00"
@.str.10 = [42 x i8] c"Die Anwendung wurde vom Benutzer beendet.\00"
@str = [26 x i8] c"Folgedatum zu einem Datum\00"
@str.11 = [26 x i8] c"=========================\00"
@str.12 = [24 x i8] c"Druecke 'q' zum beenden\00"
@str.13 = [61 x i8] c"\0ADieses Programm liest ein Kalender-Datum ein, und gibt dann\00"
@str.14 = [40 x i8] c"das Datum des nachfolgenden Tages aus.\0A\00"
@str.15 = [38 x i8] c"Keine gueltige Datumseingabe erkannt.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
br label %10
10: ; preds = %0, %75
%11 = phi i32 [ 1, %0 ], [ %77, %75 ]
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.13, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.14, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %10
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%19 = call signext i8 (...) @getchar()
%20 = and i8 %19, -33
%21 = icmp ne i8 %20, 81
%22 = zext i1 %21 to i8
%23 = load i32, i32* @stdin
%24 = call i32 @fflush(i32 %23)
br label %75
25: ; preds = %10
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp ugt i32 %27, 12
br i1 %29, label %73, label %30
30: ; preds = %25
switch i32 %26, label %63 [
i32 28, label %31
i32 29, label %44
i32 30, label %55
i32 31, label %58
]
31: ; preds = %30
%32 = icmp eq i32 %27, 2
br i1 %32, label %33, label %66
33: ; preds = %31
%34 = and i32 %28, 3
%35 = icmp ne i32 %34, 0
%36 = urem i32 %28, 100
%37 = icmp eq i32 %36, 0
%38 = or i1 %35, %37
br i1 %38, label %39, label %66
39: ; preds = %33
%40 = urem i32 %28, 400
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i32 29, i32 1
%43 = select i1 %41, i32 2, i32 3
br label %66
44: ; preds = %30
%45 = icmp eq i32 %27, 2
br i1 %45, label %46, label %66
46: ; preds = %44
%47 = and i32 %28, 3
%48 = icmp eq i32 %47, 0
%49 = urem i32 %28, 100
%50 = icmp ne i32 %49, 0
%51 = and i1 %48, %50
%52 = urem i32 %28, 400
%53 = icmp eq i32 %52, 0
%54 = select i1 %51, i1 true, i1 %53
br i1 %54, label %66, label %73
55: ; preds = %30
switch i32 %27, label %56 [
i32 12, label %66
i32 10, label %66
i32 8, label %66
i32 7, label %66
i32 5, label %66
i32 3, label %66
i32 1, label %66
]
56: ; preds = %55
%57 = add nuw nsw i32 %27, 1
br label %66
58: ; preds = %30
switch i32 %27, label %61 [
i32 11, label %73
i32 9, label %73
i32 6, label %73
i32 4, label %73
i32 2, label %73
i32 12, label %59
]
59: ; preds = %58
%60 = add i32 %28, 1
br label %66
61: ; preds = %58
%62 = add nuw nsw i32 %27, 1
br label %66
63: ; preds = %30
%64 = icmp ult i32 %26, 28
%65 = add i32 %26, 1
br i1 %64, label %66, label %73
66: ; preds = %63, %39, %55, %55, %55, %55, %55, %55, %55, %44, %46, %31, %33, %56, %59, %61
%67 = phi i32 [ 1, %59 ], [ 1, %61 ], [ 1, %56 ], [ 29, %33 ], [ 29, %31 ], [ 1, %46 ], [ 30, %44 ], [ 31, %55 ], [ 31, %55 ], [ 31, %55 ], [ 31, %55 ], [ 31, %55 ], [ 31, %55 ], [ 31, %55 ], [ %42, %39 ], [ %65, %63 ]
%68 = phi i32 [ 1, %59 ], [ %62, %61 ], [ %57, %56 ], [ 2, %33 ], [ %27, %31 ], [ 3, %46 ], [ %27, %44 ], [ %27, %55 ], [ %27, %55 ], [ %27, %55 ], [ %27, %55 ], [ %27, %55 ], [ %27, %55 ], [ %27, %55 ], [ %43, %39 ], [ %27, %63 ]
%69 = phi i32 [ %60, %59 ], [ %28, %61 ], [ %28, %56 ], [ %28, %33 ], [ %28, %31 ], [ %28, %46 ], [ %28, %44 ], [ %28, %55 ], [ %28, %55 ], [ %28, %55 ], [ %28, %55 ], [ %28, %55 ], [ %28, %55 ], [ %28, %55 ], [ %28, %39 ], [ %28, %63 ]
%70 = icmp eq i32 %11, 0
br i1 %70, label %73, label %71
71: ; preds = %66
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %26, i32 %27, i32 %28, i32 %67, i32 %68, i32 %69)
br label %75
73: ; preds = %46, %63, %58, %58, %58, %58, %58, %25, %66
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i32 %26, i32 %27, i32 %28)
br label %75
75: ; preds = %71, %73, %17
%76 = phi i8 [ %22, %17 ], [ 1, %73 ], [ 1, %71 ]
%77 = phi i32 [ %11, %17 ], [ 0, %73 ], [ %11, %71 ]
%78 = icmp eq i8 %76, 0
br i1 %78, label %79, label %10
79: ; preds = %75
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%81 = load i32, i32* @stdin
%82 = call i32 @fflush(i32 %81)
%83 = call signext i8 (...) @getchar()
ret i32 0
}