#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 *, int, ...);
void job_plot(int start, int stop, int col, int n, double scale, int y0) {
  printf("2 2 0 1 0 7 100 0 %d 0.000 0 0 -1 0 0 5\n", col * 20 / 100);
  printf("\t%d %d ", 450 + 225 + (int)(start * scale), 1000 * n + 1800 + y0);
  printf("%d %d ", 450 + 225 + (int)(start * scale),
         1000 * n + 1800 - 225 + y0);
  printf("%d %d ", 450 + 225 + (int)(stop * scale), 1000 * n + 1800 - 225 + y0);
  printf("%d %d ", 450 + 225 + (int)(stop * scale), 1000 * n + 1800 + y0);
  printf("%d %d\n", 450 + 225 + (int)(start * scale), 1000 * n + 1800 + y0);
}


x86 assembly (clang, -O0):
<job_plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
imul   $0x14,-0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
add    $0x2a3,%esi
imul   $0x3e8,-0x10(%rbp),%edx
add    $0x708,%edx
add    -0x1c(%rbp),%edx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
add    $0x2a3,%esi
imul   $0x3e8,-0x10(%rbp),%edx
add    $0x708,%edx
sub    $0xe1,%edx
add    -0x1c(%rbp),%edx
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
add    $0x2a3,%esi
imul   $0x3e8,-0x10(%rbp),%edx
add    $0x708,%edx
sub    $0xe1,%edx
add    -0x1c(%rbp),%edx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
add    $0x2a3,%esi
imul   $0x3e8,-0x10(%rbp),%edx
add    $0x708,%edx
add    -0x1c(%rbp),%edx
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%esi
add    $0x2a3,%esi
imul   $0x3e8,-0x10(%rbp),%edx
add    $0x708,%edx
add    -0x1c(%rbp),%edx
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job_plot>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
movsd  %xmm0,(%rsp)
mov    %ecx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
movslq %edx,%rax
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x21,%rsi
add    %eax,%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%ebp
add    $0x2a3,%ebp
imul   $0x3e8,%ebx,%ebx
lea    (%rbx,%r15,1),%r12d
add    $0x708,%r12d
lea    0xeac(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rbx,%r15,1),%r13d
add    $0x627,%r13d
lea    0xe8f(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%ebx
add    $0x2a3,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe4b(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"2 2 0 1 0 7 100 0 %d 0.000 0 0 -1 0 0 5\0A\00"
@.str.1 = [8 x i8] c"\09%d %d \00"
@.str.2 = [7 x i8] c"%d %d \00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
define void @job_plot(i32 %0, i32 %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
store i32 %5, i32* %12
%13 = load i32, i32* %9
%14 = mul nsw i32 %13, 20
%15 = sdiv i32 %14, 100
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %7
%18 = sitofp i32 %17 to double
%19 = load double, double* %11
%20 = fmul double %18, %19
%21 = fptosi double %20 to i32
%22 = add nsw i32 675, %21
%23 = load i32, i32* %10
%24 = mul nsw i32 1000, %23
%25 = add nsw i32 %24, 1800
%26 = load i32, i32* %12
%27 = add nsw i32 %25, %26
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %27)
%29 = load i32, i32* %7
%30 = sitofp i32 %29 to double
%31 = load double, double* %11
%32 = fmul double %30, %31
%33 = fptosi double %32 to i32
%34 = add nsw i32 675, %33
%35 = load i32, i32* %10
%36 = mul nsw i32 1000, %35
%37 = add nsw i32 %36, 1800
%38 = sub nsw i32 %37, 225
%39 = load i32, i32* %12
%40 = add nsw i32 %38, %39
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %34, i32 %40)
%42 = load i32, i32* %8
%43 = sitofp i32 %42 to double
%44 = load double, double* %11
%45 = fmul double %43, %44
%46 = fptosi double %45 to i32
%47 = add nsw i32 675, %46
%48 = load i32, i32* %10
%49 = mul nsw i32 1000, %48
%50 = add nsw i32 %49, 1800
%51 = sub nsw i32 %50, 225
%52 = load i32, i32* %12
%53 = add nsw i32 %51, %52
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %47, i32 %53)
%55 = load i32, i32* %8
%56 = sitofp i32 %55 to double
%57 = load double, double* %11
%58 = fmul double %56, %57
%59 = fptosi double %58 to i32
%60 = add nsw i32 675, %59
%61 = load i32, i32* %10
%62 = mul nsw i32 1000, %61
%63 = add nsw i32 %62, 1800
%64 = load i32, i32* %12
%65 = add nsw i32 %63, %64
%66 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %60, i32 %65)
%67 = load i32, i32* %7
%68 = sitofp i32 %67 to double
%69 = load double, double* %11
%70 = fmul double %68, %69
%71 = fptosi double %70 to i32
%72 = add nsw i32 675, %71
%73 = load i32, i32* %10
%74 = mul nsw i32 1000, %73
%75 = add nsw i32 %74, 1800
%76 = load i32, i32* %12
%77 = add nsw i32 %75, %76
%78 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %72, i32 %77)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"2 2 0 1 0 7 100 0 %d 0.000 0 0 -1 0 0 5\0A\00"
@.str.1 = [8 x i8] c"\09%d %d \00"
@.str.2 = [7 x i8] c"%d %d \00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
define void @job_plot(i32 %0, i32 %1, i32 %2, i32 %3, double %4, i32 %5) {
%7 = sdiv i32 %2, 5
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = sitofp i32 %0 to double
%10 = fmul double %9, %4
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, 675
%13 = mul nsw i32 %3, 1000
%14 = add i32 %13, %5
%15 = add i32 %14, 1800
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %15)
%17 = add i32 %14, 1575
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %17)
%19 = sitofp i32 %1 to double
%20 = fmul double %19, %4
%21 = fptosi double %20 to i32
%22 = add nsw i32 %21, 675
%23 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %17)
%24 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %22, i32 %15)
%25 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %15)
ret void
}