#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*/ conv_pos(long *, long *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_conv_pos(void) {
  long latitude;
  long longitude;
  latitude = 38049766;
  longitude = 6247336;
  conv_pos(&latitude, &longitude);
  if ((latitude != 38049766) || (longitude != 6247336)) {
    fprintf(stderr, "test_conv_pos() 1: failed\n");
    return 0;
  }
  latitude = 25482612;
  longitude = 225623348;
  conv_pos(&latitude, &longitude);
  if ((latitude != 25482612) || (longitude != -42812108)) {
    fprintf(stderr, "test_conv_pos() 2: failed\n");
    return 0;
  }
  latitude = 109017158;
  longitude = 87956591;
  conv_pos(&latitude, &longitude);
  if ((latitude != -25200570) || (longitude != 87956591)) {
    fprintf(stderr, "test_conv_pos() 3: failed\n");
    return 0;
  }
  latitude = 123616751;
  longitude = 230768857;
  conv_pos(&latitude, &longitude);
  if ((latitude != -10600977) || (longitude != -37666599)) {
    fprintf(stderr, "test_conv_pos() 4: failed\n");
    return 0;
  }
  latitude = 0;
  longitude = 0;
  conv_pos(&latitude, &longitude);
  if ((latitude != 0) || (longitude != 0)) {
    fprintf(stderr, "test_conv_pos() 5: failed\n");
    return 0;
  }
  fprintf(stderr, "test_conv_pos() Passed\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_conv_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x24497e6,-0x10(%rbp)
02
movq   $0x5f53a8,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0x24497e6,-0x10(%rbp)
02
jne    1161 <test_conv_pos+0x41>
cmpq   $0x5f53a8,-0x18(%rbp)
je     1182 <test_conv_pos+0x62>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1300 <test_conv_pos+0x1e0>
movq   $0x184d574,-0x10(%rbp)
01
movq   $0xd72bd34,-0x18(%rbp)
0d
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0x184d574,-0x10(%rbp)
01
jne    11bb <test_conv_pos+0x9b>
cmpq   $0xfffffffffd72bd34,-0x18(%rbp)
fd
je     11dc <test_conv_pos+0xbc>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1300 <test_conv_pos+0x1e0>
movq   $0x67f7846,-0x10(%rbp)
06
movq   $0x53e1c6f,-0x18(%rbp)
05
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0xfffffffffe7f7846,-0x10(%rbp)
jne    1215 <test_conv_pos+0xf5>
cmpq   $0x53e1c6f,-0x18(%rbp)
05
je     1236 <test_conv_pos+0x116>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
lea    0xe11(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1300 <test_conv_pos+0x1e0>
movq   $0x75e3def,-0x10(%rbp)
07
movq   $0xdc140d9,-0x18(%rbp)
0d
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0xffffffffff5e3def,-0x10(%rbp)
ff
jne    126f <test_conv_pos+0x14f>
cmpq   $0xfffffffffdc140d9,-0x18(%rbp)
fd
je     1290 <test_conv_pos+0x170>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1300 <test_conv_pos+0x1e0>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0x0,-0x10(%rbp)
jne    12c3 <test_conv_pos+0x1a3>
cmpq   $0x0,-0x18(%rbp)
je     12e4 <test_conv_pos+0x1c4>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd99(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1300 <test_conv_pos+0x1e0>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
lea    0xd93(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_conv_pos>:
sub    $0x18,%rsp
movq   $0x24497e6,0x10(%rsp)
44 02
movq   $0x5f53a8,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0x24497e6,0x10(%rsp)
44 02
jne    125b <test_conv_pos+0x13b>
cmpq   $0x5f53a8,0x8(%rsp)
jne    125b <test_conv_pos+0x13b>
movq   $0x184d574,0x10(%rsp)
84 01
movq   $0xd72bd34,0x8(%rsp)
72 0d
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0x184d574,0x10(%rsp)
84 01
jne    126d <test_conv_pos+0x14d>
cmpq   $0xfffffffffd72bd34,0x8(%rsp)
72 fd
jne    126d <test_conv_pos+0x14d>
movq   $0x67f7846,0x10(%rsp)
7f 06
movq   $0x53e1c6f,0x8(%rsp)
3e 05
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0xfffffffffe7f7846,0x10(%rsp)
7f fe
jne    127f <test_conv_pos+0x15f>
cmpq   $0x53e1c6f,0x8(%rsp)
3e 05
jne    127f <test_conv_pos+0x15f>
movq   $0x75e3def,0x10(%rsp)
5e 07
movq   $0xdc140d9,0x8(%rsp)
c1 0d
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <conv_pos@plt>
cmpq   $0xffffffffff5e3def,0x10(%rsp)
5e ff
jne    1291 <test_conv_pos+0x171>
cmpq   $0xfffffffffdc140d9,0x8(%rsp)
c1 fd
jne    1291 <test_conv_pos+0x171>
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <conv_pos@plt>
mov    0x10(%rsp),%rax
mov    0x2d97(%rip),%rcx
mov    (%rcx),%edi
or     0x8(%rsp),%rax
je     12ad <test_conv_pos+0x18d>
lea    0xe13(%rip),%rsi
jmp    12a1 <test_conv_pos+0x181>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
jmp    12a1 <test_conv_pos+0x181>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
lea    0xd9e(%rip),%rsi
jmp    12a1 <test_conv_pos+0x181>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
lea    0xda7(%rip),%rsi
jmp    12a1 <test_conv_pos+0x181>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
lea    0xdd3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"test_conv_pos() 1: failed\0A\00"
@.str.1 = [27 x i8] c"test_conv_pos() 2: failed\0A\00"
@.str.2 = [27 x i8] c"test_conv_pos() 3: failed\0A\00"
@.str.3 = [27 x i8] c"test_conv_pos() 4: failed\0A\00"
@.str.4 = [27 x i8] c"test_conv_pos() 5: failed\0A\00"
@.str.5 = [24 x i8] c"test_conv_pos() Passed\0A\00"
define i32 @test_conv_pos() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i64 38049766, i64* %2
store i64 6247336, i64* %3
%4 = call i32 @conv_pos(i64* %2, i64* %3)
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 38049766
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = load i64, i64* %3
%9 = icmp ne i64 %8, 6247336
br i1 %9, label %10, label %13
10: ; preds = %7, %0
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %56
13: ; preds = %7
store i64 25482612, i64* %2
store i64 225623348, i64* %3
%14 = call i32 @conv_pos(i64* %2, i64* %3)
%15 = load i64, i64* %2
%16 = icmp ne i64 %15, 25482612
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i64, i64* %3
%19 = icmp ne i64 %18, -42812108
br i1 %19, label %20, label %23
20: ; preds = %17, %13
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %56
23: ; preds = %17
store i64 109017158, i64* %2
store i64 87956591, i64* %3
%24 = call i32 @conv_pos(i64* %2, i64* %3)
%25 = load i64, i64* %2
%26 = icmp ne i64 %25, -25200570
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i64, i64* %3
%29 = icmp ne i64 %28, 87956591
br i1 %29, label %30, label %33
30: ; preds = %27, %23
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %56
33: ; preds = %27
store i64 123616751, i64* %2
store i64 230768857, i64* %3
%34 = call i32 @conv_pos(i64* %2, i64* %3)
%35 = load i64, i64* %2
%36 = icmp ne i64 %35, -10600977
br i1 %36, label %40, label %37
37: ; preds = %33
%38 = load i64, i64* %3
%39 = icmp ne i64 %38, -37666599
br i1 %39, label %40, label %43
40: ; preds = %37, %33
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %56
43: ; preds = %37
store i64 0, i64* %2
store i64 0, i64* %3
%44 = call i32 @conv_pos(i64* %2, i64* %3)
%45 = load i64, i64* %2
%46 = icmp ne i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = load i64, i64* %3
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %47, %43
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %56
53: ; preds = %47
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %56
56: ; preds = %53, %50, %40, %30, %20, %10
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"test_conv_pos() 1: failed\0A\00"
@.str.1 = [27 x i8] c"test_conv_pos() 2: failed\0A\00"
@.str.2 = [27 x i8] c"test_conv_pos() 3: failed\0A\00"
@.str.3 = [27 x i8] c"test_conv_pos() 4: failed\0A\00"
@.str.4 = [27 x i8] c"test_conv_pos() 5: failed\0A\00"
@.str.5 = [24 x i8] c"test_conv_pos() Passed\0A\00"
define i32 @test_conv_pos() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 38049766, i64* %1
store i64 6247336, i64* %2
%5 = call i32 @conv_pos(i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = icmp ne i64 %6, 38049766
%8 = load i64, i64* %2
%9 = icmp ne i64 %8, 6247336
%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 ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %56
14: ; preds = %0
store i64 25482612, i64* %1
store i64 225623348, i64* %2
%15 = call i32 @conv_pos(i64* %1, i64* %2)
%16 = load i64, i64* %1
%17 = icmp ne i64 %16, 25482612
%18 = load i64, i64* %2
%19 = icmp ne i64 %18, -42812108
%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 ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %56
24: ; preds = %14
store i64 109017158, i64* %1
store i64 87956591, i64* %2
%25 = call i32 @conv_pos(i64* %1, i64* %2)
%26 = load i64, i64* %1
%27 = icmp ne i64 %26, -25200570
%28 = load i64, i64* %2
%29 = icmp ne i64 %28, 87956591
%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 ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %56
34: ; preds = %24
store i64 123616751, i64* %1
store i64 230768857, i64* %2
%35 = call i32 @conv_pos(i64* %1, i64* %2)
%36 = load i64, i64* %1
%37 = icmp ne i64 %36, -10600977
%38 = load i64, i64* %2
%39 = icmp ne i64 %38, -37666599
%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 ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %56
44: ; preds = %34
store i64 0, i64* %1
store i64 0, i64* %2
%45 = call i32 @conv_pos(i64* %1, i64* %2)
%46 = load i64, i64* %1
%47 = icmp ne i64 %46, 0
%48 = load i64, i64* %2
%49 = icmp ne i64 %48, 0
%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 ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %56
54: ; preds = %44
%55 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([24 x i8], [24 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
}