#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*/ scanf(char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
int jahresliste() {
  int n = 0;
  int m = 0;
  int i;
  int jahr = 0;
  char ausgabe[100] = "";
  printf("Dieses Programm gibt aus, ob es sich bei den Jahren zwischen dem "
         "angegebenen Anfangs- und Endjahr um ein Schaltjahr handelt:\n\n");
  printf("Gib das Anfangsjahr ein:");
  scanf("%d", &n);
  printf("Nun gib das Endjahr ein:");
  scanf("%d", &m);
  printf("\nJahr  |  Schaltjahr ?\n");
  printf("---------------------\n");
  for (i = n; i <= m; i++) {
    jahr = i;
    if ((jahr % 4 == 0 && jahr % 100 != 0) ||
        (jahr % 4 == 0 && jahr % 100 == 0 && jahr % 400 == 0)) {
      strcpy(ausgabe, "  |  Ja");
    } else {
      strcpy(ausgabe, "  |  Nein");
    }
    printf("%i %s\n", jahr, ausgabe);
  }
  return 0;
}


x86 assembly (clang, -O0):
<jahresliste>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     129a <jahresliste+0x15a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1216 <jahresliste+0xd6>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1252 <jahresliste+0x112>
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1267 <jahresliste+0x127>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1267 <jahresliste+0x127>
mov    -0x10(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1267 <jahresliste+0x127>
lea    -0x80(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1277 <jahresliste+0x137>
lea    -0x80(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%esi
lea    -0x80(%rbp),%rdx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11dc <jahresliste+0x9c>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jahresliste>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6f(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
lea    0xefe(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%ebx
cmp    0x8(%rsp),%ebx
jle    1207 <jahresliste+0xc7>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe27(%rip),%r12
lea    0xe28(%rip),%r13
lea    0x10(%rsp),%r14
lea    0xe26(%rip),%r15
jmp    1252 <jahresliste+0x112>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0x8(%rsp),%ebx
mov    %eax,%ebx
jge    11f4 <jahresliste+0xb4>
movslq %ebx,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
mov    %rcx,%rsi
sar    $0x25,%rsi
add    %edx,%esi
imul   $0x64,%esi,%esi
mov    %eax,%edi
sub    %esi,%edi
and    $0x3,%eax
jne    127f <jahresliste+0x13f>
mov    %r12,%rsi
test   %edi,%edi
jne    1230 <jahresliste+0xf0>
or     %edi,%eax
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
mov    %ebx,%edx
sub    %ecx,%edx
or     %eax,%edx
mov    %r12,%rsi
je     1230 <jahresliste+0xf0>
mov    %r13,%rsi
jmp    1230 <jahresliste+0xf0>

LLVM IR (-O0):
@.str = [127 x i8] c"Dieses Programm gibt aus, ob es sich bei den Jahren zwischen dem angegebenen Anfangs- und Endjahr um ein Schaltjahr handelt:\0A\0A\00"
@.str.1 = [25 x i8] c"Gib das Anfangsjahr ein:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c"Nun gib das Endjahr ein:\00"
@.str.4 = [24 x i8] c"\0AJahr | Schaltjahr ?\0A\00"
@.str.5 = [23 x i8] c"---------------------\0A\00"
@.str.6 = [8 x i8] c" | Ja\00"
@.str.7 = [10 x i8] c" | Nein\00"
@.str.8 = [7 x i8] c"%i %s\0A\00"
define i32 @jahresliste() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %4
%6 = bitcast [100 x i8]* %5 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* %1
store i32 %14, i32* %3
br label %15
15: ; preds = %50, %0
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %53
19: ; preds = %15
%20 = load i32, i32* %3
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = srem i32 %21, 4
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = load i32, i32* %4
%26 = srem i32 %25, 100
%27 = icmp ne i32 %26, 0
br i1 %27, label %40, label %28
28: ; preds = %24, %19
%29 = load i32, i32* %4
%30 = srem i32 %29, 4
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %43
32: ; preds = %28
%33 = load i32, i32* %4
%34 = srem i32 %33, 100
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load i32, i32* %4
%38 = srem i32 %37, 400
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %36, %24
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %46
43: ; preds = %36, %32, %28
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %4
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %47, i8* %48)
br label %50
50: ; preds = %46
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %15
53: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Gib das Anfangsjahr ein:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c"Nun gib das Endjahr ein:\00"
@.str.6 = [8 x i8] c" | Ja\00"
@.str.7 = [10 x i8] c" | Nein\00"
@.str.8 = [7 x i8] c"%i %s\0A\00"
@str = [126 x i8] c"Dieses Programm gibt aus, ob es sich bei den Jahren zwischen dem angegebenen Anfangs- und Endjahr um ein Schaltjahr handelt:\0A\00"
@str.9 = [23 x i8] c"\0AJahr | Schaltjahr ?\00"
@str.10 = [22 x i8] c"---------------------\00"
define i32 @jahresliste() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.9, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %38, label %17
17: ; preds = %0, %31
%18 = phi i32 [ %35, %31 ], [ %14, %0 ]
%19 = and i32 %18, 3
%20 = icmp ne i32 %19, 0
%21 = srem i32 %18, 100
%22 = icmp eq i32 %21, 0
%23 = or i1 %20, %22
br i1 %23, label %24, label %31
24: ; preds = %17
%25 = or i32 %19, %21
%26 = icmp eq i32 %25, 0
%27 = srem i32 %18, 400
%28 = icmp eq i32 %27, 0
%29 = select i1 %26, i1 %28, i1 false
%30 = select i1 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0)
br label %31
31: ; preds = %24, %17
%32 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %17 ], [ %30, %24 ]
%33 = call i32 @strcpy(i8* %6, i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %18, i8* %6)
%35 = add nsw i32 %18, 1
%36 = load i32, i32* %2
%37 = icmp slt i32 %18, %36
br i1 %37, label %17, label %38
38: ; preds = %31, %0
ret i32 0
}