#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() {
  unsigned long long lucchis1 = 2, lucchis2 = 1;
  int broqch = 2, zamestitel = 1;
  printf("%llu-%d\n%llu-%d\n", lucchis1, 1, lucchis2, 2);
  while (broqch < 100) {
    broqch++;
    if (zamestitel == 1) {
      lucchis1 = lucchis1 + lucchis2;
      printf("%llu-%d\n", lucchis1, broqch);
    } else {
      if (zamestitel == 2) {
        lucchis2 = lucchis1 + lucchis2;
        printf("%llu-%d\n", lucchis2, broqch);
      }
    }
    switch (zamestitel) {
    case 1:
      zamestitel++;
      break;
    case 2:
      zamestitel--;
      break;
    default:
      printf("problem");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xeb4(%rip),%rdi
mov    $0x1,%edx
mov    $0x2,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x64,-0x1c(%rbp)
jge    1225 <main+0x115>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    11a1 <main+0x91>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0xc1>
cmpl   $0x2,-0x20(%rbp)
jne    11cc <main+0xbc>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0xc1>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x1,%eax
je     11f6 <main+0xe6>
jmp    11e5 <main+0xd5>
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
je     1204 <main+0xf4>
jmp    1212 <main+0x102>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1220 <main+0x110>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1220 <main+0x110>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <main+0x4e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xede(%rip),%rdi
mov    $0x2,%r13d
mov    $0x1,%ebp
mov    $0x1,%r15d
mov    $0x2,%esi
mov    $0x1,%ecx
mov    $0x1,%edx
mov    $0x2,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%ebx
lea    0xead(%rip),%r14
jmp    1179 <main+0x69>
nopl   (%rax)
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%r15
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11aa <main+0x9a>
lea    (%r15,%r13,1),%r12
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     11a0 <main+0x90>
cmp    $0x2,%ebp
jne    1160 <main+0x50>
mov    $0x1,%ebp
jmp    116e <main+0x5e>
nopl   (%rax)
mov    %r12,%r13
mov    $0x2,%ebp
jmp    1171 <main+0x61>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%llu-%d\0A%llu-%d\0A\00"
@.str.1 = [9 x i8] c"%llu-%d\0A\00"
@.str.2 = [8 x i8] c"problem\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i64 2, i64* %2
store i64 1, i64* %3
store i32 2, i32* %4
store i32 1, i32* %5
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %6, i32 1, i64 %7, i32 2)
br label %9
9: ; preds = %45, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %46
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %24
17: ; preds = %12
%18 = load i64, i64* %2
%19 = load i64, i64* %3
%20 = add i64 %18, %19
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %21, i32 %22)
br label %35
24: ; preds = %12
%25 = load i32, i32* %5
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = load i64, i64* %2
%29 = load i64, i64* %3
%30 = add i64 %28, %29
store i64 %30, i64* %3
%31 = load i64, i64* %3
%32 = load i32, i32* %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %31, i32 %32)
br label %34
34: ; preds = %27, %24
br label %35
35: ; preds = %34, %17
%36 = load i32, i32* %5
switch i32 %36, label %43 [
i32 1, label %37
i32 2, label %40
]
37: ; preds = %35
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %45
40: ; preds = %35
%41 = load i32, i32* %5
%42 = add nsw i32 %41, -1
store i32 %42, i32* %5
br label %45
43: ; preds = %35
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43, %40, %37
br label %9
46: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%llu-%d\0A%llu-%d\0A\00"
@.str.1 = [9 x i8] c"%llu-%d\0A\00"
@.str.2 = [8 x i8] c"problem\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 2, i32 1, i64 1, i32 2)
br label %2
2: ; preds = %0, %13
%3 = phi i32 [ 1, %0 ], [ %16, %13 ]
%4 = phi i32 [ 2, %0 ], [ %7, %13 ]
%5 = phi i64 [ 1, %0 ], [ %14, %13 ]
%6 = phi i64 [ 2, %0 ], [ %15, %13 ]
%7 = add nuw nsw i32 %4, 1
%8 = add i64 %5, %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %8, i32 %7)
switch i32 %3, label %10 [
i32 1, label %13
i32 2, label %12
]
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %13
12: ; preds = %2
br label %13
13: ; preds = %2, %12, %10
%14 = phi i64 [ %8, %10 ], [ %5, %2 ], [ %8, %12 ]
%15 = phi i64 [ %6, %10 ], [ %8, %2 ], [ %6, %12 ]
%16 = phi i32 [ %3, %10 ], [ 2, %2 ], [ 1, %12 ]
%17 = icmp eq i32 %7, 100
br i1 %17, label %18, label %2
18: ; preds = %13
ret i32 0
}