#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 atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  if (argc < 6) {
    puts("format: command xsize ysize r g b");
    exit(1);
  }
  int x = 0;
  int y = 0;
  fputs("ARTNAVSEGDA", stdout);
  fputc(atoi(argv[1]), stdout);
  fputc(atoi(argv[2]), stdout);
  while (x != atoi(argv[1])) {
    y = 0;
    while (y != atoi(argv[2])) {
      fputc(atoi(argv[3]), stdout);
      fputc(atoi(argv[4]), stdout);
      fputc(atoi(argv[5]), stdout);
      y++;
    }
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1186 <main+0x36>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    0x2e45(%rip),%rax
mov    (%rax),%esi
lea    0xe7e(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2e04(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
je     129d <main+0x14d>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     128f <main+0x13f>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2d83(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
mov    0x2d66(%rip),%rax
mov    (%rax),%esi
call   1050 <fputc@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120a <main+0xba>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e3 <main+0x93>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x5,%edi
jle    1256 <main+0x106>
mov    %rsi,%r14
mov    0x2e72(%rip),%r12
mov    (%r12),%esi
lea    0xea9(%rip),%rdi
call   1040 <fputs@plt>
mov    0x8(%r14),%rdi
call   1060 <atoi@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
mov    0x10(%r14),%rdi
call   1060 <atoi@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
mov    0x8(%r14),%r15
mov    %r15,%rdi
call   1060 <atoi@plt>
test   %eax,%eax
je     1245 <main+0xf5>
mov    0x10(%r14),%rbx
xor    %r13d,%r13d
jmp    11e1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
mov    %r15,%rdi
call   1060 <atoi@plt>
cmp    %eax,%r13d
je     1245 <main+0xf5>
mov    %rbx,%rdi
call   1060 <atoi@plt>
test   %eax,%eax
je     11d0 <main+0x80>
xor    %ebp,%ebp
nop
mov    0x18(%r14),%rdi
call   1060 <atoi@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
mov    0x20(%r14),%rdi
call   1060 <atoi@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
mov    0x28(%r14),%rdi
call   1060 <atoi@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <fputc@plt>
add    $0x1,%ebp
mov    0x10(%r14),%rbx
mov    %rbx,%rdi
call   1060 <atoi@plt>
cmp    %eax,%ebp
jne    11f0 <main+0xa0>
mov    0x8(%r14),%r15
jmp    11d0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xda3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"format: command xsize ysize r g b\00"
@.str.1 = [12 x i8] c"ARTNAVSEGDA\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
store i32 0, i32* %6
store i32 0, i32* %7
%14 = load i32, i32* @stdout
%15 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
%20 = load i32, i32* @stdout
%21 = call i32 @fputc(i32 %19, i32 %20)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = load i32, i32* @stdout
%27 = call i32 @fputc(i32 %25, i32 %26)
br label %28
28: ; preds = %64, %13
%29 = load i32, i32* %6
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = icmp ne i32 %29, %33
br i1 %34, label %35, label %67
35: ; preds = %28
store i32 0, i32* %7
br label %36
36: ; preds = %43, %35
%37 = load i32, i32* %7
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = icmp ne i32 %37, %41
br i1 %42, label %43, label %64
43: ; preds = %36
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = call i32 @atoi(i8* %46)
%48 = load i32, i32* @stdout
%49 = call i32 @fputc(i32 %47, i32 %48)
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 4
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
%54 = load i32, i32* @stdout
%55 = call i32 @fputc(i32 %53, i32 %54)
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 5
%58 = load i8*, i8** %57
%59 = call i32 @atoi(i8* %58)
%60 = load i32, i32* @stdout
%61 = call i32 @fputc(i32 %59, i32 %60)
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %36
64: ; preds = %36
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %28
67: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"format: command xsize ysize r g b\00"
@.str.1 = [12 x i8] c"ARTNAVSEGDA\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = load i32, i32* @stdout
%14 = tail call i32 @fputc(i32 %12, i32 %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fputc(i32 %17, i32 %18)
%20 = load i8*, i8** %10
%21 = tail call i32 @atoi(i8* %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %60, label %23
23: ; preds = %7
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = getelementptr inbounds i8*, i8** %1, i64 4
%26 = getelementptr inbounds i8*, i8** %1, i64 5
%27 = load i8*, i8** %15
br label %28
28: ; preds = %23, %54
%29 = phi i8* [ %20, %23 ], [ %55, %54 ]
%30 = phi i8* [ %27, %23 ], [ %56, %54 ]
%31 = phi i32 [ 0, %23 ], [ %57, %54 ]
%32 = tail call i32 @atoi(i8* %30)
%33 = icmp eq i32 %32, 0
br i1 %33, label %54, label %34
34: ; preds = %28, %34
%35 = phi i32 [ %48, %34 ], [ 0, %28 ]
%36 = load i8*, i8** %24
%37 = tail call i32 @atoi(i8* %36)
%38 = load i32, i32* @stdout
%39 = tail call i32 @fputc(i32 %37, i32 %38)
%40 = load i8*, i8** %25
%41 = tail call i32 @atoi(i8* %40)
%42 = load i32, i32* @stdout
%43 = tail call i32 @fputc(i32 %41, i32 %42)
%44 = load i8*, i8** %26
%45 = tail call i32 @atoi(i8* %44)
%46 = load i32, i32* @stdout
%47 = tail call i32 @fputc(i32 %45, i32 %46)
%48 = add nuw nsw i32 %35, 1
%49 = load i8*, i8** %15
%50 = tail call i32 @atoi(i8* %49)
%51 = icmp eq i32 %48, %50
br i1 %51, label %52, label %34
52: ; preds = %34
%53 = load i8*, i8** %10
br label %54
54: ; preds = %52, %28
%55 = phi i8* [ %53, %52 ], [ %29, %28 ]
%56 = phi i8* [ %49, %52 ], [ %30, %28 ]
%57 = add nuw nsw i32 %31, 1
%58 = tail call i32 @atoi(i8* %55)
%59 = icmp eq i32 %57, %58
br i1 %59, label %60, label %28
60: ; preds = %54, %7
ret i32 0
}