#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 int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ setModule(int /*<<< orphan*/ *, int, int, int);
void fillRectangle(int left, int top, int width, int height, uint8_t qrcode[]) {
  for (int dy = 0; dy < height; dy++) {
    for (int dx = 0; dx < width; dx++)
      setModule(qrcode, left + dx, top + dy, true);
  }
}


x86 assembly (clang, -O0):
<fillRectangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <fillRectangle+0x79>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <fillRectangle+0x66>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
add    -0x20(%rbp),%esi
mov    -0x8(%rbp),%edx
add    -0x1c(%rbp),%edx
mov    $0x1,%ecx
call   1030 <setModule@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1142 <fillRectangle+0x32>
jmp    117b <fillRectangle+0x6b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112f <fillRectangle+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRectangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %edi,0x8(%rsp)
mov    %ecx,0xc(%rsp)
test   %ecx,%ecx
jle    118e <fillRectangle+0x7e>
mov    %r8,%rbx
mov    %edx,%r14d
xor    %r15d,%r15d
jmp    114b <fillRectangle+0x3b>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
je     118e <fillRectangle+0x7e>
test   %r14d,%r14d
jle    1140 <fillRectangle+0x30>
mov    0x10(%rsp),%rax
lea    (%r15,%rax,1),%ebp
mov    0x8(%rsp),%r12d
mov    %r14d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
call   1030 <setModule@plt>
add    $0x1,%r12d
add    $0xffffffff,%r13d
jne    1170 <fillRectangle+0x60>
jmp    1140 <fillRectangle+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fillRectangle(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = icmp sgt i32 %2, 0
br label %9
9: ; preds = %7, %14
%10 = phi i32 [ 0, %7 ], [ %15, %14 ]
br i1 %8, label %11, label %14
11: ; preds = %9
%12 = add nsw i32 %10, %1
br label %17
13: ; preds = %14, %5
ret void
14: ; preds = %17, %9
%15 = add nuw nsw i32 %10, 1
%16 = icmp eq i32 %15, %3
br i1 %16, label %13, label %9
17: ; preds = %11, %17
%18 = phi i32 [ 0, %11 ], [ %21, %17 ]
%19 = add nsw i32 %18, %0
%20 = tail call i32 @setModule(i32* %4, i32 %19, i32 %12, i32 1)
%21 = add nuw nsw i32 %18, 1
%22 = icmp eq i32 %21, %2
br i1 %22, label %14, label %17
}