// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-multi-shell-extrude/printer.cc
// Function: (anonymous namespace)::GCodePrinter::Init(Vector2D const&, double)
virtual void Init(const Vector2D &machine_limit,
                    double feed_mm_per_sec) {
    printf("G28\nG1 F%.1f\n", feed_mm_per_sec * 60);
    printf("G1 Z5\n");
    printf("M82      ; absolute E\n"
           "G92 E0.0 ; zero E\n");
    const bool with_heated_bed = bed_temp_ > 0 && bed_temp_ < 120;
    if (with_heated_bed) {
      printf("M140 S%.0f  ; not waiting for it yet\n", bed_temp_);
    }

    // Bed leveling
    printf("\n");
    Comment("Bed leveling\n");
    printf("M84 E         ; turn off e motor\n");
    printf("M109 S170     ; min temperature not have soft nozzle buggers\n");
    printf("G1 E-2 F2400  ; retract to not ooze while bed leveling\n");
    printf("M84 E\n");
    printf("G28 Z0        ; Establish a general Z0\n");
    printf("G29           ; bed levelling after everything is hot\n\n");

    Comment("Wait for all temperatures reached\n");
    printf("G1 E0\n");
    printf("G0 X%.1f Y10 Z30 F6000 ; move to center front while heating\n",
           machine_limit.x/2);

    SetTemperature(temperature_);

    // Waiting for temperature
    printf("M109 S%.0f\n", temperature_);
    if (with_heated_bed) {
      printf("M190 S%.0f ; wait for bed-temp\n", bed_temp_);
    }

    printf("M82      ; absolute E\nG92 E0.0 ; zero E\n");
    printf("G1 E3    ; squirt out some test in air\n"); // squirt out some test
    printf("G92 E0.0\n\n; test extrusion...\n");
    const double test_extrusion_from = 0.5 * machine_limit.x;
    const double test_extrusion_to = 0.1 * machine_limit.x;
    SetSpeed(300.0);
    MoveTo(Vector2D(test_extrusion_from, 10), 0.2);
    SetSpeed(15);
    ExtrudeTo(Vector2D((test_extrusion_from + test_extrusion_to)/2, 10),
              0.2, 1.0);
    // Remaining just move to wipe nozzle properly.
    MoveTo(Vector2D(test_extrusion_to, 10), 0.2);
    Retract();
    GoZPos(5);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
mulsd 0xc552(%rip), %xmm0     # 0x12fb0
leaq 0xc5cf(%rip), %rdi      # 0x13034
movb $0x1, %al
callq 0x3040
leaq 0xc96a(%rip), %rdi      # 0x133dd
callq 0x3320
leaq 0xca63(%rip), %rdi      # 0x134e2
callq 0x3320
movsd 0x28(%rbx), %xmm0
movsd 0xc527(%rip), %xmm1     # 0x12fb8
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpltpd %xmm0, %xmm1
andpd %xmm2, %xmm1
movd %xmm1, %ebp
testb $0x1, %bpl
je 0x6abf
leaq 0xc58a(%rip), %rdi      # 0x13042
movb $0x1, %al
callq 0x3040
pushq $0xa
popq %rdi
callq 0x32e0
movq (%rbx), %rcx
leaq 0xc597(%rip), %rsi      # 0x13068
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xc903(%rip), %rdi      # 0x133e3
callq 0x3320
leaq 0xc918(%rip), %rdi      # 0x13404
callq 0x3320
leaq 0xc949(%rip), %rdi      # 0x13441
callq 0x3320
leaq 0xc974(%rip), %rdi      # 0x13478
callq 0x3320
leaq 0xc96e(%rip), %rdi      # 0x1347e
callq 0x3320
leaq 0xc989(%rip), %rdi      # 0x134a5
callq 0x3320
movq (%rbx), %rcx
leaq 0xc54b(%rip), %rsi      # 0x13076
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xc9a2(%rip), %rdi      # 0x134dc
callq 0x3320
movsd (%r14), %xmm0
mulsd 0xc474(%rip), %xmm0     # 0x12fc0
leaq 0xc546(%rip), %rdi      # 0x13099
movb $0x1, %al
callq 0x3040
movsd 0x20(%rbx), %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movsd 0x20(%rbx), %xmm0
leaq 0xc562(%rip), %rdi      # 0x130d6
movb $0x1, %al
callq 0x3040
testb $0x1, %bpl
je 0x6b94
movsd 0x28(%rbx), %xmm0
leaq 0xc555(%rip), %rdi      # 0x130e2
movb $0x1, %al
callq 0x3040
leaq 0xc947(%rip), %rdi      # 0x134e2
callq 0x3320
leaq 0xc963(%rip), %rdi      # 0x1350a
callq 0x3320
leaq 0xc97e(%rip), %rdi      # 0x13531
callq 0x3320
movsd (%r14), %xmm0
movapd %xmm0, %xmm1
mulsd 0xc3f7(%rip), %xmm1     # 0x12fc0
movsd %xmm1, 0x8(%rsp)
mulsd 0xb4b1(%rip), %xmm0     # 0x12088
movsd %xmm0, 0x10(%rsp)
movq (%rbx), %rax
movsd 0xc3e0(%rip), %xmm0     # 0x12fc8
movq %rbx, %rdi
callq *0x28(%rax)
leaq 0x18(%rsp), %r14
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r14)
movabsq $0x4024000000000000, %r15 # imm = 0x4024000000000000
movq %r15, 0x8(%r14)
movq (%rbx), %rax
movsd 0xc3b9(%rip), %xmm0     # 0x12fd0
movq %rbx, %rdi
movq %r14, %rsi
callq *0x48(%rax)
movq (%rbx), %rax
movsd 0xb495(%rip), %xmm0     # 0x120c0
movq %rbx, %rdi
callq *0x28(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0xc37b(%rip), %xmm0     # 0x12fc0
movsd %xmm0, (%r14)
movq %r15, 0x8(%r14)
movq (%rbx), %rax
leaq 0x18(%rsp), %r14
movsd 0xb422(%rip), %xmm1     # 0x12080
movq %rbx, %rdi
movq %r14, %rsi
movsd 0xc364(%rip), %xmm0     # 0x12fd0
callq *0x50(%rax)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r14)
movq %r15, 0x8(%r14)
movq (%rbx), %rax
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movsd 0xc33f(%rip), %xmm0     # 0x12fd0
callq *0x48(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
movq (%rbx), %rax
movsd 0xb3d0(%rip), %xmm0     # 0x12078
movq %rbx, %rdi
callq *0x40(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop