#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, int);
void wieviele_jahre_und_monate(int anzahl_lottoziehungen) {
  int jahre = anzahl_lottoziehungen / 52;
  int monate = (anzahl_lottoziehungen % 52) / 4;
  if (monate == 12) {
    jahre = jahre + 1;
    monate = 0;
  }
  printf("\nDie erzeugten Lottoziehungen entsprechen in etwa %d Jahre und %d "
         "Monate Lottospielens.\n",
         jahre, monate);
}


x86 assembly (clang, -O0):
<wieviele_jahre_und_monate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x34,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x34,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jne    115b <wieviele_jahre_und_monate+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wieviele_jahre_und_monate>:
movslq %edi,%rcx
imul   $0x4ec4ec4f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rax
add    %edx,%eax
imul   $0x34,%eax,%edx
sub    %edx,%ecx
mov    %ecx,%edx
sar    $0x7,%dl
shr    $0x6,%dl
add    %cl,%dl
sar    $0x2,%dl
movsbl %dl,%edi
and    $0xfffffffc,%ecx
xor    %edx,%edx
xor    %esi,%esi
cmp    $0x30,%ecx
sete   %sil
cmovne %edi,%edx
add    %eax,%esi
lea    0xeaa(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"\0ADie erzeugten Lottoziehungen entsprechen in etwa %d Jahre und %d Monate Lottospielens.\0A\00"
define void @wieviele_jahre_und_monate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 52
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 52
%9 = sdiv i32 %8, 4
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 12
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
store i32 0, i32* %4
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"\0ADie erzeugten Lottoziehungen entsprechen in etwa %d Jahre und %d Monate Lottospielens.\0A\00"
define void @wieviele_jahre_und_monate(i32 %0) {
%2 = sdiv i32 %0, 52
%3 = srem i32 %0, 52
%4 = trunc i32 %3 to i8
%5 = sdiv i8 %4, 4
%6 = sext i8 %5 to i32
%7 = and i32 %3, -4
%8 = icmp eq i32 %7, 48
%9 = zext i1 %8 to i32
%10 = add nsw i32 %2, %9
%11 = select i1 %8, i32 0, i32 %6
%12 = tail call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}