// File: /workspace/github_cpp_makefile_star2_O3/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 0xdab6(%rip), %xmm0     # 0x14fb0
leaq 0xdb37(%rip), %rdi      # 0x15038
movb $0x1, %al
callq 0x3040
leaq 0xded2(%rip), %rdi      # 0x153e1
callq 0x32f0
leaq 0xdfcb(%rip), %rdi      # 0x154e6
callq 0x32f0
movsd 0x28(%rbx), %xmm0
movsd 0xda8b(%rip), %xmm1     # 0x14fb8
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpltpd %xmm0, %xmm1
andpd %xmm2, %xmm1
movd %xmm1, %ebp
testb $0x1, %bpl
je 0x755b
leaq 0xdaf2(%rip), %rdi      # 0x15046
movb $0x1, %al
callq 0x3040
movl $0xa, %edi
callq 0x32b0
movq (%rbx), %rcx
leaq 0xdafd(%rip), %rsi      # 0x1506c
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xde69(%rip), %rdi      # 0x153e7
callq 0x32f0
leaq 0xde7e(%rip), %rdi      # 0x15408
callq 0x32f0
leaq 0xdeaf(%rip), %rdi      # 0x15445
callq 0x32f0
leaq 0xdeda(%rip), %rdi      # 0x1547c
callq 0x32f0
leaq 0xded4(%rip), %rdi      # 0x15482
callq 0x32f0
leaq 0xdeef(%rip), %rdi      # 0x154a9
callq 0x32f0
movq (%rbx), %rcx
leaq 0xdab1(%rip), %rsi      # 0x1507a
movq %rbx, %rdi
xorl %eax, %eax
callq *0x18(%rcx)
leaq 0xdf08(%rip), %rdi      # 0x154e0
callq 0x32f0
movsd (%r14), %xmm0
mulsd 0xd9d6(%rip), %xmm0     # 0x14fc0
leaq 0xdaac(%rip), %rdi      # 0x1509d
movb $0x1, %al
callq 0x3040
movsd 0x20(%rbx), %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movsd 0x20(%rbx), %xmm0
leaq 0xdac8(%rip), %rdi      # 0x150da
movb $0x1, %al
callq 0x3040
testb $0x1, %bpl
je 0x7632
movsd 0x28(%rbx), %xmm0
leaq 0xdabb(%rip), %rdi      # 0x150e6
movb $0x1, %al
callq 0x3040
leaq 0xdead(%rip), %rdi      # 0x154e6
callq 0x32f0
leaq 0xdec9(%rip), %rdi      # 0x1550e
callq 0x32f0
leaq 0xdee4(%rip), %rdi      # 0x15535
callq 0x32f0
movsd (%r14), %xmm0
movapd %xmm0, %xmm1
mulsd 0xd959(%rip), %xmm1     # 0x14fc0
movsd %xmm1, 0x8(%rsp)
mulsd 0xca33(%rip), %xmm0     # 0x140a8
movsd %xmm0, 0x10(%rsp)
movq (%rbx), %rax
movsd 0xd942(%rip), %xmm0     # 0x14fc8
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 0xd91b(%rip), %xmm0     # 0x14fd0
movq %rbx, %rdi
movq %r14, %rsi
callq *0x48(%rax)
movq (%rbx), %rax
movsd 0xca0f(%rip), %xmm0     # 0x140d8
movq %rbx, %rdi
callq *0x28(%rax)
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0xd8dd(%rip), %xmm0     # 0x14fc0
movsd %xmm0, (%r14)
movq %r15, 0x8(%r14)
movq (%rbx), %rax
leaq 0x18(%rsp), %r14
movsd 0xc9a4(%rip), %xmm1     # 0x140a0
movq %rbx, %rdi
movq %r14, %rsi
movsd 0xd8c6(%rip), %xmm0     # 0x14fd0
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 0xd8a1(%rip), %xmm0     # 0x14fd0
callq *0x48(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x38(%rax)
movq (%rbx), %rax
movsd 0xc952(%rip), %xmm0     # 0x14098
movq %rbx, %rdi
callq *0x40(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop