#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*/ ezPrintPattern(unsigned char, unsigned char, unsigned char);
void ezDialogRect(unsigned char pat, unsigned char x, unsigned char y,
                  unsigned char w, unsigned char h) {
  unsigned char i, j;
  for (j = x; j < x + w; j++) {
    for (i = y; i < y + h; i++) {
      ezPrintPattern(pat, j, i);
    }
  }
}


x86 assembly (clang, -O0):
<ezDialogRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %r8b,%al
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x7(%rbp)
movzbl -0x7(%rbp),%eax
movzbl -0x2(%rbp),%ecx
movzbl -0x4(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jge    1198 <ezDialogRect+0x88>
mov    -0x3(%rbp),%al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
movzbl -0x3(%rbp),%ecx
movzbl -0x5(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jge    1186 <ezDialogRect+0x76>
mov    -0x1(%rbp),%cl
mov    -0x7(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x6(%rbp),%edx
call   1030 <ezPrintPattern@plt>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    114e <ezDialogRect+0x3e>
jmp    118b <ezDialogRect+0x7b>
mov    -0x7(%rbp),%al
add    $0x1,%al
mov    %al,-0x7(%rbp)
jmp    1132 <ezDialogRect+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezDialogRect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %ecx,%ecx
je     1180 <ezDialogRect+0x70>
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %esi,%ebx
add    %esi,%r12d
movzbl 0x4(%rsp),%eax
movzbl %r15b,%r14d
add    %eax,%r14d
movzbl %dil,%r13d
jmp    114b <ezDialogRect+0x3b>
add    $0x1,%bl
movzbl %bl,%eax
cmp    %eax,%r12d
jbe    1180 <ezDialogRect+0x70>
test   %r15b,%r15b
je     1140 <ezDialogRect+0x30>
mov    0x4(%rsp),%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %bl,%esi
movzbl %bpl,%ebp
mov    %r13d,%edi
mov    %ebp,%edx
call   1030 <ezPrintPattern@plt>
add    $0x1,%bpl
movzbl %bpl,%eax
cmp    %eax,%r14d
ja     1160 <ezDialogRect+0x50>
jmp    1140 <ezDialogRect+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ezDialogRect(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
%13 = load i8, i8* %7
store i8 %13, i8* %12
br label %14
14: ; preds = %43, %5
%15 = load i8, i8* %12
%16 = zext i8 %15 to i32
%17 = load i8, i8* %7
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = add nsw i32 %18, %20
%22 = icmp slt i32 %16, %21
br i1 %22, label %23, label %46
23: ; preds = %14
%24 = load i8, i8* %8
store i8 %24, i8* %11
br label %25
25: ; preds = %39, %23
%26 = load i8, i8* %11
%27 = zext i8 %26 to i32
%28 = load i8, i8* %8
%29 = zext i8 %28 to i32
%30 = load i8, i8* %10
%31 = zext i8 %30 to i32
%32 = add nsw i32 %29, %31
%33 = icmp slt i32 %27, %32
br i1 %33, label %34, label %42
34: ; preds = %25
%35 = load i8, i8* %6
%36 = load i8, i8* %12
%37 = load i8, i8* %11
%38 = call i32 @ezPrintPattern(i8 zeroext %35, i8 zeroext %36, i8 zeroext %37)
br label %39
39: ; preds = %34
%40 = load i8, i8* %11
%41 = add i8 %40, 1
store i8 %41, i8* %11
br label %25
42: ; preds = %25
br label %43
43: ; preds = %42
%44 = load i8, i8* %12
%45 = add i8 %44, 1
store i8 %45, i8* %12
br label %14
46: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @ezDialogRect(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4) {
%6 = zext i8 %1 to i32
%7 = zext i8 %3 to i32
%8 = add nuw nsw i32 %7, %6
%9 = icmp eq i8 %3, 0
br i1 %9, label %27, label %10
10: ; preds = %5
%11 = zext i8 %2 to i32
%12 = zext i8 %4 to i32
%13 = add nuw nsw i32 %12, %11
%14 = icmp eq i8 %4, 0
br label %15
15: ; preds = %10, %23
%16 = phi i8 [ %1, %10 ], [ %24, %23 ]
br i1 %14, label %23, label %17
17: ; preds = %15, %17
%18 = phi i8 [ %20, %17 ], [ %2, %15 ]
%19 = tail call i32 @ezPrintPattern(i8 zeroext %0, i8 zeroext %16, i8 zeroext %18)
%20 = add i8 %18, 1
%21 = zext i8 %20 to i32
%22 = icmp ugt i32 %13, %21
br i1 %22, label %17, label %23
23: ; preds = %17, %15
%24 = add i8 %16, 1
%25 = zext i8 %24 to i32
%26 = icmp ugt i32 %8, %25
br i1 %26, label %15, label %27
27: ; preds = %23, %5
ret void
}