#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
void GDS_prt_thin_lon(unsigned char *gds) {
  int iy, i, col, pl;
  iy = ((int)((gds[8] << 8) + gds[9]));
  iy = (iy + 1) / 2;
  iy = ((int)((gds[8] << 8) + gds[9]));
  if ((pl = ((gds[4] == 255) ? -1 : (int)gds[3] * 4 + (int)gds[4] - 1)) == -1) {
    fprintf(stderr, "\nprogram error: GDS_prt_thin\n");
    return;
  }
  for (col = i = 0; i < iy; i++) {
    if (col == 0)
      printf("   ");
    printf("%5d", (gds[pl + i * 2] << 8) + gds[pl + i * 2 + 1]);
    col++;
    if (col == 15) {
      col = 0;
      printf("\n");
    }
  }
  if (col != 0)
    printf("\n");
}


x86 assembly (clang, -O0):
<GDS_prt_thin_lon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x9(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x9(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0xff,%eax
jne    118d <GDS_prt_thin_lon+0x6d>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a8 <GDS_prt_thin_lon+0x88>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    11d1 <GDS_prt_thin_lon+0xb1>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1298 <GDS_prt_thin_lon+0x178>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1280 <GDS_prt_thin_lon+0x160>
cmpl   $0x0,-0x14(%rbp)
jne    1203 <GDS_prt_thin_lon+0xe3>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
shl    $0x8,%esi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%edx
shl    $0x1,%edx
add    %edx,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
add    %eax,%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jne    126d <GDS_prt_thin_lon+0x14d>
movl   $0x0,-0x14(%rbp)
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1272 <GDS_prt_thin_lon+0x152>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11df <GDS_prt_thin_lon+0xbf>
cmpl   $0x0,-0x14(%rbp)
je     1298 <GDS_prt_thin_lon+0x178>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GDS_prt_thin_lon>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movzbl 0x4(%rdi),%eax
cmp    $0xff,%eax
je     11ef <GDS_prt_thin_lon+0xbf>
mov    %rdi,%r12
movzbl 0x3(%rdi),%ecx
shl    $0x2,%ecx
mov    %rcx,%r13
add    %rax,%r13
je     11ef <GDS_prt_thin_lon+0xbf>
movzwl 0x8(%r12),%ebx
shl    $0x30,%rbx
bswap  %rbx
test   %ebx,%ebx
je     122f <GDS_prt_thin_lon+0xff>
lea    (%rcx,%rax,1),%ebp
add    $0xffffffff,%ebp
add    %r12,%r13
add    %rbx,%rbx
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    11c7 <GDS_prt_thin_lon+0x97>
nopl   0x0(%rax)
lea    (%r14,%rbp,1),%eax
cltq
movzbl (%r12,%rax,1),%eax
shl    $0x8,%eax
movzbl 0x0(%r13,%r14,1),%esi
or     %eax,%esi
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
cmp    $0xf,%r15d
je     11e0 <GDS_prt_thin_lon+0xb0>
add    $0x2,%r14
cmp    %r14,%rbx
je     1212 <GDS_prt_thin_lon+0xe2>
test   %r15d,%r15d
jne    1190 <GDS_prt_thin_lon+0x60>
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1190 <GDS_prt_thin_lon+0x60>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %r15d,%r15d
jmp    11be <GDS_prt_thin_lon+0x8e>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe01(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>
test   %r15d,%r15d
je     122f <GDS_prt_thin_lon+0xff>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"\0Aprogram error: GDS_prt_thin\0A\00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [4 x i8] c"%5d\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @GDS_prt_thin_lon(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 8
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 9
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nsw i32 %11, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
%19 = sdiv i32 %18, 2
store i32 %19, i32* %3
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 8
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 8
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 9
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = add nsw i32 %24, %28
store i32 %29, i32* %3
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 4
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = icmp eq i32 %33, 255
br i1 %34, label %35, label %36
35: ; preds = %1
br label %48
36: ; preds = %1
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = mul nsw i32 %40, 4
%42 = load i8*, i8** %2
%43 = getelementptr inbounds i8, i8* %42, i64 4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = add nsw i32 %41, %45
%47 = sub nsw i32 %46, 1
br label %48
48: ; preds = %36, %35
%49 = phi i32 [ -1, %35 ], [ %47, %36 ]
store i32 %49, i32* %6
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* @stderr
%53 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %102
54: ; preds = %48
store i32 0, i32* %4
store i32 0, i32* %5
br label %55
55: ; preds = %94, %54
%56 = load i32, i32* %4
%57 = load i32, i32* %3
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %97
59: ; preds = %55
%60 = load i32, i32* %5
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %64
64: ; preds = %62, %59
%65 = load i8*, i8** %2
%66 = load i32, i32* %6
%67 = load i32, i32* %4
%68 = mul nsw i32 %67, 2
%69 = add nsw i32 %66, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %65, i64 %70
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = shl i32 %73, 8
%75 = load i8*, i8** %2
%76 = load i32, i32* %6
%77 = load i32, i32* %4
%78 = mul nsw i32 %77, 2
%79 = add nsw i32 %76, %78
%80 = add nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %75, i64 %81
%83 = load i8, i8* %82
%84 = zext i8 %83 to i32
%85 = add nsw i32 %74, %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %5
%88 = add nsw i32 %87, 1
store i32 %88, i32* %5
%89 = load i32, i32* %5
%90 = icmp eq i32 %89, 15
br i1 %90, label %91, label %93
91: ; preds = %64
store i32 0, i32* %5
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %93
93: ; preds = %91, %64
br label %94
94: ; preds = %93
%95 = load i32, i32* %4
%96 = add nsw i32 %95, 1
store i32 %96, i32* %4
br label %55
97: ; preds = %55
%98 = load i32, i32* %5
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %102
100: ; preds = %97
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %102
102: ; preds = %51, %100, %97
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"\0Aprogram error: GDS_prt_thin\0A\00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [4 x i8] c"%5d\00"
define void @GDS_prt_thin_lon(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 9
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, -1
br i1 %12, label %26, label %13
13: ; preds = %1
%14 = zext i8 %11 to i32
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw nsw i32 %17, 2
%19 = add nuw nsw i32 %18, %14
%20 = icmp eq i32 %19, 0
br i1 %20, label %26, label %21
21: ; preds = %13
%22 = icmp eq i32 %9, 0
br i1 %22, label %64, label %23
23: ; preds = %21
%24 = zext i32 %19 to i64
%25 = zext i32 %9 to i64
br label %29
26: ; preds = %1, %13
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %64
29: ; preds = %23, %56
%30 = phi i64 [ 0, %23 ], [ %58, %56 ]
%31 = phi i32 [ 0, %23 ], [ %57, %56 ]
%32 = trunc i64 %30 to i32
%33 = icmp eq i32 %31, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %34, %29
%37 = shl nuw nsw i64 %30, 1
%38 = shl nuw nsw i32 %32, 1
%39 = add nuw nsw i32 %38, %19
%40 = add i32 %39, -1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %0, i64 %41
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = shl nuw nsw i32 %44, 8
%46 = add nuw nsw i64 %37, %24
%47 = getelementptr inbounds i8, i8* %0, i64 %46
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = or i32 %45, %49
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = add nsw i32 %31, 1
%53 = icmp eq i32 %52, 15
br i1 %53, label %54, label %56
54: ; preds = %36
%55 = tail call i32 @putchar(i32 10)
br label %56
56: ; preds = %36, %54
%57 = phi i32 [ 0, %54 ], [ %52, %36 ]
%58 = add nuw nsw i64 %30, 1
%59 = icmp eq i64 %58, %25
br i1 %59, label %60, label %29
60: ; preds = %56
%61 = icmp eq i32 %57, 0
br i1 %61, label %64, label %62
62: ; preds = %60
%63 = tail call i32 @putchar(i32 10)
br label %64
64: ; preds = %21, %60, %62, %26
ret void
}