#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 _cordx(int /*<<< orphan*/);
int _cordy(int /*<<< orphan*/);
int _plnorm(double);
int /*<<< orphan*/ printf(char *, int, int, ...);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int hatch(int ip, double *ax, double *ay, int n, double d, double t) {
  if (n < 3)
    return (1);
  ip += 20;
  printf("%%%d %d %d\n", ip, _plnorm(d), _plnorm(t));
  while (--n >= 0)
    printf("%d %d\n", _cordx(*ax++), _cordy(*ay++));
  putchar(0);
  return (0);
}


x86 assembly (clang, -O0):
<hatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1186 <hatch+0x36>
movl   $0x1,-0x4(%rbp)
jmp    122d <hatch+0xdd>
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <_plnorm@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <_plnorm@plt>
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    %eax,%ecx
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jl     121f <hatch+0xcf>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvttsd2si (%rax),%edi
call   1060 <_cordx@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
cvttsd2si (%rax),%edi
call   1070 <_cordy@plt>
mov    -0x3c(%rbp),%esi
mov    %eax,%edx
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11c2 <hatch+0x72>
xor    %edi,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hatch>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%ecx
jl     11ed <hatch+0x9d>
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
add    $0x14,%r12d
movsd  %xmm1,(%rsp)
call   1040 <_plnorm@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   1040 <_plnorm@plt>
lea    0xe6b(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
lea    0xe58(%rip),%r12
xor    %ebp,%ebp
nop
cvttsd2si (%r15,%rbp,1),%edi
call   1060 <_cordx@plt>
mov    %eax,%r13d
cvttsd2si (%r14,%rbp,1),%edi
call   1070 <_cordy@plt>
mov    %r12,%rdi
mov    %r13d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebx
add    $0x8,%rbp
cmp    $0x1,%ebx
ja     11b0 <hatch+0x60>
xor    %ebp,%ebp
xor    %edi,%edi
call   1030 <putchar@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%%%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @hatch(i32 %0, double* %1, double* %2, i32 %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %8
store double* %1, double** %9
store double* %2, double** %10
store i32 %3, i32* %11
store double %4, double* %12
store double %5, double* %13
%14 = load i32, i32* %11
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %44
17: ; preds = %6
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 20
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = load double, double* %12
%22 = call i32 @_plnorm(double %21)
%23 = load double, double* %13
%24 = call i32 @_plnorm(double %23)
%25 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %22, i32 %24)
br label %26
26: ; preds = %30, %17
%27 = load i32, i32* %11
%28 = add nsw i32 %27, -1
store i32 %28, i32* %11
%29 = icmp sge i32 %28, 0
br i1 %29, label %30, label %42
30: ; preds = %26
%31 = load double*, double** %9
%32 = getelementptr inbounds double, double* %31, i32 1
store double* %32, double** %9
%33 = load double, double* %31
%34 = fptosi double %33 to i32
%35 = call i32 @_cordx(i32 %34)
%36 = load double*, double** %10
%37 = getelementptr inbounds double, double* %36, i32 1
store double* %37, double** %10
%38 = load double, double* %36
%39 = fptosi double %38 to i32
%40 = call i32 @_cordy(i32 %39)
%41 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %40)
br label %26
42: ; preds = %26
%43 = call i32 @putchar(i32 0)
store i32 0, i32* %7
br label %44
44: ; preds = %42, %16
%45 = load i32, i32* %7
ret i32 %45
}

LLVM IR (-O2):
@.str = [12 x i8] c"%%%d %d %d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @hatch(i32 %0, double* nocapture %1, double* nocapture %2, i32 %3, double %4, double %5) {
%7 = icmp slt i32 %3, 3
br i1 %7, label %30, label %8
8: ; preds = %6
%9 = add nsw i32 %0, 20
%10 = tail call i32 @_plnorm(double %4)
%11 = tail call i32 @_plnorm(double %5)
%12 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
br label %13
13: ; preds = %8, %13
%14 = phi i32 [ %3, %8 ], [ %17, %13 ]
%15 = phi double* [ %2, %8 ], [ %22, %13 ]
%16 = phi double* [ %1, %8 ], [ %18, %13 ]
%17 = add nsw i32 %14, -1
%18 = getelementptr inbounds double, double* %16, i64 1
%19 = load double, double* %16
%20 = fptosi double %19 to i32
%21 = tail call i32 @_cordx(i32 %20)
%22 = getelementptr inbounds double, double* %15, i64 1
%23 = load double, double* %15
%24 = fptosi double %23 to i32
%25 = tail call i32 @_cordy(i32 %24)
%26 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %25)
%27 = icmp ugt i32 %14, 1
br i1 %27, label %13, label %28
28: ; preds = %13
%29 = tail call i32 @putchar(i32 0)
br label %30
30: ; preds = %6, %28
%31 = phi i32 [ 0, %28 ], [ 1, %6 ]
ret i32 %31
}