#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*/ drawbl(int, int, int, int);
scalar_t__ is_outside_screen(int, int /*<<< orphan*/);
int /*<<< orphan*/ setattr_normal();
void draw_tetris_logo(int x, int y) {
  int bl;
  drawbl(0x227, 1, x, y);
  drawbl(0x313, 4, x + 7, y);
  drawbl(1, 4, x + 8, y + 1);
  drawbl(0x227, 6, x + 12, y);
  drawbl(0x113, 7, x + 19, y);
  drawbl(0x111, 2, x + 24, y);
  bl = 0x326;
  if (is_outside_screen(x + 33, 0))
    bl = 0x322;
  drawbl(bl, 3, x + 27, y);
  setattr_normal();
}


x86 assembly (clang, -O0):
<draw_tetris_logo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x227,%edi
mov    $0x1,%esi
call   1050 <drawbl@plt>
mov    -0x4(%rbp),%edx
add    $0x7,%edx
mov    -0x8(%rbp),%ecx
mov    $0x313,%edi
mov    $0x4,%esi
call   1050 <drawbl@plt>
mov    -0x4(%rbp),%edx
add    $0x8,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <drawbl@plt>
mov    -0x4(%rbp),%edx
add    $0xc,%edx
mov    -0x8(%rbp),%ecx
mov    $0x227,%edi
mov    $0x6,%esi
call   1050 <drawbl@plt>
mov    -0x4(%rbp),%edx
add    $0x13,%edx
mov    -0x8(%rbp),%ecx
mov    $0x113,%edi
mov    $0x7,%esi
call   1050 <drawbl@plt>
mov    -0x4(%rbp),%edx
add    $0x18,%edx
mov    -0x8(%rbp),%ecx
mov    $0x111,%edi
mov    $0x2,%esi
call   1050 <drawbl@plt>
movl   $0x326,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x21,%edi
xor    %esi,%esi
call   1030 <is_outside_screen@plt>
cmp    $0x0,%rax
je     11f3 <draw_tetris_logo+0xc3>
movl   $0x322,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%edx
add    $0x1b,%edx
mov    -0x8(%rbp),%ecx
mov    $0x3,%esi
call   1050 <drawbl@plt>
mov    $0x0,%al
call   1040 <setattr_normal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_tetris_logo>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
mov    $0x227,%edi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1050 <drawbl@plt>
lea    0x7(%rbx),%edx
mov    $0x313,%edi
mov    $0x4,%esi
mov    %r14d,%ecx
call   1050 <drawbl@plt>
lea    0x8(%rbx),%edx
lea    0x1(%r14),%ecx
mov    $0x1,%edi
mov    $0x4,%esi
call   1050 <drawbl@plt>
lea    0xc(%rbx),%edx
mov    $0x227,%edi
mov    $0x6,%esi
mov    %r14d,%ecx
call   1050 <drawbl@plt>
lea    0x13(%rbx),%edx
mov    $0x113,%edi
mov    $0x7,%esi
mov    %r14d,%ecx
call   1050 <drawbl@plt>
lea    0x18(%rbx),%edx
mov    $0x111,%edi
mov    $0x2,%esi
mov    %r14d,%ecx
call   1050 <drawbl@plt>
lea    0x21(%rbx),%edi
xor    %esi,%esi
call   1030 <is_outside_screen@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    0x322(,%rcx,4),%edi
add    $0x1b,%ebx
mov    $0x3,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1050 <drawbl@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <setattr_normal@plt>

LLVM IR (-O0):
define void @draw_tetris_logo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @drawbl(i32 551, i32 1, i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 7
%11 = load i32, i32* %4
%12 = call i32 @drawbl(i32 787, i32 4, i32 %10, i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = call i32 @drawbl(i32 1, i32 4, i32 %14, i32 %16)
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 12
%20 = load i32, i32* %4
%21 = call i32 @drawbl(i32 551, i32 6, i32 %19, i32 %20)
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 19
%24 = load i32, i32* %4
%25 = call i32 @drawbl(i32 275, i32 7, i32 %23, i32 %24)
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 24
%28 = load i32, i32* %4
%29 = call i32 @drawbl(i32 273, i32 2, i32 %27, i32 %28)
store i32 806, i32* %5
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 33
%32 = call i64 @is_outside_screen(i32 %31, i32 0)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %2
store i32 802, i32* %5
br label %35
35: ; preds = %34, %2
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 27
%39 = load i32, i32* %4
%40 = call i32 @drawbl(i32 %36, i32 3, i32 %38, i32 %39)
%41 = call i32 (...) @setattr_normal()
ret void
}

LLVM IR (-O2):
define void @draw_tetris_logo(i32 %0, i32 %1) {
%3 = tail call i32 @drawbl(i32 551, i32 1, i32 %0, i32 %1)
%4 = add nsw i32 %0, 7
%5 = tail call i32 @drawbl(i32 787, i32 4, i32 %4, i32 %1)
%6 = add nsw i32 %0, 8
%7 = add nsw i32 %1, 1
%8 = tail call i32 @drawbl(i32 1, i32 4, i32 %6, i32 %7)
%9 = add nsw i32 %0, 12
%10 = tail call i32 @drawbl(i32 551, i32 6, i32 %9, i32 %1)
%11 = add nsw i32 %0, 19
%12 = tail call i32 @drawbl(i32 275, i32 7, i32 %11, i32 %1)
%13 = add nsw i32 %0, 24
%14 = tail call i32 @drawbl(i32 273, i32 2, i32 %13, i32 %1)
%15 = add nsw i32 %0, 33
%16 = tail call i64 @is_outside_screen(i32 %15, i32 0)
%17 = icmp eq i64 %16, 0
%18 = select i1 %17, i32 806, i32 802
%19 = add nsw i32 %0, 27
%20 = tail call i32 @drawbl(i32 %18, i32 3, i32 %19, i32 %1)
%21 = tail call i32 (...) @setattr_normal()
ret void
}