#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 main() {
  int sd, osr, sr, y, t;
  sd = 40;
  osr = 160;
  sr = 1000;
  printf("Jahr StD OStR StR\n");
  for (y = 3; y <= 60; y += 3) {
    t = (osr * 10) / 100;
    sd += t;
    osr -= t;
    t = (sr * 20) / 100;
    osr += t;
    sr -= t;
    t = (sd * 20) / 100;
    sd -= t;
    t = (osr * 20) / 100;
    osr -= t;
    t = (sr * 20) / 100;
    sr -= t;
    sr += 1200 - (sd + osr + sr);
    printf("%-4d %-3d %-4d %-3d\n", y, sd, osr, sr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x8(%rbp)
movl   $0xa0,-0xc(%rbp)
movl   $0x3e8,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x14(%rbp)
cmpl   $0x3c,-0x14(%rbp)
jg     1226 <main+0x116>
imul   $0xa,-0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x14,-0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
imul   $0x14,-0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
imul   $0x14,-0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x14,-0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    $0x4b0,%eax
sub    %ecx,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <main+0x39>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa0,%ebp
mov    $0x3e8,%r12d
mov    $0x28,%ebx
lea    0xeb5(%rip),%r14
xor    %r15d,%r15d
xchg   %ax,%ax
add    $0x3,%r15d
movslq %ebp,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ebx
sub    %ecx,%eax
movslq %r12d,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
add    %eax,%ecx
movslq %ebx,%rbx
imul   $0xffffffff99999999,%rbx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rax
add    %edx,%eax
add    %eax,%ebx
movslq %ecx,%rbp
imul   $0xffffffff99999999,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
add    %eax,%ebp
mov    $0x4b0,%r12d
sub    %ebp,%r12d
sub    %ebx,%r12d
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r12d,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x3a,%r15d
jb     1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Jahr StD OStR StR\0A\00"
@.str.1 = [21 x i8] c"%-4d %-3d %-4d %-3d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
store i32 160, i32* %3
store i32 1000, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 3, i32* %5
br label %8
8: ; preds = %61, %0
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 60
br i1 %10, label %11, label %64
11: ; preds = %8
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 10
%14 = sdiv i32 %13, 100
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* %6
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %4
%22 = mul nsw i32 %21, 20
%23 = sdiv i32 %22, 100
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = load i32, i32* %3
%26 = add nsw i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, %27
store i32 %29, i32* %4
%30 = load i32, i32* %2
%31 = mul nsw i32 %30, 20
%32 = sdiv i32 %31, 100
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, %33
store i32 %35, i32* %2
%36 = load i32, i32* %3
%37 = mul nsw i32 %36, 20
%38 = sdiv i32 %37, 100
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = load i32, i32* %3
%41 = sub nsw i32 %40, %39
store i32 %41, i32* %3
%42 = load i32, i32* %4
%43 = mul nsw i32 %42, 20
%44 = sdiv i32 %43, 100
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, %45
store i32 %47, i32* %4
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = add nsw i32 %48, %49
%51 = load i32, i32* %4
%52 = add nsw i32 %50, %51
%53 = sub nsw i32 1200, %52
%54 = load i32, i32* %4
%55 = add nsw i32 %54, %53
store i32 %55, i32* %4
%56 = load i32, i32* %5
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = load i32, i32* %4
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %56, i32 %57, i32 %58, i32 %59)
br label %61
61: ; preds = %11
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 3
store i32 %63, i32* %5
br label %8
64: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"%-4d %-3d %-4d %-3d\0A\00"
@str = [18 x i8] c"Jahr StD OStR StR\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 40, %0 ], [ %13, %2 ]
%4 = phi i32 [ 3, %0 ], [ %19, %2 ]
%5 = phi i32 [ 1000, %0 ], [ %17, %2 ]
%6 = phi i32 [ 160, %0 ], [ %15, %2 ]
%7 = sdiv i32 %6, 10
%8 = add nsw i32 %3, %7
%9 = sub nsw i32 %6, %7
%10 = sdiv i32 %5, 5
%11 = add nsw i32 %9, %10
%12 = sdiv i32 %8, -5
%13 = add i32 %12, %8
%14 = sdiv i32 %11, -5
%15 = add i32 %14, %11
%16 = add i32 %15, %13
%17 = sub i32 1200, %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %13, i32 %15, i32 %17)
%19 = add nuw nsw i32 %4, 3
%20 = icmp ult i32 %4, 58
br i1 %20, label %2, label %21
21: ; preds = %2
ret i32 0
}