#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 long long uint64_t;
typedef scalar_t__ int8_t;
typedef long long int64_t;
typedef long long int32_t;

/* Variables and functions */
long long abs64(long long);
void yodel_format_hppos2degrees(int32_t whole, int8_t fraction,
                                int32_t *degreesp, uint64_t *billionthsp) {
  int64_t nanodegrees = 0;
  nanodegrees = whole;
  nanodegrees *= 100LL;
  nanodegrees += fraction;
  *degreesp = nanodegrees / 1000000000LL;
  nanodegrees = abs64(nanodegrees);
  nanodegrees = nanodegrees % 1000000000LL;
  *billionthsp = nanodegrees;
}


x86 assembly (clang, -O0):
<yodel_format_hppos2degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
imul   $0x64,-0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rdi
call   1030 <abs64@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yodel_format_hppos2degrees>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rcx
imul   $0x64,%rdi,%rdi
add    %rsi,%rdi
movabs $0x112e0be826d694b3,%rbx
0b 2e 11
mov    %rdi,%rax
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rax,%rdx
mov    %rdx,(%rcx)
call   1030 <abs64@plt>
mov    %rax,%rcx
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rax,%rdx
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @yodel_format_hppos2degrees(i64 %0, i64 %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
store i64 0, i64* %9
%10 = load i64, i64* %5
store i64 %10, i64* %9
%11 = load i64, i64* %9
%12 = mul nsw i64 %11, 100
store i64 %12, i64* %9
%13 = load i64, i64* %6
%14 = load i64, i64* %9
%15 = add nsw i64 %14, %13
store i64 %15, i64* %9
%16 = load i64, i64* %9
%17 = sdiv i64 %16, 1000000000
%18 = load i64*, i64** %7
store i64 %17, i64* %18
%19 = load i64, i64* %9
%20 = call i64 @abs64(i64 %19)
store i64 %20, i64* %9
%21 = load i64, i64* %9
%22 = srem i64 %21, 1000000000
store i64 %22, i64* %9
%23 = load i64, i64* %9
%24 = load i64*, i64** %8
store i64 %23, i64* %24
ret void
}

LLVM IR (-O2):
define void @yodel_format_hppos2degrees(i64 %0, i64 %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3) {
%5 = mul nsw i64 %0, 100
%6 = add nsw i64 %5, %1
%7 = sdiv i64 %6, 1000000000
store i64 %7, i64* %2
%8 = tail call i64 @abs64(i64 %6)
%9 = srem i64 %8, 1000000000
store i64 %9, i64* %3
ret void
}