#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int get_word(int /*<<< orphan*/ *);
int /*<<< orphan*/ pdp11_out(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ symtab_fn(int /*<<< orphan*/ *, int /*<<< orphan*/);
void absolute_out(FILE *in, FILE *out, int first, int address, int count) {
  int i, c;
  pdp11_out(out, first);
  pdp11_out(out, count);
  pdp11_out(out, address);
  if (count == 6)
    symtab_fn(in, stderr);
  for (i = 6; i < count; i++) {
    c = get_word(in);
    fputc(c & 0377, out);
  }
  c = get_word(in);
  fputc(c & 0377, out);
}


x86 assembly (clang, -O0):
<absolute_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <pdp11_out@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <pdp11_out@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1050 <pdp11_out@plt>
cmpl   $0x6,-0x1c(%rbp)
jne    119a <absolute_out+0x5a>
mov    -0x8(%rbp),%rdi
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
call   1030 <symtab_fn@plt>
movl   $0x6,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d9 <absolute_out+0x99>
mov    -0x8(%rbp),%rdi
call   1060 <get_word@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a1 <absolute_out+0x61>
mov    -0x8(%rbp),%rdi
call   1060 <get_word@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute_out>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %ecx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1050 <pdp11_out@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <pdp11_out@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1050 <pdp11_out@plt>
cmp    $0x6,%ebp
jne    118a <absolute_out+0x4a>
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <symtab_fn@plt>
jmp    11a8 <absolute_out+0x68>
jle    11a8 <absolute_out+0x68>
add    $0xfffffffa,%ebp
nop
mov    %r14,%rdi
call   1060 <get_word@plt>
movzbl %al,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0xffffffff,%ebp
jne    1190 <absolute_out+0x50>
mov    %r14,%rdi
call   1060 <get_word@plt>
movzbl %al,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @absolute_out(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @pdp11_out(i32* %13, i32 %14)
%16 = load i32*, i32** %7
%17 = load i32, i32* %10
%18 = call i32 @pdp11_out(i32* %16, i32 %17)
%19 = load i32*, i32** %7
%20 = load i32, i32* %9
%21 = call i32 @pdp11_out(i32* %19, i32 %20)
%22 = load i32, i32* %10
%23 = icmp eq i32 %22, 6
br i1 %23, label %24, label %28
24: ; preds = %5
%25 = load i32*, i32** %6
%26 = load i32, i32* @stderr
%27 = call i32 @symtab_fn(i32* %25, i32 %26)
br label %28
28: ; preds = %24, %5
store i32 6, i32* %11
br label %29
29: ; preds = %40, %28
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %43
33: ; preds = %29
%34 = load i32*, i32** %6
%35 = call i32 @get_word(i32* %34)
store i32 %35, i32* %12
%36 = load i32, i32* %12
%37 = and i32 %36, 255
%38 = load i32*, i32** %7
%39 = call i32 @fputc(i32 %37, i32* %38)
br label %40
40: ; preds = %33
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
br label %29
43: ; preds = %29
%44 = load i32*, i32** %6
%45 = call i32 @get_word(i32* %44)
store i32 %45, i32* %12
%46 = load i32, i32* %12
%47 = and i32 %46, 255
%48 = load i32*, i32** %7
%49 = call i32 @fputc(i32 %47, i32* %48)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @absolute_out(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @pdp11_out(i32* %1, i32 %2)
%7 = tail call i32 @pdp11_out(i32* %1, i32 %4)
%8 = tail call i32 @pdp11_out(i32* %1, i32 %3)
%9 = icmp eq i32 %4, 6
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* @stderr
%12 = tail call i32 @symtab_fn(i32* %0, i32 %11)
br label %22
13: ; preds = %5
%14 = icmp sgt i32 %4, 6
br i1 %14, label %15, label %22
15: ; preds = %13, %15
%16 = phi i32 [ %20, %15 ], [ 6, %13 ]
%17 = tail call i32 @get_word(i32* %0)
%18 = and i32 %17, 255
%19 = tail call i32 @fputc(i32 %18, i32* %1)
%20 = add nuw nsw i32 %16, 1
%21 = icmp eq i32 %20, %4
br i1 %21, label %22, label %15
22: ; preds = %15, %10, %13
%23 = tail call i32 @get_word(i32* %0)
%24 = and i32 %23, 255
%25 = tail call i32 @fputc(i32 %24, i32* %1)
ret void
}