#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 */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PsLine(struct ADrawTag *, unsigned int, unsigned int,
                          unsigned int, unsigned int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getPsFile(struct ADrawTag *);
void PsDottedLine(struct ADrawTag *ctx, unsigned int x1, unsigned int y1,
                  unsigned int x2, unsigned int y2) {
  fprintf(getPsFile(ctx), "[2] 0 setdash\n");
  PsLine(ctx, x1, y1, x2, y2);
  fprintf(getPsFile(ctx), "[] 0 setdash\n");
}


x86 assembly (clang, -O0):
<PsDottedLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getPsFile@plt>
mov    %eax,%edi
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <PsLine@plt>
mov    -0x8(%rbp),%rdi
call   1050 <getPsFile@plt>
mov    %eax,%edi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsDottedLine>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <getPsFile@plt>
lea    0xeae(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <PsLine@plt>
mov    %rbx,%rdi
call   1050 <getPsFile@plt>
lea    0xe94(%rip),%rsi
mov    %eax,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [15 x i8] c"[2] 0 setdash\0A\00"
@.str.1 = [14 x i8] c"[] 0 setdash\0A\00"
define void @PsDottedLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ADrawTag*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%12 = call i32 @getPsFile(%struct.ADrawTag* %11)
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = call i32 @PsLine(%struct.ADrawTag* %14, i32 %15, i32 %16, i32 %17, i32 %18)
%20 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%21 = call i32 @getPsFile(%struct.ADrawTag* %20)
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [15 x i8] c"[2] 0 setdash\0A\00"
@.str.1 = [14 x i8] c"[] 0 setdash\0A\00"
define void @PsDottedLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @getPsFile(%struct.ADrawTag* %0)
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @PsLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%9 = tail call i32 @getPsFile(%struct.ADrawTag* %0)
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}