#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  int jahr;
  printf("Bitte Jahr eingeben:");
  scanf("%d", &jahr);
  if (jahr % 400 == 0) {
    printf("Jahr ist Schaltjahr");
  } else {
    if (jahr % 4 == 0 && jahr % 100 != 0) {
      printf("Jahr ist Schaltjahr");
    } else {
      printf("Jahr ist kein Schaltjahr");
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1192 <main+0x62>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    11dc <main+0xac>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11cb <main+0x9b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0x9b>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
jmp    11d7 <main+0xa7>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
jmp    11dc <main+0xac>
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
imul   $0xc28f5c29,%eax,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x4,%edx
cmp    $0xa3d70b,%edx
jb     119e <main+0x6e>
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
lea    0xea1(%rip),%rcx
lea    0xe86(%rip),%rdi
cmovb  %rcx,%rdi
test   $0x3,%al
cmovne %rcx,%rdi
jmp    11a5 <main+0x75>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [21 x i8] c"Bitte Jahr eingeben:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Jahr ist Schaltjahr\00"
@.str.3 = [25 x i8] c"Jahr ist kein Schaltjahr\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = srem i32 %7, 400
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %25
12: ; preds = %0
%13 = load i32, i32* %2
%14 = srem i32 %13, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i32, i32* %2
%18 = srem i32 %17, 100
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %24
22: ; preds = %16, %12
%23 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %10
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [21 x i8] c"Bitte Jahr eingeben:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Jahr ist Schaltjahr\00"
@.str.3 = [25 x i8] c"Jahr ist kein Schaltjahr\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = srem i32 %7, 400
%9 = icmp eq i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %0
%11 = and i32 %7, 3
%12 = icmp ne i32 %11, 0
%13 = srem i32 %7, 100
%14 = icmp eq i32 %13, 0
%15 = or i1 %12, %14
%16 = select i1 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0)
br label %17
17: ; preds = %10, %0
%18 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), %0 ], [ %16, %10 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}