#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*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ sscanf(char *, char *, char *, float *, float *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ *strstr(char *, char *);
main() {
  char line[128], name[32];
  float lat, lon;
  FILE *in = stdin;
  (void)fgets(line, 128, in);
  while (!feof(in)) {
    if (strstr(line, "US  K") != NULL) {
      (void)sscanf(line + 23, "%s %*s %f %f", name, &lat, &lon);
      (void)fprintf(stdout, "%s\t%d\t%d\n", name, (int)(lat + 0.5),
                    (int)(lon + 0.5));
    }
    (void)fgets(line, 128, in);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0xc0(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0xc0(%rbp),%rdx
mov    $0x80,%esi
call   1030 <fgets@plt>
mov    -0xc0(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11ac <main+0x5c>
jmp    1267 <main+0x117>
lea    -0x90(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     124a <main+0xfa>
lea    -0x90(%rbp),%rdi
add    $0x17,%rdi
lea    -0xb0(%rbp),%rdx
lea    0xe2c(%rip),%rsi
lea    -0xb4(%rbp),%rcx
lea    -0xb8(%rbp),%r8
call   1060 <sscanf@plt>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    -0xb0(%rbp),%rdx
movss  -0xb4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xde7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movss  -0xb8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r8d
lea    0xdd6(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x90(%rbp),%rdi
mov    -0xc0(%rbp),%rdx
mov    $0x80,%esi
call   1030 <fgets@plt>
jmp    118b <main+0x3b>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    0x2e80(%rip),%rax
mov    (%rax),%rbx
lea    0x30(%rsp),%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     119d <main+0x4d>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe64(%rip),%r15
lea    0x30(%rsp),%r12
lea    0x10(%rsp),%rbp
mov    0x2e23(%rip),%r13
lea    0xe5f(%rip),%r14
jmp    11dc <main+0x8c>
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1189 <main+0x39>
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <strstr@plt>
test   %rax,%rax
je     11c0 <main+0x70>
lea    0x47(%rsp),%rdi
lea    0xe16(%rip),%rsi
mov    %rbp,%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1060 <sscanf@plt>
mov    0x0(%r13),%edi
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r8d
mov    %r14,%rsi
mov    %rbp,%rdx
call   1040 <fprintf@plt>
jmp    11c0 <main+0x70>

LLVM IR (-O0):
@stdin = global i32* null
@.str = [6 x i8] c"US K\00"
@.str.1 = [13 x i8] c"%s %*s %f %f\00"
@stdout = global i32 0
@.str.2 = [10 x i8] c"%s\09%d\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [32 x i8]
%4 = alloca float
%5 = alloca float
%6 = alloca i32*
store i32 0, i32* %1
%7 = load i32*, i32** @stdin
store i32* %7, i32** %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = load i32*, i32** %6
%10 = call i32 @fgets(i8* %8, i32 128, i32* %9)
br label %11
11: ; preds = %36, %0
%12 = load i32*, i32** %6
%13 = call i32 @feof(i32* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %40
16: ; preds = %11
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%18 = call i32* @strstr(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds i8, i8* %21, i64 23
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%24 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %23, float* %4, float* %5)
%25 = load i32, i32* @stdout
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = fadd double %28, 5.000000e-01
%30 = fptosi double %29 to i32
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = fadd double %32, 5.000000e-01
%34 = fptosi double %33 to i32
%35 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %26, i32 %30, i32 %34)
br label %36
36: ; preds = %20, %16
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%38 = load i32*, i32** %6
%39 = call i32 @fgets(i8* %37, i32 128, i32* %38)
br label %11
40: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [6 x i8] c"US K\00"
@.str.1 = [13 x i8] c"%s %*s %f %f\00"
@stdout = global i32 0
@.str.2 = [10 x i8] c"%s\09%d\09%d\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [32 x i8]
%3 = alloca float
%4 = alloca float
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = load i32*, i32** @stdin
%10 = call i32 @fgets(i8* %5, i32 128, i32* %9)
%11 = call i32 @feof(i32* %9)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 23
br label %15
15: ; preds = %13, %30
%16 = call i32* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6, float* %3, float* %4)
%20 = load i32, i32* @stdout
%21 = load float, float* %3
%22 = fpext float %21 to double
%23 = fadd double %22, 5.000000e-01
%24 = fptosi double %23 to i32
%25 = load float, float* %4
%26 = fpext float %25 to double
%27 = fadd double %26, 5.000000e-01
%28 = fptosi double %27 to i32
%29 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %24, i32 %28)
br label %30
30: ; preds = %18, %15
%31 = call i32 @fgets(i8* %5, i32 128, i32* %9)
%32 = call i32 @feof(i32* %9)
%33 = icmp eq i32 %32, 0
br i1 %33, label %15, label %34
34: ; preds = %30, %0
ret i32 0
}