#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;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int atoi(char *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ line(int /*<<< orphan*/ *, int, int, int, int, int, int,
                        int);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int rand();
int size(int, int);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  struct timespec now;
  uint8_t *img;
  int w, h;
  int sz;
  int num_lines;
  if (argc != 4) {
    fprintf(stderr, "Usage: %s width height num_lines\n", argv[0]);
    return 1;
  }
  clock_gettime(CLOCK_MONOTONIC, &now);
  srand((int)now.tv_sec ^ (int)now.tv_nsec);
  w = atoi(argv[1]);
  h = atoi(argv[2]);
  sz = size(w, h);
  fprintf(stderr, "Image size: %dx%d  Array size: %d\n", w, h, sz);
  num_lines = atoi(argv[3]);
  fprintf(stderr, "Line Count: %d\n", num_lines);
  img = malloc(sz);
  if (img == NULL) {
    perror("Failed to allocate image");
    return 2;
  }
  memset(img, 0, sz);
  fprintf(stderr, "Allocated image at %p\n", img);
  fprintf(stderr, "Drawing some lines\n");
  for (int i = 0; i < num_lines; i++) {
    int x1, y1, x2, y2, color;
    x1 = rand() % w;
    y1 = rand() % h;
    x2 = rand() % w;
    y2 = rand() % h;
    color = rand() % 50;
    line(img, w, h, x1, y1, x2, y2, color);
  }
  line(img, w, h, 0, h / 2, w - 1, h / 2, 148);
  line(img, w, h, w / 2, 0, w / 2, h - 1, 255);
  line(img, w, h, 0, 0, w - 1, h / 2, 164);
  line(img, w, h, 0, h - 1, w - 1, h / 2, 164);
  line(img, w, h, 0, 2, 30, 32, 180);
  line(img, w, h, 0, h - 3, 30, h - 33, 180);
  line(img, w, h, 0, 0, w / 2, h - 1, 145);
  line(img, w, h, 0, h - 1, w / 2, 0, 145);
  line(img, w, h, w / 2, h / 4, 0, h / 4, 160);
  line(img, w, h, w / 4, h / 2, w / 4, 0, 160);
  line(img, w, h, w - 1, 0, 0, h / 2, 192);
  line(img, w, h, w - 1, h - 1, 0, h / 2, 192);
  line(img, w, h, w - 1, 2, w - 31, 32, 140);
  line(img, w, h, w - 1, h - 3, w - 31, h - 33, 140);
  line(img, w, h, w - 1, 0, w / 2, h - 1, 180);
  line(img, w, h, w - 1, h - 1, w / 2, 0, 180);
  fprintf(stderr, "Writing image to stdout\n");
  fwrite(img, sz, 1, stdout);
  free(img);
  fprintf(stderr, "Goodbye.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     120d <main+0x4d>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17d7 <main+0x617>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1050 <clock_gettime@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%edi
mov    -0x20(%rbp),%rax
xor    %eax,%edi
call   1070 <srand@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1040 <size@plt>
mov    %eax,-0x34(%rbp)
mov    0x2d73(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x34(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    12d8 <main+0x118>
lea    0xd8e(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    17d7 <main+0x617>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xd74(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
lea    0xd74(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13ac <main+0x1ec>
mov    $0x0,%al
call   10e0 <rand@plt>
cltd
idivl  -0x2c(%rbp)
mov    %edx,-0x40(%rbp)
mov    $0x0,%al
call   10e0 <rand@plt>
cltd
idivl  -0x30(%rbp)
mov    %edx,-0x44(%rbp)
mov    $0x0,%al
call   10e0 <rand@plt>
cltd
idivl  -0x2c(%rbp)
mov    %edx,-0x48(%rbp)
mov    $0x0,%al
call   10e0 <rand@plt>
cltd
idivl  -0x30(%rbp)
mov    %edx,-0x4c(%rbp)
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %edx,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x4c(%rbp),%r10d
mov    -0x50(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    131f <main+0x15f>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x80(%rbp),%edx
xor    %ecx,%ecx
mov    %eax,(%rsp)
movl   $0x94,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x7c(%rbp),%edx
mov    %eax,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r8d,%r8d
mov    %eax,(%rsp)
movl   $0xff,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x78(%rbp),%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
movl   $0xa4,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x74(%rbp),%edx
xor    %ecx,%ecx
mov    %eax,(%rsp)
movl   $0xa4,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x1e,%r9d
movl   $0x20,(%rsp)
movl   $0xb4,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x30(%rbp),%r8d
sub    $0x3,%r8d
mov    -0x30(%rbp),%eax
sub    $0x21,%eax
xor    %ecx,%ecx
mov    $0x1e,%r9d
mov    %eax,(%rsp)
movl   $0xb4,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x70(%rbp),%edx
mov    %eax,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
movl   $0x91,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x6c(%rbp),%edx
mov    %eax,%r9d
xor    %ecx,%ecx
movl   $0x0,(%rsp)
movl   $0x91,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
mov    $0x4,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x30(%rbp),%eax
mov    $0x4,%r9d
cltd
idiv   %r9d
mov    -0x68(%rbp),%edx
xor    %r9d,%r9d
mov    %eax,(%rsp)
movl   $0xa0,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x2c(%rbp),%eax
mov    $0x4,%r9d
cltd
idiv   %r9d
mov    -0x64(%rbp),%edx
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
movl   $0xa0,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x60(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%r8d
mov    %eax,(%rsp)
movl   $0xc0,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x30(%rbp),%eax
mov    $0x2,%r9d
cltd
idiv   %r9d
mov    -0x5c(%rbp),%edx
xor    %r9d,%r9d
mov    %eax,(%rsp)
movl   $0xc0,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x2c(%rbp),%r9d
sub    $0x1f,%r9d
mov    $0x2,%r8d
movl   $0x20,(%rsp)
movl   $0x8c,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%r8d
sub    $0x3,%r8d
mov    -0x2c(%rbp),%r9d
sub    $0x1f,%r9d
mov    -0x30(%rbp),%eax
sub    $0x21,%eax
mov    %eax,(%rsp)
movl   $0x8c,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x2c(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    -0x58(%rbp),%edx
mov    %eax,%r9d
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
xor    %r8d,%r8d
mov    %eax,(%rsp)
movl   $0xb4,0x8(%rsp)
call   10b0 <line@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x30(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x2c(%rbp),%eax
mov    $0x2,%r9d
cltd
idiv   %r9d
mov    -0x54(%rbp),%edx
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
movl   $0xb4,0x8(%rsp)
call   10b0 <line@plt>
mov    0x2852(%rip),%rax
mov    (%rax),%edi
lea    0x90a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    0x282c(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    0x2818(%rip),%rax
mov    (%rax),%edi
lea    0x8e9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    160e <main+0x44e>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
lea    0x28(%rsp),%rsi
call   1050 <clock_gettime@plt>
mov    0x28(%rsp),%edi
xor    0x30(%rsp),%edi
call   1070 <srand@plt>
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r13d
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r15d
mov    %r13d,%edi
mov    %eax,%esi
call   1040 <size@plt>
mov    %eax,%r12d
mov    0x2db2(%rip),%r14
mov    (%r14),%edi
lea    0xdf2(%rip),%rsi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x18(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xdf0(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r12d,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     163c <main+0x47c>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
mov    %r12d,0x14(%rsp)
mov    %r12d,%edx
call   1060 <memset@plt>
mov    (%r14),%edi
lea    0xde0(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%r14),%edi
lea    0xde3(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %ebx,%ebx
mov    %rbp,0x18(%rsp)
jle    133e <main+0x17e>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   10e0 <rand@plt>
cltd
idiv   %r13d
mov    %edx,(%rsp)
xor    %eax,%eax
call   10e0 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%ebp
xor    %eax,%eax
call   10e0 <rand@plt>
cltd
idiv   %r13d
mov    %edx,%r12d
xor    %eax,%eax
call   10e0 <rand@plt>
cltd
idiv   %r15d
mov    %edx,%r14d
xor    %eax,%eax
call   10e0 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x32,%ecx,%ecx
sub    %ecx,%eax
mov    0x18(%rsp),%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    (%rsp),%ecx
mov    %ebp,%r8d
mov    %r12d,%r9d
push   %rax
push   %r14
call   10b0 <line@plt>
add    $0x10,%rsp
add    $0xffffffff,%ebx
jne    12c0 <main+0x100>
mov    %r15d,%ebp
shr    $0x1f,%ebp
add    %r15d,%ebp
sar    %ebp
lea    -0x1(%r13),%r14d
mov    0x18(%rsp),%r12
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    %r14d,%r9d
mov    %r14d,0xc(%rsp)
push   $0x94
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r13d,%ecx
shr    $0x1f,%ecx
add    %r13d,%ecx
sar    %ecx
mov    %ecx,0x8(%rsp)
lea    -0x1(%r15),%ebx
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %r8d,%r8d
mov    %ecx,%r9d
push   $0xff
push   %rbx
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %r14d,%r9d
push   $0xa4
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
mov    %r14d,%r9d
push   $0xa4
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x1e,%r9d
push   $0xb4
push   $0x20
call   10b0 <line@plt>
add    $0x10,%rsp
lea    -0x3(%r15),%r8d
mov    %r8d,0x10(%rsp)
lea    -0x21(%r15),%eax
mov    %rax,0x20(%rsp)
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    $0x1e,%r9d
push   $0xb4
push   %rax
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    0x8(%rsp),%r14d
mov    %r14d,%r9d
push   $0x91
mov    %rbx,0x8(%rsp)
push   %rbx
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
mov    %r14d,%r9d
push   $0x91
push   $0x0
call   10b0 <line@plt>
add    $0x10,%rsp
lea    0x3(%r15),%r8d
test   %r15d,%r15d
cmovns %r15d,%r8d
sar    $0x2,%r8d
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %r9d,%r9d
push   $0xa0
push   %r8
call   10b0 <line@plt>
add    $0x10,%rsp
lea    0x3(%r13),%ecx
test   %r13d,%r13d
cmovns %r13d,%ecx
sar    $0x2,%ecx
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebp,%r8d
mov    %ecx,%r9d
push   $0xa0
push   $0x0
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    0xc(%rsp),%ebx
mov    %ebx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0xc0
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    (%rsp),%r8
xor    %r9d,%r9d
push   $0xc0
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r13d,%ebp
add    $0xffffffe1,%ebp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    $0x2,%r8d
mov    %ebp,%r9d
push   $0x8c
push   $0x20
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    0x10(%rsp),%r8d
mov    %ebp,%r9d
push   $0x8c
push   0x28(%rsp)
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
xor    %r8d,%r8d
mov    %r14d,%r9d
push   $0xb4
mov    0x8(%rsp),%rbp
push   %rbp
call   10b0 <line@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %r14d,%r9d
push   $0xb4
push   $0x0
call   10b0 <line@plt>
add    $0x10,%rsp
mov    0x2a10(%rip),%rbx
mov    (%rbx),%edi
lea    0xac8(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x29f1(%rip),%rax
mov    (%rax),%ecx
mov    %r12,%rdi
mov    0x14(%rsp),%esi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    (%rbx),%edi
lea    0xaaf(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %eax,%eax
jmp    162d <main+0x46d>
mov    0x29c3(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0x9df(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa12(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x2,%eax
jmp    162d <main+0x46d>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s width height num_lines\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [35 x i8] c"Image size: %dx%d Array size: %d\0A\00"
@.str.2 = [16 x i8] c"Line Count: %d\0A\00"
@.str.3 = [25 x i8] c"Failed to allocate image\00"
@.str.4 = [23 x i8] c"Allocated image at %p\0A\00"
@.str.5 = [20 x i8] c"Drawing some lines\0A\00"
@.str.6 = [25 x i8] c"Writing image to stdout\0A\00"
@stdout = global i32 0
@.str.7 = [10 x i8] c"Goodbye.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timespec
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 4
br i1 %19, label %20, label %26
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 1, i32* %3
br label %261
26: ; preds = %2
%27 = load i32, i32* @CLOCK_MONOTONIC
%28 = call i32 @clock_gettime(i32 %27, %struct.timespec* %6)
%29 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%30 = load i64, i64* %29
%31 = trunc i64 %30 to i32
%32 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%33 = load i64, i64* %32
%34 = trunc i64 %33 to i32
%35 = xor i32 %31, %34
%36 = call i32 @srand(i32 %35)
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %8
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
store i32 %44, i32* %9
%45 = load i32, i32* %8
%46 = load i32, i32* %9
%47 = call i32 @size(i32 %45, i32 %46)
store i32 %47, i32* %10
%48 = load i32, i32* @stderr
%49 = load i32, i32* %8
%50 = load i32, i32* %9
%51 = load i32, i32* %10
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %49, i32 %50, i32 %51)
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 3
%55 = load i8*, i8** %54
%56 = call i32 @atoi(i8* %55)
store i32 %56, i32* %11
%57 = load i32, i32* @stderr
%58 = load i32, i32* %11
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %10
%61 = call i32* @malloc(i32 %60)
store i32* %61, i32** %7
%62 = load i32*, i32** %7
%63 = icmp eq i32* %62, null
br i1 %63, label %64, label %66
64: ; preds = %26
%65 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %3
br label %261
66: ; preds = %26
%67 = load i32*, i32** %7
%68 = load i32, i32* %10
%69 = call i32 @memset(i32* %67, i32 0, i32 %68)
%70 = load i32, i32* @stderr
%71 = load i32*, i32** %7
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32* %71)
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %12
br label %75
75: ; preds = %103, %66
%76 = load i32, i32* %12
%77 = load i32, i32* %11
%78 = icmp slt i32 %76, %77
br i1 %78, label %79, label %106
79: ; preds = %75
%80 = call i32 (...) @rand()
%81 = load i32, i32* %8
%82 = srem i32 %80, %81
store i32 %82, i32* %13
%83 = call i32 (...) @rand()
%84 = load i32, i32* %9
%85 = srem i32 %83, %84
store i32 %85, i32* %14
%86 = call i32 (...) @rand()
%87 = load i32, i32* %8
%88 = srem i32 %86, %87
store i32 %88, i32* %15
%89 = call i32 (...) @rand()
%90 = load i32, i32* %9
%91 = srem i32 %89, %90
store i32 %91, i32* %16
%92 = call i32 (...) @rand()
%93 = srem i32 %92, 50
store i32 %93, i32* %17
%94 = load i32*, i32** %7
%95 = load i32, i32* %8
%96 = load i32, i32* %9
%97 = load i32, i32* %13
%98 = load i32, i32* %14
%99 = load i32, i32* %15
%100 = load i32, i32* %16
%101 = load i32, i32* %17
%102 = call i32 @line(i32* %94, i32 %95, i32 %96, i32 %97, i32 %98, i32 %99, i32 %100, i32 %101)
br label %103
103: ; preds = %79
%104 = load i32, i32* %12
%105 = add nsw i32 %104, 1
store i32 %105, i32* %12
br label %75
106: ; preds = %75
%107 = load i32*, i32** %7
%108 = load i32, i32* %8
%109 = load i32, i32* %9
%110 = load i32, i32* %9
%111 = sdiv i32 %110, 2
%112 = load i32, i32* %8
%113 = sub nsw i32 %112, 1
%114 = load i32, i32* %9
%115 = sdiv i32 %114, 2
%116 = call i32 @line(i32* %107, i32 %108, i32 %109, i32 0, i32 %111, i32 %113, i32 %115, i32 148)
%117 = load i32*, i32** %7
%118 = load i32, i32* %8
%119 = load i32, i32* %9
%120 = load i32, i32* %8
%121 = sdiv i32 %120, 2
%122 = load i32, i32* %8
%123 = sdiv i32 %122, 2
%124 = load i32, i32* %9
%125 = sub nsw i32 %124, 1
%126 = call i32 @line(i32* %117, i32 %118, i32 %119, i32 %121, i32 0, i32 %123, i32 %125, i32 255)
%127 = load i32*, i32** %7
%128 = load i32, i32* %8
%129 = load i32, i32* %9
%130 = load i32, i32* %8
%131 = sub nsw i32 %130, 1
%132 = load i32, i32* %9
%133 = sdiv i32 %132, 2
%134 = call i32 @line(i32* %127, i32 %128, i32 %129, i32 0, i32 0, i32 %131, i32 %133, i32 164)
%135 = load i32*, i32** %7
%136 = load i32, i32* %8
%137 = load i32, i32* %9
%138 = load i32, i32* %9
%139 = sub nsw i32 %138, 1
%140 = load i32, i32* %8
%141 = sub nsw i32 %140, 1
%142 = load i32, i32* %9
%143 = sdiv i32 %142, 2
%144 = call i32 @line(i32* %135, i32 %136, i32 %137, i32 0, i32 %139, i32 %141, i32 %143, i32 164)
%145 = load i32*, i32** %7
%146 = load i32, i32* %8
%147 = load i32, i32* %9
%148 = call i32 @line(i32* %145, i32 %146, i32 %147, i32 0, i32 2, i32 30, i32 32, i32 180)
%149 = load i32*, i32** %7
%150 = load i32, i32* %8
%151 = load i32, i32* %9
%152 = load i32, i32* %9
%153 = sub nsw i32 %152, 3
%154 = load i32, i32* %9
%155 = sub nsw i32 %154, 33
%156 = call i32 @line(i32* %149, i32 %150, i32 %151, i32 0, i32 %153, i32 30, i32 %155, i32 180)
%157 = load i32*, i32** %7
%158 = load i32, i32* %8
%159 = load i32, i32* %9
%160 = load i32, i32* %8
%161 = sdiv i32 %160, 2
%162 = load i32, i32* %9
%163 = sub nsw i32 %162, 1
%164 = call i32 @line(i32* %157, i32 %158, i32 %159, i32 0, i32 0, i32 %161, i32 %163, i32 145)
%165 = load i32*, i32** %7
%166 = load i32, i32* %8
%167 = load i32, i32* %9
%168 = load i32, i32* %9
%169 = sub nsw i32 %168, 1
%170 = load i32, i32* %8
%171 = sdiv i32 %170, 2
%172 = call i32 @line(i32* %165, i32 %166, i32 %167, i32 0, i32 %169, i32 %171, i32 0, i32 145)
%173 = load i32*, i32** %7
%174 = load i32, i32* %8
%175 = load i32, i32* %9
%176 = load i32, i32* %8
%177 = sdiv i32 %176, 2
%178 = load i32, i32* %9
%179 = sdiv i32 %178, 4
%180 = load i32, i32* %9
%181 = sdiv i32 %180, 4
%182 = call i32 @line(i32* %173, i32 %174, i32 %175, i32 %177, i32 %179, i32 0, i32 %181, i32 160)
%183 = load i32*, i32** %7
%184 = load i32, i32* %8
%185 = load i32, i32* %9
%186 = load i32, i32* %8
%187 = sdiv i32 %186, 4
%188 = load i32, i32* %9
%189 = sdiv i32 %188, 2
%190 = load i32, i32* %8
%191 = sdiv i32 %190, 4
%192 = call i32 @line(i32* %183, i32 %184, i32 %185, i32 %187, i32 %189, i32 %191, i32 0, i32 160)
%193 = load i32*, i32** %7
%194 = load i32, i32* %8
%195 = load i32, i32* %9
%196 = load i32, i32* %8
%197 = sub nsw i32 %196, 1
%198 = load i32, i32* %9
%199 = sdiv i32 %198, 2
%200 = call i32 @line(i32* %193, i32 %194, i32 %195, i32 %197, i32 0, i32 0, i32 %199, i32 192)
%201 = load i32*, i32** %7
%202 = load i32, i32* %8
%203 = load i32, i32* %9
%204 = load i32, i32* %8
%205 = sub nsw i32 %204, 1
%206 = load i32, i32* %9
%207 = sub nsw i32 %206, 1
%208 = load i32, i32* %9
%209 = sdiv i32 %208, 2
%210 = call i32 @line(i32* %201, i32 %202, i32 %203, i32 %205, i32 %207, i32 0, i32 %209, i32 192)
%211 = load i32*, i32** %7
%212 = load i32, i32* %8
%213 = load i32, i32* %9
%214 = load i32, i32* %8
%215 = sub nsw i32 %214, 1
%216 = load i32, i32* %8
%217 = sub nsw i32 %216, 31
%218 = call i32 @line(i32* %211, i32 %212, i32 %213, i32 %215, i32 2, i32 %217, i32 32, i32 140)
%219 = load i32*, i32** %7
%220 = load i32, i32* %8
%221 = load i32, i32* %9
%222 = load i32, i32* %8
%223 = sub nsw i32 %222, 1
%224 = load i32, i32* %9
%225 = sub nsw i32 %224, 3
%226 = load i32, i32* %8
%227 = sub nsw i32 %226, 31
%228 = load i32, i32* %9
%229 = sub nsw i32 %228, 33
%230 = call i32 @line(i32* %219, i32 %220, i32 %221, i32 %223, i32 %225, i32 %227, i32 %229, i32 140)
%231 = load i32*, i32** %7
%232 = load i32, i32* %8
%233 = load i32, i32* %9
%234 = load i32, i32* %8
%235 = sub nsw i32 %234, 1
%236 = load i32, i32* %8
%237 = sdiv i32 %236, 2
%238 = load i32, i32* %9
%239 = sub nsw i32 %238, 1
%240 = call i32 @line(i32* %231, i32 %232, i32 %233, i32 %235, i32 0, i32 %237, i32 %239, i32 180)
%241 = load i32*, i32** %7
%242 = load i32, i32* %8
%243 = load i32, i32* %9
%244 = load i32, i32* %8
%245 = sub nsw i32 %244, 1
%246 = load i32, i32* %9
%247 = sub nsw i32 %246, 1
%248 = load i32, i32* %8
%249 = sdiv i32 %248, 2
%250 = call i32 @line(i32* %241, i32 %242, i32 %243, i32 %245, i32 %247, i32 %249, i32 0, i32 180)
%251 = load i32, i32* @stderr
%252 = call i32 (i32, i8*, ...) @fprintf(i32 %251, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%253 = load i32*, i32** %7
%254 = load i32, i32* %10
%255 = load i32, i32* @stdout
%256 = call i32 @fwrite(i32* %253, i32 %254, i32 1, i32 %255)
%257 = load i32*, i32** %7
%258 = call i32 @free(i32* %257)
%259 = load i32, i32* @stderr
%260 = call i32 (i32, i8*, ...) @fprintf(i32 %259, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %3
br label %261
261: ; preds = %106, %64, %20
%262 = load i32, i32* %3
ret i32 %262
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s width height num_lines\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [35 x i8] c"Image size: %dx%d Array size: %d\0A\00"
@.str.2 = [16 x i8] c"Line Count: %d\0A\00"
@.str.3 = [25 x i8] c"Failed to allocate image\00"
@.str.4 = [23 x i8] c"Allocated image at %p\0A\00"
@.str.5 = [20 x i8] c"Drawing some lines\0A\00"
@.str.6 = [25 x i8] c"Writing image to stdout\0A\00"
@stdout = global i32 0
@.str.7 = [10 x i8] c"Goodbye.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = icmp eq i32 %0, 4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %93
10: ; preds = %2
%11 = load i32, i32* @CLOCK_MONOTONIC
%12 = call i32 @clock_gettime(i32 %11, %struct.timespec* %3)
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%16 = load i64, i64* %15
%17 = xor i64 %16, %14
%18 = trunc i64 %17 to i32
%19 = call i32 @srand(i32 %18)
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = call i32 @size(i32 %22, i32 %25)
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %25, i32 %26)
%29 = getelementptr inbounds i8*, i8** %1, i64 3
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%34 = call i32* @malloc(i32 %26)
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %38
36: ; preds = %10
%37 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %93
38: ; preds = %10
%39 = call i32 @memset(i32* %34, i32 0, i32 %26)
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32* %34)
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp sgt i32 %31, 0
br i1 %44, label %78, label %45
45: ; preds = %78, %38
%46 = sdiv i32 %25, 2
%47 = add nsw i32 %22, -1
%48 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 %46, i32 %47, i32 %46, i32 148)
%49 = sdiv i32 %22, 2
%50 = add nsw i32 %25, -1
%51 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %49, i32 0, i32 %49, i32 %50, i32 255)
%52 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 0, i32 %47, i32 %46, i32 164)
%53 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 %50, i32 %47, i32 %46, i32 164)
%54 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 2, i32 30, i32 32, i32 180)
%55 = add nsw i32 %25, -3
%56 = add nsw i32 %25, -33
%57 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 %55, i32 30, i32 %56, i32 180)
%58 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 0, i32 %49, i32 %50, i32 145)
%59 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 0, i32 %50, i32 %49, i32 0, i32 145)
%60 = sdiv i32 %25, 4
%61 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %49, i32 %60, i32 0, i32 %60, i32 160)
%62 = sdiv i32 %22, 4
%63 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %62, i32 %46, i32 %62, i32 0, i32 160)
%64 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 0, i32 0, i32 %46, i32 192)
%65 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 %50, i32 0, i32 %46, i32 192)
%66 = add nsw i32 %22, -31
%67 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 2, i32 %66, i32 32, i32 140)
%68 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 %55, i32 %66, i32 %56, i32 140)
%69 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 0, i32 %49, i32 %50, i32 180)
%70 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %47, i32 %50, i32 %49, i32 0, i32 180)
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%73 = load i32, i32* @stdout
%74 = call i32 @fwrite(i32* %34, i32 %26, i32 1, i32 %73)
%75 = call i32 @free(i32* %34)
%76 = load i32, i32* @stderr
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %93
78: ; preds = %38, %78
%79 = phi i32 [ %91, %78 ], [ 0, %38 ]
%80 = call i32 (...) @rand()
%81 = srem i32 %80, %22
%82 = call i32 (...) @rand()
%83 = srem i32 %82, %25
%84 = call i32 (...) @rand()
%85 = srem i32 %84, %22
%86 = call i32 (...) @rand()
%87 = srem i32 %86, %25
%88 = call i32 (...) @rand()
%89 = srem i32 %88, 50
%90 = call i32 @line(i32* %34, i32 %22, i32 %25, i32 %81, i32 %83, i32 %85, i32 %87, i32 %89)
%91 = add nuw nsw i32 %79, 1
%92 = icmp eq i32 %91, %31
br i1 %92, label %45, label %78
93: ; preds = %45, %36, %6
%94 = phi i32 [ 1, %6 ], [ 2, %36 ], [ 0, %45 ]
ret i32 %94
}