#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 */
typedef enum Kierunek { ____Placeholder_Kierunek } Kierunek;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  enum Kierunek { W_GORE, W_DOL, W_LEWO, W_PRAWO };
  enum Kierunek ruch = W_GORE;
  printf("ruch %i\n", ruch);
  switch (ruch) {
  case W_GORE:
    printf("w gore\n");
    break;
  case W_DOL:
    printf("w dol\n");
    break;
  default:
    printf("ruch w bok?\n");
  }
  printf("kierunki %i %i %i %i\n", W_GORE, W_DOL, W_LEWO, W_PRAWO);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     115b <main+0x4b>
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     116e <main+0x5e>
jmp    1181 <main+0x71>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <main+0x7f>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <main+0x7f>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ruch %i\0A\00"
@.str.1 = [8 x i8] c"w gore\0A\00"
@.str.2 = [7 x i8] c"w dol\0A\00"
@.str.3 = [13 x i8] c"ruch w bok?\0A\00"
@.str.4 = [22 x i8] c"kierunki %i %i %i %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 0, label %6
i32 1, label %8
]
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"ruch %i\0A\00"
@.str.4 = [22 x i8] c"kierunki %i %i %i %i\0A\00"
@str = [7 x i8] c"w gore\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 1, i32 2, i32 3)
ret i32 0
}