#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*/ bresenham_circle(int, int, int, int, int, char **);
int /*<<< orphan*/ bresenham_line(int, int, int, int, int, int, char **);
int /*<<< orphan*/ create_canvas(int, int, char **);
int /*<<< orphan*/ print_canvas(int, int, char **);
int /*<<< orphan*/ scanf(char *, int *, int *, ...);
int main() {
  int w, h;
  int x1, y1, x3, y3;
  int cx, cy, r;
  scanf("%d %d", &w, &h);
  scanf("%d %d %d %d", &x1, &y1, &x3, &y3);
  scanf("%d %d %d", &cx, &cy, &r);
  char canvas[h][w];
  create_canvas(h, w, canvas);
  bresenham_line(x1, y1, x3, y3, h, w, canvas);
  bresenham_circle(cx, cy, r, h, w, canvas);
  print_canvas(w, h, canvas);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea0(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x49(%rbp)
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    -0x49(%rbp),%al
lea    0xe7e(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <scanf@plt>
mov    -0x49(%rbp),%al
lea    0xe62(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1060 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    %rsp,%rdx
mov    %rdx,-0x30(%rbp)
mov    %rcx,%rsi
imul   %rax,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x48(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <create_canvas@plt>
mov    -0x48(%rbp),%rax
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%r9d
sub    $0x10,%rsp
mov    %rax,(%rsp)
call   1050 <bresenham_line@plt>
mov    -0x48(%rbp),%r9
add    $0x10,%rsp
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
call   1030 <bresenham_circle@plt>
mov    -0x48(%rbp),%rdx
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <print_canvas@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xea4(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x14(%rbp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe88(%rip),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
lea    -0x28(%rbp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe6d(%rip),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    %rbx,%rdx
call   1040 <create_canvas@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
sub    $0x8,%rsp
push   %rbx
call   1050 <bresenham_line@plt>
add    $0x10,%rsp
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    %rbx,%r9
call   1030 <bresenham_circle@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    %rbx,%rdx
call   1070 <print_canvas@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %1
%14 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%15 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %7)
%16 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %11
%22 = mul nuw i64 %18, %20
%23 = alloca i8, i64 %22
store i64 %18, i64* %12
store i64 %20, i64* %13
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = bitcast i8* %23 to i8**
%27 = call i32 @create_canvas(i32 %24, i32 %25, i8** %26)
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = load i32, i32* %3
%33 = load i32, i32* %2
%34 = bitcast i8* %23 to i8**
%35 = call i32 @bresenham_line(i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, i8** %34)
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = load i32, i32* %10
%39 = load i32, i32* %3
%40 = load i32, i32* %2
%41 = bitcast i8* %23 to i8**
%42 = call i32 @bresenham_circle(i32 %36, i32 %37, i32 %38, i32 %39, i32 %40, i8** %41)
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = bitcast i8* %23 to i8**
%46 = call i32 @print_canvas(i32 %43, i32 %44, i8** %45)
store i32 0, i32* %1
%47 = load i8*, i8** %11
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"%d %d %d %d\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast i32* %1 to i8*
%11 = bitcast i32* %2 to i8*
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast i32* %6 to i8*
%16 = bitcast i32* %7 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast i32* %9 to i8*
%19 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%20 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%21 = call i32 (i8*, i32*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%22 = load i32, i32* %2
%23 = zext i32 %22 to i64
%24 = load i32, i32* %1
%25 = zext i32 %24 to i64
%26 = call i8* @llvm.stacksave()
%27 = mul nuw i64 %25, %23
%28 = alloca i8, i64 %27
%29 = load i32, i32* %2
%30 = load i32, i32* %1
%31 = bitcast i8* %28 to i8**
%32 = call i32 @create_canvas(i32 %29, i32 %30, i8** %31)
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = load i32, i32* %2
%38 = load i32, i32* %1
%39 = call i32 @bresenham_line(i32 %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 %38, i8** %31)
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = load i32, i32* %9
%43 = load i32, i32* %2
%44 = load i32, i32* %1
%45 = call i32 @bresenham_circle(i32 %40, i32 %41, i32 %42, i32 %43, i32 %44, i8** %31)
%46 = load i32, i32* %1
%47 = load i32, i32* %2
%48 = call i32 @print_canvas(i32 %46, i32 %47, i8** %31)
ret i32 0
}