#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 determine_pll_div(unsigned long *rates) {
  unsigned long long tmp;
  int PLL_mult = 64;
  while (PLL_mult > 1) {
    tmp = (unsigned long long)rates[1] * PLL_mult;
    if (((tmp) <= (1430143000UL) ? (tmp) >= (714928500UL) : false)) {
      rates[0] = (unsigned long)rates[1] * PLL_mult;
      return PLL_mult;
    }
    PLL_mult >>= 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<determine_pll_div>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x40,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jle    118d <determine_pll_div+0x8d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x1c(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x553e4018,-0x18(%rbp)
55
ja     114e <determine_pll_div+0x4e>
cmpq   $0x2a9cf174,-0x18(%rbp)
2a
jae    115d <determine_pll_div+0x5d>
jmp    117f <determine_pll_div+0x7f>
xor    %eax,%eax
test   $0x1,%al
jne    115d <determine_pll_div+0x5d>
jmp    117f <determine_pll_div+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
movslq -0x1c(%rbp),%rax
imul   %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <determine_pll_div+0x94>
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    110f <determine_pll_div+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<determine_pll_div>:
mov    0x8(%rdi),%rcx
mov    %rcx,%rdx
shl    $0x6,%rdx
lea    -0x2a9cf174(%rdx),%rsi
mov    $0x40,%eax
cmp    $0x2aa14ea4,%rsi
jbe    11b6 <determine_pll_div+0xb6>
mov    %rcx,%rdx
shl    $0x5,%rdx
lea    -0x2a9cf174(%rdx),%rsi
mov    $0x20,%eax
cmp    $0x2aa14ea5,%rsi
jb     11b6 <determine_pll_div+0xb6>
mov    %rcx,%rdx
shl    $0x4,%rdx
lea    -0x2a9cf174(%rdx),%rsi
mov    $0x10,%eax
cmp    $0x2aa14ea5,%rsi
jb     11b6 <determine_pll_div+0xb6>
lea    -0x2a9cf174(,%rcx,8),%rax
d5
cmp    $0x2aa14ea5,%rax
jae    1177 <determine_pll_div+0x77>
shl    $0x3,%rcx
mov    $0x8,%eax
jmp    11b3 <determine_pll_div+0xb3>
lea    -0x2a9cf174(,%rcx,4),%rax
d5
cmp    $0x2aa14ea5,%rax
jae    1192 <determine_pll_div+0x92>
shl    $0x2,%rcx
mov    $0x4,%eax
jmp    11b3 <determine_pll_div+0xb3>
lea    (%rcx,%rcx,1),%rdx
add    $0xffffffffd5630e8c,%rdx
mov    $0xffffffff,%eax
cmp    $0x2aa14ea5,%rdx
jae    11b9 <determine_pll_div+0xb9>
add    %rcx,%rcx
mov    $0x2,%eax
mov    %rcx,%rdx
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
define i32 @determine_pll_div(i64* %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %3
store i32 64, i32* %5
br label %6
6: ; preds = %32, %1
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = mul i64 %12, %14
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = icmp ule i64 %16, 1430143000
br i1 %17, label %18, label %21
18: ; preds = %9
%19 = load i64, i64* %4
%20 = icmp uge i64 %19, 714928500
br i1 %20, label %22, label %32
21: ; preds = %9
br i1 false, label %22, label %32
22: ; preds = %21, %18
%23 = load i64*, i64** %3
%24 = getelementptr inbounds i64, i64* %23, i64 1
%25 = load i64, i64* %24
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = mul i64 %25, %27
%29 = load i64*, i64** %3
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
%31 = load i32, i32* %5
store i32 %31, i32* %2
br label %36
32: ; preds = %21, %18
%33 = load i32, i32* %5
%34 = ashr i32 %33, 1
store i32 %34, i32* %5
br label %6
35: ; preds = %6
store i32 -1, i32* %2
br label %36
36: ; preds = %35, %22
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @determine_pll_div(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = shl i64 %3, 6
%5 = add i64 %4, -714928500
%6 = icmp ult i64 %5, 715214501
br i1 %6, label %7, label %10
7: ; preds = %26, %22, %18, %14, %10, %1
%8 = phi i32 [ 64, %1 ], [ 32, %10 ], [ 16, %14 ], [ 8, %18 ], [ 4, %22 ], [ 2, %26 ]
%9 = phi i64 [ %4, %1 ], [ %11, %10 ], [ %15, %14 ], [ %19, %18 ], [ %23, %22 ], [ %27, %26 ]
store i64 %9, i64* %0
br label %30
10: ; preds = %1
%11 = shl i64 %3, 5
%12 = add i64 %11, -714928500
%13 = icmp ult i64 %12, 715214501
br i1 %13, label %7, label %14
14: ; preds = %10
%15 = shl i64 %3, 4
%16 = add i64 %15, -714928500
%17 = icmp ult i64 %16, 715214501
br i1 %17, label %7, label %18
18: ; preds = %14
%19 = shl i64 %3, 3
%20 = add i64 %19, -714928500
%21 = icmp ult i64 %20, 715214501
br i1 %21, label %7, label %22
22: ; preds = %18
%23 = shl i64 %3, 2
%24 = add i64 %23, -714928500
%25 = icmp ult i64 %24, 715214501
br i1 %25, label %7, label %26
26: ; preds = %22
%27 = shl i64 %3, 1
%28 = add i64 %27, -714928500
%29 = icmp ult i64 %28, 715214501
br i1 %29, label %7, label %30
30: ; preds = %26, %7
%31 = phi i32 [ %8, %7 ], [ -1, %26 ]
ret i32 %31
}