#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 yax_draw(int npids, int npidstot, int y0) {
  y0 *= (npidstot - 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 + 225, npids * 1000 + 1800 + 225 + y0,
         450 + 225, 1800 - 750 + y0);
}


x86 assembly (clang, -O0):
<yax_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
imul   $0x3e8,%eax,%eax
add    $0x708,%eax
add    $0xe1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3e8,-0x4(%rbp),%edx
add    $0x708,%edx
add    $0xe1,%edx
add    -0xc(%rbp),%edx
mov    -0xc(%rbp),%r8d
add    $0x41a,%r8d
lea    0xebd(%rip),%rdi
mov    $0x2a3,%ecx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yax_draw>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
imul   $0x3e8,%esi,%ebx
add    $0x401,%ebx
imul   %edx,%ebx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
imul   $0x3e8,%ebp,%eax
lea    (%rax,%rbx,1),%edx
add    $0x7e9,%edx
add    $0x41a,%ebx
lea    0xe98(%rip),%rdi
mov    $0x2a3,%esi
mov    $0x2a3,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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"
define void @yax_draw(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 1
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %9, 1800
%11 = add nsw i32 %10, 225
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, %11
store i32 %13, i32* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 1000
%18 = add nsw i32 %17, 1800
%19 = add nsw i32 %18, 225
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = add nsw i32 1050, %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 675, i32 %21, i32 675, i32 %23)
ret void
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"\09%d %d %d %d\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.3 = [22 x i8] c"0 0 1.00 60.00 120.00\00"
define void @yax_draw(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 1000
%5 = add i32 %4, 1025
%6 = mul nsw i32 %5, %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
%9 = mul nsw i32 %0, 1000
%10 = add nsw i32 %9, 2025
%11 = add nsw i32 %10, %6
%12 = add nsw i32 %6, 1050
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 675, i32 %11, i32 675, i32 %12)
ret void
}