#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*/ printf(char *, ...);
void ax_draw(unsigned long long int min, unsigned long long int max, int step,
             int s, int n, int label, int ntot, int y0) {
  int max_scale, j;
  double scale;
  if (s > 0) {
    scale = s;
  } else {
    scale = -1.0 / s;
  }
  max_scale = (max - min + 225) / step;
  y0 = (y0 * ((ntot - 1) * 1000 + 1800 + 225));
  printf("2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2\n");
  printf("0 0 1.00 60.00 120.00\n");
  printf("\t%d %d %d %d\n", 450, 1000 * n + 1800 + y0,
         (int)(450 + 225 + ((int)max - (int)min + 225) * scale),
         1000 * n + 1800 + y0);
  for (j = 1; j < max_scale; j++) {
    printf("2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2\n");
    printf("\t%d %d %d %d\n", (int)(450 + 225 + (j * step) * scale),
           1000 * n + 1800 + 225 / 2 + y0,
           (int)(450 + 225 + (j * step) * scale), 1000 * n + 1800 + y0);
    if (label) {
      printf("4 0 0 50 0 0 12 4.7124 4 135 345 ");
      printf("%d %d ", (int)(450 + 225 + (j * step) * scale) - 60,
             1000 * n + 1800 + 225 + y0);
      printf("%d\\001\n", j * step);
    } else {
    }
  }
}


x86 assembly (clang, -O0):
<ax_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    114d <ax_draw+0x3d>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1163 <ax_draw+0x53>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xea6(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0xe1,%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x24(%rbp)
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x3e8,%ecx,%ecx
add    $0x708,%ecx
add    $0xe1,%ecx
imul   %ecx,%eax
mov    %eax,0x18(%rbp)
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3e8,-0x1c(%rbp),%edx
add    $0x708,%edx
add    0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %ecx,%eax
add    $0xe1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
imul   $0x3e8,-0x1c(%rbp),%r8d
add    $0x708,%r8d
add    0x18(%rbp),%r8d
lea    0xe3f(%rip),%rdi
mov    $0x1c2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    134e <ax_draw+0x23e>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
imul   $0x3e8,-0x1c(%rbp),%edx
add    $0x708,%edx
add    $0x70,%edx
add    0x18(%rbp),%edx
mov    -0x28(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd78(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
imul   $0x3e8,-0x1c(%rbp),%r8d
add    $0x708,%r8d
add    0x18(%rbp),%r8d
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1336 <ax_draw+0x226>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd1b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
sub    $0x3c,%esi
imul   $0x3e8,-0x1c(%rbp),%edx
add    $0x708,%edx
add    $0xe1,%edx
add    0x18(%rbp),%edx
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
imul   -0x14(%rbp),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133b <ax_draw+0x22b>
jmp    133b <ax_draw+0x22b>
jmp    1340 <ax_draw+0x230>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1223 <ax_draw+0x113>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax_draw>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,0x4(%rsp)
mov    %r8d,%r14d
mov    %edx,%ebx
mov    %rsi,%rbp
mov    %rdi,%r13
cvtsi2sd %ecx,%xmm1
test   %ecx,%ecx
jg     1156 <ax_draw+0x36>
movsd  0xeb2(%rip),%xmm0
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mov    0x58(%rsp),%ecx
mov    0x50(%rsp),%esi
mov    %rbp,%rax
sub    %r13,%rax
add    $0xe1,%rax
movslq %ebx,%rdi
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
mov    %ebx,(%rsp)
movsd  %xmm1,0x8(%rsp)
je     118c <ax_draw+0x6c>
xor    %edx,%edx
div    %rdi
mov    %rax,%r15
jmp    1193 <ax_draw+0x73>
xor    %edx,%edx
div    %ebx
mov    %eax,%r15d
imul   $0x3e8,%esi,%ebx
add    $0x401,%ebx
imul   %ecx,%ebx
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
imul   $0x3e8,%r14d,%r14d
mov    %rbx,%r12
add    %r14d,%ebx
add    $0x708,%ebx
sub    %r13d,%ebp
add    $0xe1,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xe1d(%rip),%xmm0
cvttsd2si %xmm0,%ecx
lea    0xe1a(%rip),%rdi
mov    $0x1c2,%esi
mov    %ebx,%edx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%r15d
jl     12d6 <ax_draw+0x1b6>
mov    %r15,%r13
add    %r14d,%r12d
lea    0x778(%r12),%ebp
add    $0x7e9,%r12d
mov    %r12,0x10(%rsp)
mov    $0x1,%r12d
mov    (%rsp),%r15d
jmp    1251 <ax_draw+0x131>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
add    (%rsp),%r15d
cmp    %r13d,%r12d
je     12d6 <ax_draw+0x1b6>
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xd95(%rip),%xmm0
cvttsd2si %xmm0,%r14d
lea    0xd91(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
je     1240 <ax_draw+0x120>
lea    0xd7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffc4,%r14d
lea    0xd8f(%rip),%rdi
mov    %r14d,%esi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd80(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1240 <ax_draw+0x120>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2\0A\00"
@.str.1 = [23 x i8] c"0 0 1.00 60.00 120.00\0A\00"
@.str.2 = [14 x i8] c"\09%d %d %d %d\0A\00"
@.str.3 = [40 x i8] c"2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2\0A\00"
@.str.4 = [34 x i8] c"4 0 0 50 0 0 12 4.7124 4 135 345 \00"
@.str.5 = [7 x i8] c"%d %d \00"
@.str.6 = [8 x i8] c"%d\\001\0A\00"
define void @ax_draw(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
store i64 %0, i64* %9
store i64 %1, i64* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%20 = load i32, i32* %12
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %8
%23 = load i32, i32* %12
%24 = sitofp i32 %23 to double
store double %24, double* %19
br label %29
25: ; preds = %8
%26 = load i32, i32* %12
%27 = sitofp i32 %26 to double
%28 = fdiv double -1.000000e+00, %27
store double %28, double* %19
br label %29
29: ; preds = %25, %22
%30 = load i64, i64* %10
%31 = load i64, i64* %9
%32 = sub i64 %30, %31
%33 = add i64 %32, 225
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = udiv i64 %33, %35
%37 = trunc i64 %36 to i32
store i32 %37, i32* %17
%38 = load i32, i32* %16
%39 = load i32, i32* %15
%40 = sub nsw i32 %39, 1
%41 = mul nsw i32 %40, 1000
%42 = add nsw i32 %41, 1800
%43 = add nsw i32 %42, 225
%44 = mul nsw i32 %38, %43
store i32 %44, i32* %16
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%47 = load i32, i32* %13
%48 = mul nsw i32 1000, %47
%49 = add nsw i32 %48, 1800
%50 = load i32, i32* %16
%51 = add nsw i32 %49, %50
%52 = load i64, i64* %10
%53 = trunc i64 %52 to i32
%54 = load i64, i64* %9
%55 = trunc i64 %54 to i32
%56 = sub nsw i32 %53, %55
%57 = add nsw i32 %56, 225
%58 = sitofp i32 %57 to double
%59 = load double, double* %19
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double 6.750000e+02)
%61 = fptosi double %60 to i32
%62 = load i32, i32* %13
%63 = mul nsw i32 1000, %62
%64 = add nsw i32 %63, 1800
%65 = load i32, i32* %16
%66 = add nsw i32 %64, %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 450, i32 %51, i32 %61, i32 %66)
store i32 1, i32* %18
br label %68
68: ; preds = %125, %29
%69 = load i32, i32* %18
%70 = load i32, i32* %17
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %128
72: ; preds = %68
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%74 = load i32, i32* %18
%75 = load i32, i32* %11
%76 = mul nsw i32 %74, %75
%77 = sitofp i32 %76 to double
%78 = load double, double* %19
%79 = call double @llvm.fmuladd.f64(double %77, double %78, double 6.750000e+02)
%80 = fptosi double %79 to i32
%81 = load i32, i32* %13
%82 = mul nsw i32 1000, %81
%83 = add nsw i32 %82, 1800
%84 = add nsw i32 %83, 112
%85 = load i32, i32* %16
%86 = add nsw i32 %84, %85
%87 = load i32, i32* %18
%88 = load i32, i32* %11
%89 = mul nsw i32 %87, %88
%90 = sitofp i32 %89 to double
%91 = load double, double* %19
%92 = call double @llvm.fmuladd.f64(double %90, double %91, double 6.750000e+02)
%93 = fptosi double %92 to i32
%94 = load i32, i32* %13
%95 = mul nsw i32 1000, %94
%96 = add nsw i32 %95, 1800
%97 = load i32, i32* %16
%98 = add nsw i32 %96, %97
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %80, i32 %86, i32 %93, i32 %98)
%100 = load i32, i32* %14
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %123
102: ; preds = %72
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%104 = load i32, i32* %18
%105 = load i32, i32* %11
%106 = mul nsw i32 %104, %105
%107 = sitofp i32 %106 to double
%108 = load double, double* %19
%109 = call double @llvm.fmuladd.f64(double %107, double %108, double 6.750000e+02)
%110 = fptosi double %109 to i32
%111 = sub nsw i32 %110, 60
%112 = load i32, i32* %13
%113 = mul nsw i32 1000, %112
%114 = add nsw i32 %113, 1800
%115 = add nsw i32 %114, 225
%116 = load i32, i32* %16
%117 = add nsw i32 %115, %116
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %111, i32 %117)
%119 = load i32, i32* %18
%120 = load i32, i32* %11
%121 = mul nsw i32 %119, %120
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %121)
br label %124
123: ; preds = %72
br label %124
124: ; preds = %123, %102
br label %125
125: ; preds = %124
%126 = load i32, i32* %18
%127 = add nsw i32 %126, 1
store i32 %127, i32* %18
br label %68
128: ; preds = %68
ret void
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"\09%d %d %d %d\0A\00"
@.str.4 = [34 x i8] c"4 0 0 50 0 0 12 4.7124 4 135 345 \00"
@.str.5 = [7 x i8] c"%d %d \00"
@.str.6 = [8 x i8] c"%d\\001\0A\00"
@str = [39 x i8] c"2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2\00"
@str.7 = [22 x i8] c"0 0 1.00 60.00 120.00\00"
@str.8 = [39 x i8] c"2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2\00"
define void @ax_draw(i64 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = icmp sgt i32 %3, 0
%10 = sitofp i32 %3 to double
%11 = fdiv double -1.000000e+00, %10
%12 = select i1 %9, double %10, double %11
%13 = sub i64 225, %0
%14 = add i64 %13, %1
%15 = sext i32 %2 to i64
%16 = udiv i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = mul i32 %6, 1000
%19 = add i32 %18, 1025
%20 = mul nsw i32 %19, %7
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0))
%23 = mul nsw i32 %4, 1000
%24 = add i32 %20, %23
%25 = add i32 %24, 1800
%26 = trunc i64 %1 to i32
%27 = trunc i64 %0 to i32
%28 = sub i32 225, %27
%29 = add i32 %28, %26
%30 = sitofp i32 %29 to double
%31 = tail call double @llvm.fmuladd.f64(double %30, double %12, double 6.750000e+02)
%32 = fptosi double %31 to i32
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 450, i32 %25, i32 %32, i32 %25)
%34 = icmp sgt i32 %17, 1
br i1 %34, label %35, label %55
35: ; preds = %8
%36 = add i32 %24, 1912
%37 = icmp eq i32 %5, 0
%38 = add i32 %24, 2025
br label %39
39: ; preds = %35, %52
%40 = phi i32 [ 1, %35 ], [ %53, %52 ]
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.8, i64 0, i64 0))
%42 = mul nsw i32 %40, %2
%43 = sitofp i32 %42 to double
%44 = tail call double @llvm.fmuladd.f64(double %43, double %12, double 6.750000e+02)
%45 = fptosi double %44 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %45, i32 %36, i32 %45, i32 %25)
br i1 %37, label %52, label %47
47: ; preds = %39
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%49 = add nsw i32 %45, -60
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %49, i32 %38)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %42)
br label %52
52: ; preds = %47, %39
%53 = add nuw nsw i32 %40, 1
%54 = icmp eq i32 %53, %17
br i1 %54, label %55, label %39
55: ; preds = %52, %8
ret void
}