printpos(pos) long pos;
{
  if (pos == 0)
    printf("at unknown position: ");
  else {
    extern char *GetFileName();
    extern long GetLine();
    extern long GetCol();
    printf("%s.g:%ld:%ld: ", GetFileName(pos), GetLine(pos), GetCol(pos));
  }
}


x86 assembly (clang, -O0):
<printpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <printpos+0x2a>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ac <printpos+0x6c>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <GetFileName@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <GetLine@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <GetCol@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printpos>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1187 <printpos+0x47>
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <GetFileName@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <GetLine@plt>
mov    %rax,%r15
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <GetCol@plt>
lea    0xea1(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1195 <printpos+0x55>
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"at unknown position: \00"
@.str.1 = [15 x i8] c"%s.g:%ld:%ld: \00"
define i32 @printpos(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* (i64, ...) bitcast (i8* (...)* @GetFileName to i8* (i64, ...)*)(i64 %9)
%11 = load i64, i64* %3
%12 = call i64 (i64, ...) bitcast (i64 (...)* @GetLine to i64 (i64, ...)*)(i64 %11)
%13 = load i64, i64* %3
%14 = call i64 (i64, ...) bitcast (i64 (...)* @GetCol to i64 (i64, ...)*)(i64 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %10, i64 %12, i64 %14)
br label %16
16: ; preds = %8, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"at unknown position: \00"
@.str.1 = [15 x i8] c"%s.g:%ld:%ld: \00"
define i32 @printpos(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = tail call i8* (i64, ...) bitcast (i8* (...)* @GetFileName to i8* (i64, ...)*)(i64 %0)
%7 = tail call i64 (i64, ...) bitcast (i64 (...)* @GetLine to i64 (i64, ...)*)(i64 %0)
%8 = tail call i64 (i64, ...) bitcast (i64 (...)* @GetCol to i64 (i64, ...)*)(i64 %0)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6, i64 %7, i64 %8)
br label %10
10: ; preds = %5, %3
ret i32 undef
}