#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*/ pos2ddd(long, long, double *, double *);
int /*<<< orphan*/ stderr;
int test_pos2ddd(void) {
  long latitude;
  long longitude;
  double lat_dd;
  double long_ddd;
  latitude = 38049766;
  longitude = 6247336;
  pos2ddd(latitude, longitude, &lat_dd, &long_ddd);
  if ((lat_dd != 63.416276666666668) || (long_ddd != 10.412226666666667)) {
    fprintf(stderr, "test_pos2ddd() 1: failed\n");
    return 0;
  }
  latitude = 25482612;
  longitude = -42812108;
  pos2ddd(latitude, longitude, &lat_dd, &long_ddd);
  if ((lat_dd != 42.471020000000003) || (long_ddd != -71.353513333333339)) {
    fprintf(stderr, "test_pos2ddd() 2: failed\n");
    return 0;
  }
  latitude = -25200570;
  longitude = 87956591;
  pos2ddd(latitude, longitude, &lat_dd, &long_ddd);
  if ((lat_dd != -42.000950000000003) || (long_ddd != 146.59431833333332)) {
    fprintf(stderr, "test_pos2ddd() 3: failed\n");
    return 0;
  }
  latitude = -10600977;
  longitude = -37666599;
  pos2ddd(latitude, longitude, &lat_dd, &long_ddd);
  if ((lat_dd != -17.668295000000001) || (long_ddd != -62.777664999999999)) {
    fprintf(stderr, "test_pos2ddd() 4: failed\n");
    return 0;
  }
  latitude = 0;
  longitude = 0;
  pos2ddd(latitude, longitude, &lat_dd, &long_ddd);
  if ((lat_dd != 0) || (long_ddd != 0)) {
    fprintf(stderr, "test_pos2ddd() 5: failed\n");
    return 0;
  }
  fprintf(stderr, "test_pos2ddd() Passed\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_pos2ddd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x24497e6,-0x10(%rbp)
02
movq   $0x5f53a8,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <pos2ddd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    118c <test_pos2ddd+0x6c>
jp     118c <test_pos2ddd+0x6c>
movsd  -0x28(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    118c <test_pos2ddd+0x6c>
jp     118c <test_pos2ddd+0x6c>
jmp    11ad <test_pos2ddd+0x8d>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <test_pos2ddd+0x2b3>
movq   $0x184d574,-0x10(%rbp)
01
movq   $0xfffffffffd72bd34,-0x18(%rbp)
fd
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <pos2ddd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xe31(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1211 <test_pos2ddd+0xf1>
jp     1211 <test_pos2ddd+0xf1>
movsd  -0x28(%rbp),%xmm0
movsd  0xe1c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1211 <test_pos2ddd+0xf1>
jp     1211 <test_pos2ddd+0xf1>
jmp    1232 <test_pos2ddd+0x112>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <test_pos2ddd+0x2b3>
movq   $0xfffffffffe7f7846,-0x10(%rbp)
fe
movq   $0x53e1c6f,-0x18(%rbp)
05
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <pos2ddd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xdbc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1296 <test_pos2ddd+0x176>
jp     1296 <test_pos2ddd+0x176>
movsd  -0x28(%rbp),%xmm0
movsd  0xda7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1296 <test_pos2ddd+0x176>
jp     1296 <test_pos2ddd+0x176>
jmp    12b7 <test_pos2ddd+0x197>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
lea    0xdce(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <test_pos2ddd+0x2b3>
movq   $0xffffffffff5e3def,-0x10(%rbp)
ff
movq   $0xfffffffffdc140d9,-0x18(%rbp)
fd
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <pos2ddd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xd47(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    131b <test_pos2ddd+0x1fb>
jp     131b <test_pos2ddd+0x1fb>
movsd  -0x28(%rbp),%xmm0
movsd  0xd32(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    131b <test_pos2ddd+0x1fb>
jp     131b <test_pos2ddd+0x1fb>
jmp    133c <test_pos2ddd+0x21c>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
lea    0xd63(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <test_pos2ddd+0x2b3>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <pos2ddd@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1396 <test_pos2ddd+0x276>
jp     1396 <test_pos2ddd+0x276>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1396 <test_pos2ddd+0x276>
jp     1396 <test_pos2ddd+0x276>
jmp    13b7 <test_pos2ddd+0x297>
mov    0x2c43(%rip),%rax
mov    (%rax),%edi
lea    0xd02(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13d3 <test_pos2ddd+0x2b3>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
lea    0xcfb(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pos2ddd>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x24497e6,%edi
mov    $0x5f53a8,%esi
call   1030 <pos2ddd@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xeb6(%rip),%xmm0
jne    12a3 <test_pos2ddd+0x183>
jp     12a3 <test_pos2ddd+0x183>
movsd  (%rsp),%xmm0
ucomisd 0xea5(%rip),%xmm0
jne    12a3 <test_pos2ddd+0x183>
jp     12a3 <test_pos2ddd+0x183>
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x184d574,%edi
mov    $0xfffffffffd72bd34,%rsi
call   1030 <pos2ddd@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe7a(%rip),%xmm0
jne    12b5 <test_pos2ddd+0x195>
jp     12b5 <test_pos2ddd+0x195>
movsd  (%rsp),%xmm0
ucomisd 0xe69(%rip),%xmm0
jne    12b5 <test_pos2ddd+0x195>
jp     12b5 <test_pos2ddd+0x195>
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x53e1c6f,%esi
mov    $0xfffffffffe7f7846,%rdi
call   1030 <pos2ddd@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe3e(%rip),%xmm0
jne    12c7 <test_pos2ddd+0x1a7>
jp     12c7 <test_pos2ddd+0x1a7>
movsd  (%rsp),%xmm0
ucomisd 0xe2d(%rip),%xmm0
jne    12c7 <test_pos2ddd+0x1a7>
jp     12c7 <test_pos2ddd+0x1a7>
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    $0xffffffffff5e3def,%rdi
mov    $0xfffffffffdc140d9,%rsi
call   1030 <pos2ddd@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe00(%rip),%xmm0
jne    12d9 <test_pos2ddd+0x1b9>
jp     12d9 <test_pos2ddd+0x1b9>
movsd  (%rsp),%xmm0
ucomisd 0xdef(%rip),%xmm0
jne    12d9 <test_pos2ddd+0x1b9>
jp     12d9 <test_pos2ddd+0x1b9>
xor    %ebx,%ebx
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <pos2ddd@plt>
movsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
jne    12f8 <test_pos2ddd+0x1d8>
jp     12f8 <test_pos2ddd+0x1d8>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    12f8 <test_pos2ddd+0x1d8>
jp     12f8 <test_pos2ddd+0x1d8>
lea    0xe2b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%ebx
jmp    12f0 <test_pos2ddd+0x1d0>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
jmp    12e9 <test_pos2ddd+0x1c9>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
jmp    12e9 <test_pos2ddd+0x1c9>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
lea    0xd9d(%rip),%rsi
jmp    12e9 <test_pos2ddd+0x1c9>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
lea    0xda5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xda9(%rip),%rsi
call   1040 <fprintf@plt>
jmp    12f0 <test_pos2ddd+0x1d0>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"test_pos2ddd() 1: failed\0A\00"
@.str.1 = [26 x i8] c"test_pos2ddd() 2: failed\0A\00"
@.str.2 = [26 x i8] c"test_pos2ddd() 3: failed\0A\00"
@.str.3 = [26 x i8] c"test_pos2ddd() 4: failed\0A\00"
@.str.4 = [26 x i8] c"test_pos2ddd() 5: failed\0A\00"
@.str.5 = [23 x i8] c"test_pos2ddd() Passed\0A\00"
define i32 @test_pos2ddd() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = alloca double
store i64 38049766, i64* %2
store i64 6247336, i64* %3
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = call i32 @pos2ddd(i64 %6, i64 %7, double* %4, double* %5)
%9 = load double, double* %4
%10 = fcmp une double %9, 0x404FB5488DC6B5EB
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load double, double* %5
%13 = fcmp une double %12, 0x4024D30F5FA7BEAF
br i1 %13, label %14, label %17
14: ; preds = %11, %0
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %68
17: ; preds = %11
store i64 25482612, i64* %2
store i64 -42812108, i64* %3
%18 = load i64, i64* %2
%19 = load i64, i64* %3
%20 = call i32 @pos2ddd(i64 %18, i64 %19, double* %4, double* %5)
%21 = load double, double* %4
%22 = fcmp une double %21, 0x40453C4A6223E187
br i1 %22, label %26, label %23
23: ; preds = %17
%24 = load double, double* %5
%25 = fcmp une double %24, 0xC051D69FF6635777
br i1 %25, label %26, label %29
26: ; preds = %23, %17
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %68
29: ; preds = %23
store i64 -25200570, i64* %2
store i64 87956591, i64* %3
%30 = load i64, i64* %2
%31 = load i64, i64* %3
%32 = call i32 @pos2ddd(i64 %30, i64 %31, double* %4, double* %5)
%33 = load double, double* %4
%34 = fcmp une double %33, 0xC045001F212D7732
br i1 %34, label %38, label %35
35: ; preds = %29
%36 = load double, double* %5
%37 = fcmp une double %36, 0x40625304A7E1A28E
br i1 %37, label %38, label %41
38: ; preds = %35, %29
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %68
41: ; preds = %35
store i64 -10600977, i64* %2
store i64 -37666599, i64* %3
%42 = load i64, i64* %2
%43 = load i64, i64* %3
%44 = call i32 @pos2ddd(i64 %42, i64 %43, double* %4, double* %5)
%45 = load double, double* %4
%46 = fcmp une double %45, 0xC031AB1561911490
br i1 %46, label %50, label %47
47: ; preds = %41
%48 = load double, double* %5
%49 = fcmp une double %48, 0xC04F638A86D71F36
br i1 %49, label %50, label %53
50: ; preds = %47, %41
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %68
53: ; preds = %47
store i64 0, i64* %2
store i64 0, i64* %3
%54 = load i64, i64* %2
%55 = load i64, i64* %3
%56 = call i32 @pos2ddd(i64 %54, i64 %55, double* %4, double* %5)
%57 = load double, double* %4
%58 = fcmp une double %57, 0.000000e+00
br i1 %58, label %62, label %59
59: ; preds = %53
%60 = load double, double* %5
%61 = fcmp une double %60, 0.000000e+00
br i1 %61, label %62, label %65
62: ; preds = %59, %53
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %68
65: ; preds = %59
%66 = load i32, i32* @stderr
%67 = call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %68
68: ; preds = %65, %62, %50, %38, %26, %14
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"test_pos2ddd() 1: failed\0A\00"
@.str.1 = [26 x i8] c"test_pos2ddd() 2: failed\0A\00"
@.str.2 = [26 x i8] c"test_pos2ddd() 3: failed\0A\00"
@.str.3 = [26 x i8] c"test_pos2ddd() 4: failed\0A\00"
@.str.4 = [26 x i8] c"test_pos2ddd() 5: failed\0A\00"
@.str.5 = [23 x i8] c"test_pos2ddd() Passed\0A\00"
define i32 @test_pos2ddd() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @pos2ddd(i64 38049766, i64 6247336, double* %1, double* %2)
%6 = load double, double* %1
%7 = fcmp une double %6, 0x404FB5488DC6B5EB
%8 = load double, double* %2
%9 = fcmp une double %8, 0x4024D30F5FA7BEAF
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %56
14: ; preds = %0
%15 = call i32 @pos2ddd(i64 25482612, i64 -42812108, double* %1, double* %2)
%16 = load double, double* %1
%17 = fcmp une double %16, 0x40453C4A6223E187
%18 = load double, double* %2
%19 = fcmp une double %18, 0xC051D69FF6635777
%20 = select i1 %17, i1 true, i1 %19
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %56
24: ; preds = %14
%25 = call i32 @pos2ddd(i64 -25200570, i64 87956591, double* %1, double* %2)
%26 = load double, double* %1
%27 = fcmp une double %26, 0xC045001F212D7732
%28 = load double, double* %2
%29 = fcmp une double %28, 0x40625304A7E1A28E
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %56
34: ; preds = %24
%35 = call i32 @pos2ddd(i64 -10600977, i64 -37666599, double* %1, double* %2)
%36 = load double, double* %1
%37 = fcmp une double %36, 0xC031AB1561911490
%38 = load double, double* %2
%39 = fcmp une double %38, 0xC04F638A86D71F36
%40 = select i1 %37, i1 true, i1 %39
br i1 %40, label %41, label %44
41: ; preds = %34
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %56
44: ; preds = %34
%45 = call i32 @pos2ddd(i64 0, i64 0, double* %1, double* %2)
%46 = load double, double* %1
%47 = fcmp une double %46, 0.000000e+00
%48 = load double, double* %2
%49 = fcmp une double %48, 0.000000e+00
%50 = select i1 %47, i1 true, i1 %49
%51 = load i32, i32* @stderr
br i1 %50, label %52, label %54
52: ; preds = %44
%53 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %56
54: ; preds = %44
%55 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %56
56: ; preds = %54, %52, %41, %31, %21, %11
%57 = phi i32 [ 0, %11 ], [ 0, %21 ], [ 0, %31 ], [ 0, %41 ], [ 0, %52 ], [ 1, %54 ]
ret i32 %57
}