// File: /workspace/github_cpp_makefile_star2_O1/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 0xd75a(%rip), %xmm0     # 0x14f58
leaq 0xd7d3(%rip), %rdi      # 0x14fd8
movb $0x1, %al
callq 0x3040
leaq 0xdb6e(%rip), %rdi      # 0x15381
callq 0x32f0
leaq 0xdc67(%rip), %rdi      # 0x15486
callq 0x32f0
movsd 0x28(%rbx), %xmm0
movsd 0xd72f(%rip), %xmm1     # 0x14f60
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpltpd %xmm0, %xmm1
andpd %xmm2, %xmm1
movd %xmm1, %ebp
testb $0x1, %bpl
je 0x785f
leaq 0xd78e(%rip), %rdi      # 0x14fe6
movb $0x1, %al
callq 0x3040
movl $0xa, %edi
callq 0x32b0
movq (%rbx), %rcx
leaq 0xd799(%rip), %rsi      # 0x1500c
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xdb05(%rip), %rdi      # 0x15387
callq 0x32f0
leaq 0xdb1a(%rip), %rdi      # 0x153a8
callq 0x32f0
leaq 0xdb4b(%rip), %rdi      # 0x153e5
callq 0x32f0
leaq 0xdb76(%rip), %rdi      # 0x1541c
callq 0x32f0
leaq 0xdb70(%rip), %rdi      # 0x15422
callq 0x32f0
leaq 0xdb8b(%rip), %rdi      # 0x15449
callq 0x32f0
movq (%rbx), %rcx
leaq 0xd74d(%rip), %rsi      # 0x1501a
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xdba4(%rip), %rdi      # 0x15480
callq 0x32f0
movsd (%r14), %xmm0
mulsd 0xc72a(%rip), %xmm0     # 0x14018
leaq 0xd748(%rip), %rdi      # 0x1503d
movb $0x1, %al
callq 0x3040
movsd 0x20(%rbx), %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movsd 0x20(%rbx), %xmm0
leaq 0xd764(%rip), %rdi      # 0x1507a
movb $0x1, %al
callq 0x3040
testb $0x1, %bpl
je 0x7936
movsd 0x28(%rbx), %xmm0
leaq 0xd757(%rip), %rdi      # 0x15086
movb $0x1, %al
callq 0x3040
leaq 0xdb49(%rip), %rdi      # 0x15486
callq 0x32f0
leaq 0xdb65(%rip), %rdi      # 0x154ae
callq 0x32f0
leaq 0xdb80(%rip), %rdi      # 0x154d5
callq 0x32f0
movsd (%r14), %xmm0
movapd %xmm0, %xmm1
mulsd 0xc6ad(%rip), %xmm1     # 0x14018
movsd %xmm1, 0x8(%rsp)
mulsd 0xc6b7(%rip), %xmm0     # 0x14030
movsd %xmm0, 0x10(%rsp)
movq (%rbx), %rax
movsd 0xd5de(%rip), %xmm0     # 0x14f68
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 0xd5b7(%rip), %xmm0     # 0x14f70
movq %rbx, %rdi
movq %r14, %rsi
callq *0x48(%rax)
movq (%rbx), %rax
movsd 0xc693(%rip), %xmm0     # 0x14060
movq %rbx, %rdi
callq *0x28(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0xc631(%rip), %xmm0     # 0x14018
movsd %xmm0, (%r14)
movq %r15, 0x8(%r14)
movq (%rbx), %rax
leaq 0x18(%rsp), %r14
movsd 0xc628(%rip), %xmm1     # 0x14028
movq %rbx, %rdi
movq %r14, %rsi
movsd 0xd562(%rip), %xmm0     # 0x14f70
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 0xd53d(%rip), %xmm0     # 0x14f70
callq *0x48(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
movq (%rbx), %rax
movsd 0xc5d6(%rip), %xmm0     # 0x14020
movq %rbx, %rdi
callq *0x40(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop