#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*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int main(void) {
  const float FIELD_WIDTH = 20.0;
  const float FIELD_HEIGHT = 10.0;
  const float SQUARE_WIDTH = 2.0;
  const float SQUARE_HEIGHT = 1.0;
  const float SUB_WIDTH = 0.0833333333333333;
  const float SUB_HEIGHT = 0.0416666666666667;
  const float SUB_SUB_WIDTH = 0.0083333333333333;
  const float SUB_SUB_HEIGHT = 0.0041666666666667;
  char buff[9];
  sprintf(buff, "AA00AA00");
  float latitude = 42.9814;
  float longitude = -70.9483;
  float ilong, ilat = 0.0;
  latitude += 90.0;
  longitude += 180.0;
  ilong = (char)(longitude / FIELD_WIDTH);
  buff[0] += ilong;
  longitude -= (ilong * FIELD_WIDTH);
  ilat = (char)(latitude / FIELD_HEIGHT);
  buff[1] += ilat;
  latitude -= (ilat * FIELD_HEIGHT);
  ilong = (char)(longitude / SQUARE_WIDTH);
  buff[2] += ilong;
  longitude -= ilong * SQUARE_WIDTH;
  ilat = (char)(latitude / SQUARE_HEIGHT);
  buff[3] += ilat;
  latitude -= ilat * SQUARE_HEIGHT;
  ilong = (char)(longitude / SUB_WIDTH);
  buff[4] += ilong;
  longitude -= ilong * SUB_WIDTH;
  ilat = (char)(latitude / SUB_HEIGHT);
  buff[5] += ilat;
  latitude -= ilat * SUB_HEIGHT;
  ilong = (char)(longitude / SUB_SUB_WIDTH);
  buff[6] += ilong;
  ilat = (char)(latitude / SUB_SUB_HEIGHT);
  buff[7] += ilat;
  printf("buff = %s\n", buff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41a00000,-0x8(%rbp)
movl   $0x41200000,-0xc(%rbp)
movl   $0x40000000,-0x10(%rbp)
movl   $0x3f800000,-0x14(%rbp)
movl   $0x3daaaaab,-0x18(%rbp)
movl   $0x3d2aaaab,-0x1c(%rbp)
movl   $0x3c088889,-0x20(%rbp)
movl   $0x3b888889,-0x24(%rbp)
lea    0xebe(%rip),%rsi
lea    -0x2d(%rbp),%rdi
call   1040 <sprintf@plt>
movl   $0x422becf4,-0x34(%rbp)
movl   $0xc28de588,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xe3b(%rip),%xmm2
divss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm1
movsbl -0x2d(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x2d(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xdef(%rip),%xmm2
divss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm1
movsbl -0x2c(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x2c(%rbp)
movss  -0x40(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xda3(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm1
movsbl -0x2b(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x2b(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
addss  %xmm1,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
cvttss2si -0x34(%rbp),%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm1
movsbl -0x2a(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x2a(%rbp)
movss  -0x40(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xd1b(%rip),%xmm2
divss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm1
movsbl -0x29(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x29(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xccf(%rip),%xmm2
divss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm1
movsbl -0x28(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x28(%rbp)
movss  -0x40(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xc83(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm1
movsbl -0x27(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x27(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xc4e(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm1
movsbl -0x26(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x26(%rbp)
lea    -0x2d(%rbp),%rsi
lea    0xc24(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x10(%rsp)
movabs $0x3536584d32344e46,%rax
58 36 35
mov    %rax,0x8(%rsp)
lea    0xeda(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"AA00AA00\00"
@.str.1 = [11 x i8] c"buff = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca [9 x i8]
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store i32 0, i32* %1
store float 2.000000e+01, float* %2
store float 1.000000e+01, float* %3
store float 2.000000e+00, float* %4
store float 1.000000e+00, float* %5
store float 0x3FB5555560000000, float* %6
store float 0x3FA5555560000000, float* %7
store float 0x3F81111120000000, float* %8
store float 0x3F71111120000000, float* %9
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%16 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store float 0x40457D9E80000000, float* %11
store float 0xC051BCB100000000, float* %12
store float 0.000000e+00, float* %14
%17 = load float, float* %11
%18 = fpext float %17 to double
%19 = fadd double %18, 9.000000e+01
%20 = fptrunc double %19 to float
store float %20, float* %11
%21 = load float, float* %12
%22 = fpext float %21 to double
%23 = fadd double %22, 1.800000e+02
%24 = fptrunc double %23 to float
store float %24, float* %12
%25 = load float, float* %12
%26 = fdiv float %25, 2.000000e+01
%27 = fptosi float %26 to i8
%28 = sitofp i8 %27 to float
store float %28, float* %13
%29 = load float, float* %13
%30 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%31 = load i8, i8* %30
%32 = sitofp i8 %31 to float
%33 = fadd float %32, %29
%34 = fptosi float %33 to i8
store i8 %34, i8* %30
%35 = load float, float* %13
%36 = load float, float* %12
%37 = fneg float %35
%38 = call float @llvm.fmuladd.f32(float %37, float 2.000000e+01, float %36)
store float %38, float* %12
%39 = load float, float* %11
%40 = fdiv float %39, 1.000000e+01
%41 = fptosi float %40 to i8
%42 = sitofp i8 %41 to float
store float %42, float* %14
%43 = load float, float* %14
%44 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 1
%45 = load i8, i8* %44
%46 = sitofp i8 %45 to float
%47 = fadd float %46, %43
%48 = fptosi float %47 to i8
store i8 %48, i8* %44
%49 = load float, float* %14
%50 = load float, float* %11
%51 = fneg float %49
%52 = call float @llvm.fmuladd.f32(float %51, float 1.000000e+01, float %50)
store float %52, float* %11
%53 = load float, float* %12
%54 = fdiv float %53, 2.000000e+00
%55 = fptosi float %54 to i8
%56 = sitofp i8 %55 to float
store float %56, float* %13
%57 = load float, float* %13
%58 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 2
%59 = load i8, i8* %58
%60 = sitofp i8 %59 to float
%61 = fadd float %60, %57
%62 = fptosi float %61 to i8
store i8 %62, i8* %58
%63 = load float, float* %13
%64 = load float, float* %12
%65 = fneg float %63
%66 = call float @llvm.fmuladd.f32(float %65, float 2.000000e+00, float %64)
store float %66, float* %12
%67 = load float, float* %11
%68 = fdiv float %67, 1.000000e+00
%69 = fptosi float %68 to i8
%70 = sitofp i8 %69 to float
store float %70, float* %14
%71 = load float, float* %14
%72 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 3
%73 = load i8, i8* %72
%74 = sitofp i8 %73 to float
%75 = fadd float %74, %71
%76 = fptosi float %75 to i8
store i8 %76, i8* %72
%77 = load float, float* %14
%78 = load float, float* %11
%79 = fneg float %77
%80 = call float @llvm.fmuladd.f32(float %79, float 1.000000e+00, float %78)
store float %80, float* %11
%81 = load float, float* %12
%82 = fdiv float %81, 0x3FB5555560000000
%83 = fptosi float %82 to i8
%84 = sitofp i8 %83 to float
store float %84, float* %13
%85 = load float, float* %13
%86 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 4
%87 = load i8, i8* %86
%88 = sitofp i8 %87 to float
%89 = fadd float %88, %85
%90 = fptosi float %89 to i8
store i8 %90, i8* %86
%91 = load float, float* %13
%92 = load float, float* %12
%93 = fneg float %91
%94 = call float @llvm.fmuladd.f32(float %93, float 0x3FB5555560000000, float %92)
store float %94, float* %12
%95 = load float, float* %11
%96 = fdiv float %95, 0x3FA5555560000000
%97 = fptosi float %96 to i8
%98 = sitofp i8 %97 to float
store float %98, float* %14
%99 = load float, float* %14
%100 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 5
%101 = load i8, i8* %100
%102 = sitofp i8 %101 to float
%103 = fadd float %102, %99
%104 = fptosi float %103 to i8
store i8 %104, i8* %100
%105 = load float, float* %14
%106 = load float, float* %11
%107 = fneg float %105
%108 = call float @llvm.fmuladd.f32(float %107, float 0x3FA5555560000000, float %106)
store float %108, float* %11
%109 = load float, float* %12
%110 = fdiv float %109, 0x3F81111120000000
%111 = fptosi float %110 to i8
%112 = sitofp i8 %111 to float
store float %112, float* %13
%113 = load float, float* %13
%114 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 6
%115 = load i8, i8* %114
%116 = sitofp i8 %115 to float
%117 = fadd float %116, %113
%118 = fptosi float %117 to i8
store i8 %118, i8* %114
%119 = load float, float* %11
%120 = fdiv float %119, 0x3F71111120000000
%121 = fptosi float %120 to i8
%122 = sitofp i8 %121 to float
store float %122, float* %14
%123 = load float, float* %14
%124 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 7
%125 = load i8, i8* %124
%126 = sitofp i8 %125 to float
%127 = fadd float %126, %123
%128 = fptosi float %127 to i8
store i8 %128, i8* %124
%129 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%130 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %129)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"AA00AA00\00"
@.str.1 = [11 x i8] c"buff = %s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
store i8 70, i8* %2
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 1
store i8 78, i8* %3
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 2
store i8 52, i8* %4
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 3
store i8 50, i8* %5
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 4
store i8 77, i8* %6
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 5
store i8 88, i8* %7
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 6
store i8 54, i8* %8
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 7
store i8 53, i8* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}