#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*/ CzekajNaRozpoczecie();
int /*<<< orphan*/ InicjujGre(int, int, int, int, unsigned char *);
int /*<<< orphan*/ WyswietlEkranPrzegranej();
int /*<<< orphan*/ WyswietlEkranWygranej();
int /*<<< orphan*/ ZmienParametryPaletki(int *, int *, unsigned char *);
int /*<<< orphan*/ ZmienParametryPilki(int *, int *, int *, int *, int *, int *,
                                       int, int *, unsigned char *);
int /*<<< orphan*/ delay();
int /*<<< orphan*/ przemiescPaletke(unsigned char *, int);
int /*<<< orphan*/ rysujPilke(unsigned char *, int, int);
int /*<<< orphan*/ skasujPilke(unsigned char *, int, int);
void Arkanoid(unsigned char *Lbuffer) {
  unsigned int opoznienie;
  signed int IloscBlokow = (128 / (7 + 2)) * 5, PolozeniePilkiX = 64,
             PolozeniePilkiY = 35, PolozeniePaletkiX = 65,
             PolozeniePaletkiY = 63;
  int KoniecGry = 0;
  signed int PredkoscPilkiX = 0, PredkoscPilkiY = 3, AktPredkoscPilkiX = 0,
             AktPredkoscPilkiY = 3;
  InicjujGre(PolozeniePilkiX, PolozeniePilkiY, PolozeniePaletkiX,
             PolozeniePaletkiY, Lbuffer);
  CzekajNaRozpoczecie();
  while (!KoniecGry) {
    skasujPilke(Lbuffer, PolozeniePilkiX, PolozeniePilkiY);
    ZmienParametryPaletki(&PolozeniePaletkiX, &PolozeniePaletkiY, Lbuffer);
    ZmienParametryPilki(&PolozeniePilkiX, &PolozeniePilkiY, &PredkoscPilkiX,
                        &PredkoscPilkiY, &AktPredkoscPilkiX, &AktPredkoscPilkiY,
                        PolozeniePaletkiX, &IloscBlokow, Lbuffer);
    rysujPilke(Lbuffer, PolozeniePilkiX, PolozeniePilkiY);
    przemiescPaletke(Lbuffer, PolozeniePaletkiX);
    for (opoznienie = 500; opoznienie > 0; opoznienie--)
      delay();
    if (IloscBlokow <= 0 || PolozeniePilkiY >= 63)
      KoniecGry = 1;
  }
  if (IloscBlokow <= 0)
    WyswietlEkranWygranej();
  else
    WyswietlEkranPrzegranej();
  for (opoznienie = 50000; opoznienie > 0; opoznienie--)
    delay();
}


x86 assembly (clang, -O0):
<Arkanoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x46,-0x10(%rbp)
movl   $0x40,-0x14(%rbp)
movl   $0x23,-0x18(%rbp)
movl   $0x41,-0x1c(%rbp)
movl   $0x3f,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x3,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x3,-0x34(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%r8
call   1030 <InicjujGre@plt>
mov    $0x0,%al
call   1070 <CzekajNaRozpoczecie@plt>
cmpl   $0x0,-0x24(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1224 <Arkanoid+0x84>
jmp    12dc <Arkanoid+0x13c>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   10b0 <skasujPilke@plt>
mov    -0x8(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <ZmienParametryPaletki@plt>
mov    -0x1c(%rbp),%r11d
mov    -0x8(%rbp),%rax
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x30(%rbp),%r8
lea    -0x34(%rbp),%r9
lea    -0x10(%rbp),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   10c0 <ZmienParametryPilki@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   10a0 <rysujPilke@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <przemiescPaletke@plt>
movl   $0x1f4,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    12bc <Arkanoid+0x11c>
mov    $0x0,%al
call   1060 <delay@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    129d <Arkanoid+0xfd>
cmpl   $0x0,-0x10(%rbp)
jle    12d0 <Arkanoid+0x130>
cmpl   $0x3f,-0x18(%rbp)
jl     12d7 <Arkanoid+0x137>
movl   $0x1,-0x24(%rbp)
jmp    120e <Arkanoid+0x6e>
cmpl   $0x0,-0x10(%rbp)
jg     12f2 <Arkanoid+0x152>
mov    $0x0,%al
call   1040 <WyswietlEkranWygranej@plt>
jmp    12f9 <Arkanoid+0x159>
mov    $0x0,%al
call   1050 <WyswietlEkranPrzegranej@plt>
movl   $0xc350,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    131f <Arkanoid+0x17f>
mov    $0x0,%al
call   1060 <delay@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1300 <Arkanoid+0x160>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arkanoid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
movl   $0x46,0x10(%rsp)
movl   $0x40,0xc(%rsp)
movl   $0x23,0x8(%rsp)
movl   $0x41,0x4(%rsp)
movl   $0x3f,0x24(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x3,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x3,0x14(%rsp)
mov    $0x40,%ebp
mov    $0x23,%r13d
mov    $0x40,%edi
mov    $0x23,%esi
mov    $0x41,%edx
mov    $0x3f,%ecx
mov    %rbx,%r8
call   1030 <InicjujGre@plt>
xor    %eax,%eax
call   1070 <CzekajNaRozpoczecie@plt>
lea    0x1c(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x14(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
call   10b0 <skasujPilke@plt>
lea    0x4(%rsp),%rdi
lea    0x24(%rsp),%rsi
mov    %rbx,%rdx
call   1080 <ZmienParametryPaletki@plt>
mov    0x4(%rsp),%eax
sub    $0x8,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x28(%rsp),%rdx
mov    %r14,%rcx
mov    %r15,%r8
mov    %r12,%r9
push   %rbx
lea    0x20(%rsp),%rbp
push   %rbp
push   %rax
call   10c0 <ZmienParametryPilki@plt>
add    $0x20,%rsp
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   10a0 <rysujPilke@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1090 <przemiescPaletke@plt>
mov    $0xfffffe0c,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <delay@plt>
inc    %ebp
jne    12c0 <Arkanoid+0x120>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    12e7 <Arkanoid+0x147>
mov    0x8(%rsp),%r13d
cmp    $0x3e,%r13d
jg     12e7 <Arkanoid+0x147>
mov    0xc(%rsp),%ebp
jmp    1240 <Arkanoid+0xa0>
test   %eax,%eax
jle    12f4 <Arkanoid+0x154>
xor    %eax,%eax
call   1050 <WyswietlEkranPrzegranej@plt>
jmp    12fb <Arkanoid+0x15b>
xor    %eax,%eax
call   1040 <WyswietlEkranWygranej@plt>
mov    $0xffff3cb0,%ebx
xor    %eax,%eax
call   1060 <delay@plt>
inc    %ebx
jne    1300 <Arkanoid+0x160>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Arkanoid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %2
store i32 70, i32* %4
store i32 64, i32* %5
store i32 35, i32* %6
store i32 65, i32* %7
store i32 63, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 3, i32* %11
store i32 0, i32* %12
store i32 3, i32* %13
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i8*, i8** %2
%19 = call i32 @InicjujGre(i32 %14, i32 %15, i32 %16, i32 %17, i8* %18)
%20 = call i32 (...) @CzekajNaRozpoczecie()
br label %21
21: ; preds = %57, %1
%22 = load i32, i32* %9
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
br i1 %24, label %25, label %58
25: ; preds = %21
%26 = load i8*, i8** %2
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = call i32 @skasujPilke(i8* %26, i32 %27, i32 %28)
%30 = load i8*, i8** %2
%31 = call i32 @ZmienParametryPaletki(i32* %7, i32* %8, i8* %30)
%32 = load i32, i32* %7
%33 = load i8*, i8** %2
%34 = call i32 @ZmienParametryPilki(i32* %5, i32* %6, i32* %10, i32* %11, i32* %12, i32* %13, i32 %32, i32* %4, i8* %33)
%35 = load i8*, i8** %2
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = call i32 @rysujPilke(i8* %35, i32 %36, i32 %37)
%39 = load i8*, i8** %2
%40 = load i32, i32* %7
%41 = call i32 @przemiescPaletke(i8* %39, i32 %40)
store i32 500, i32* %3
br label %42
42: ; preds = %47, %25
%43 = load i32, i32* %3
%44 = icmp ugt i32 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = call i32 (...) @delay()
br label %47
47: ; preds = %45
%48 = load i32, i32* %3
%49 = add i32 %48, -1
store i32 %49, i32* %3
br label %42
50: ; preds = %42
%51 = load i32, i32* %4
%52 = icmp sle i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32, i32* %6
%55 = icmp sge i32 %54, 63
br i1 %55, label %56, label %57
56: ; preds = %53, %50
store i32 1, i32* %9
br label %57
57: ; preds = %56, %53
br label %21
58: ; preds = %21
%59 = load i32, i32* %4
%60 = icmp sle i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 (...) @WyswietlEkranWygranej()
br label %65
63: ; preds = %58
%64 = call i32 (...) @WyswietlEkranPrzegranej()
br label %65
65: ; preds = %63, %61
store i32 50000, i32* %3
br label %66
66: ; preds = %71, %65
%67 = load i32, i32* %3
%68 = icmp ugt i32 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %66
%70 = call i32 (...) @delay()
br label %71
71: ; preds = %69
%72 = load i32, i32* %3
%73 = add i32 %72, -1
store i32 %73, i32* %3
br label %66
74: ; preds = %66
ret void
}

LLVM IR (-O2):
define void @Arkanoid(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = bitcast i32* %2 to i8*
store i32 70, i32* %2
%12 = bitcast i32* %3 to i8*
store i32 64, i32* %3
%13 = bitcast i32* %4 to i8*
store i32 35, i32* %4
%14 = bitcast i32* %5 to i8*
store i32 65, i32* %5
%15 = bitcast i32* %6 to i8*
store i32 63, i32* %6
%16 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%17 = bitcast i32* %8 to i8*
store i32 3, i32* %8
%18 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%19 = bitcast i32* %10 to i8*
store i32 3, i32* %10
%20 = tail call i32 @InicjujGre(i32 64, i32 35, i32 65, i32 63, i8* %0)
%21 = tail call i32 (...) @CzekajNaRozpoczecie()
br label %22
22: ; preds = %46, %1
%23 = phi i32 [ 35, %1 ], [ %42, %46 ]
%24 = phi i32 [ 64, %1 ], [ %47, %46 ]
%25 = call i32 @skasujPilke(i8* %0, i32 %24, i32 %23)
%26 = call i32 @ZmienParametryPaletki(i32* %5, i32* %6, i8* %0)
%27 = load i32, i32* %5
%28 = call i32 @ZmienParametryPilki(i32* %3, i32* %4, i32* %7, i32* %8, i32* %9, i32* %10, i32 %27, i32* %2, i8* %0)
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 @rysujPilke(i8* %0, i32 %29, i32 %30)
%32 = load i32, i32* %5
%33 = call i32 @przemiescPaletke(i8* %0, i32 %32)
br label %34
34: ; preds = %22, %34
%35 = phi i32 [ 500, %22 ], [ %37, %34 ]
%36 = call i32 (...) @delay()
%37 = add nsw i32 %35, -1
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %34
39: ; preds = %34
%40 = load i32, i32* %2
%41 = icmp slt i32 %40, 1
%42 = load i32, i32* %4
%43 = icmp slt i32 %42, 63
%44 = xor i1 %41, true
%45 = select i1 %44, i1 %43, i1 false
br i1 %45, label %46, label %48
46: ; preds = %39
%47 = load i32, i32* %3
br label %22
48: ; preds = %39
br i1 %41, label %49, label %51
49: ; preds = %48
%50 = call i32 (...) @WyswietlEkranWygranej()
br label %53
51: ; preds = %48
%52 = call i32 (...) @WyswietlEkranPrzegranej()
br label %53
53: ; preds = %51, %49
br label %54
54: ; preds = %53, %54
%55 = phi i32 [ %57, %54 ], [ 50000, %53 ]
%56 = call i32 (...) @delay()
%57 = add nsw i32 %55, -1
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %54
59: ; preds = %54
ret void
}