#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 */
unsigned long long kD2ag4(unsigned long, int);
unsigned long long __attribute__((cdecl))
TAU32_ProbeGeneratorFrequency(unsigned long long jYvNM3) {
  unsigned long TrF875, V4Eg_2, yG5VL = 0,
                                Curt94 = (unsigned long)(jYvNM3 >> 32);
  {
    if (!(((int)Curt94) <= 0))
      goto PY2k02;
    Curt94 = 2048000;
    goto iJL0J;
  PY2k02:;
    {
      if (!(Curt94 < 2048000 - 0x1388))
        goto fcI1o1;
      Curt94 = 2048000 - 0x1388;
      goto dEEsv;
    fcI1o1:;
      {
        if (!(Curt94 >= 2048000 + 011610))
          goto pfvK;
        Curt94 = 2048000 + 011610;
        goto z7JL65;
      pfvK:;
        yG5VL = (unsigned long)jYvNM3;
      z7JL65:;
      }
    dEEsv:;
    }
  iJL0J:;
  }
  jYvNM3 = (((unsigned long long)Curt94) << 32) + yG5VL;
  jYvNM3 += 65536 * 0175 / 2;
  jYvNM3 >>= 16;
  __asm__("divl %3"
          : "=a,a"(TrF875), "=d,d"(V4Eg_2)
          : "A,A"(jYvNM3), "r,m"(0175)
          : "cc");
  return kD2ag4(TrF875, 0175 * 65536);
}


x86 assembly (clang, -O0):
<TAU32_ProbeGeneratorFrequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    $0x0,%eax
jle    1142 <TAU32_ProbeGeneratorFrequency+0x32>
jmp    114f <TAU32_ProbeGeneratorFrequency+0x3f>
movq   $0x1f4000,-0x28(%rbp)
jmp    11a1 <TAU32_ProbeGeneratorFrequency+0x91>
cmpq   $0x1f2c78,-0x28(%rbp)
jb     1162 <TAU32_ProbeGeneratorFrequency+0x52>
jmp    116f <TAU32_ProbeGeneratorFrequency+0x5f>
movq   $0x1f2c78,-0x28(%rbp)
jmp    119c <TAU32_ProbeGeneratorFrequency+0x8c>
cmpq   $0x1f5388,-0x28(%rbp)
jae    1182 <TAU32_ProbeGeneratorFrequency+0x72>
jmp    118f <TAU32_ProbeGeneratorFrequency+0x7f>
movq   $0x1f5388,-0x28(%rbp)
jmp    1197 <TAU32_ProbeGeneratorFrequency+0x87>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    119c <TAU32_ProbeGeneratorFrequency+0x8c>
jmp    11a1 <TAU32_ProbeGeneratorFrequency+0x91>
mov    -0x28(%rbp),%rax
shl    $0x20,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3e8000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x7d,%ecx
div    %ecx
mov    %rax,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7d0000,%esi
call   1030 <kD2ag4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TAU32_ProbeGeneratorFrequency>:
mov    %rdi,%rcx
shr    $0x20,%rcx
mov    $0x3e8000,%eax
test   %ecx,%ecx
jle    113b <TAU32_ProbeGeneratorFrequency+0x2b>
mov    %rdi,%rdx
shr    $0x23,%rdx
cmp    $0x3e58f,%edx
jae    1147 <TAU32_ProbeGeneratorFrequency+0x37>
movabs $0x1f2c7800000000,%rcx
jmp    1183 <TAU32_ProbeGeneratorFrequency+0x73>
movabs $0x1f400000000000,%rcx
jmp    1183 <TAU32_ProbeGeneratorFrequency+0x73>
movabs $0xffffffff00000000,%rax
ff ff ff
and    %rdi,%rax
movabs $0x1f5387ffffffff,%rcx
add    $0x1,%rcx
cmp    $0x3ea71,%rdx
cmovb  %rax,%rcx
add    $0x3e8000,%rdi
cmp    $0x3ea71,%edx
mov    $0x3e8000,%eax
cmovb  %rdi,%rax
add    %rcx,%rax
shr    $0x10,%rax
mov    $0x7d,%ecx
div    %ecx
mov    %rax,%rdi
mov    $0x7d0000,%esi
jmp    1030 <kD2ag4@plt>

LLVM IR (-O0):
define i64 @TAU32_ProbeGeneratorFrequency(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %5
%7 = load i64, i64* %2
%8 = lshr i64 %7, 32
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = trunc i64 %9 to i32
%11 = icmp sle i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %1
br label %14
13: ; preds = %1
store i64 2048000, i64* %6
br label %28
14: ; preds = %12
%15 = load i64, i64* %6
%16 = icmp ult i64 %15, 2043000
br i1 %16, label %18, label %17
17: ; preds = %14
br label %19
18: ; preds = %14
store i64 2043000, i64* %6
br label %27
19: ; preds = %17
%20 = load i64, i64* %6
%21 = icmp uge i64 %20, 2053000
br i1 %21, label %23, label %22
22: ; preds = %19
br label %24
23: ; preds = %19
store i64 2053000, i64* %6
br label %26
24: ; preds = %22
%25 = load i64, i64* %2
store i64 %25, i64* %5
br label %26
26: ; preds = %24, %23
br label %27
27: ; preds = %26, %18
br label %28
28: ; preds = %27, %13
%29 = load i64, i64* %6
%30 = shl i64 %29, 32
%31 = load i64, i64* %5
%32 = add i64 %30, %31
store i64 %32, i64* %2
%33 = load i64, i64* %2
%34 = add i64 %33, 4096000
store i64 %34, i64* %2
%35 = load i64, i64* %2
%36 = lshr i64 %35, 16
store i64 %36, i64* %2
%37 = load i64, i64* %2
%38 = call { i64, i64 } asm "divl $3", "={ax}|{ax},={dx}|{dx},A|A,r|m,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %37, i32 125)
%39 = extractvalue { i64, i64 } %38, 0
%40 = extractvalue { i64, i64 } %38, 1
store i64 %39, i64* %3
store i64 %40, i64* %4
%41 = load i64, i64* %3
%42 = call i64 @kD2ag4(i64 %41, i32 8192000)
ret i64 %42
}

LLVM IR (-O2):
define i64 @TAU32_ProbeGeneratorFrequency(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 1
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = icmp ult i64 %0, 8774618185728000
br i1 %6, label %13, label %7
7: ; preds = %5
%8 = icmp ugt i64 %0, 8817567858687999
%9 = and i64 %0, -4294967296
%10 = select i1 %8, i64 8817567858688000, i64 %9
%11 = add i64 %0, 4096000
%12 = select i1 %8, i64 4096000, i64 %11
br label %13
13: ; preds = %7, %5, %1
%14 = phi i64 [ 4096000, %1 ], [ 4096000, %5 ], [ %12, %7 ]
%15 = phi i64 [ 8796093022208000, %1 ], [ 8774618185728000, %5 ], [ %10, %7 ]
%16 = add i64 %14, %15
%17 = lshr i64 %16, 16
%18 = tail call { i64, i64 } asm "divl $3", "={ax}|{ax},={dx}|{dx},A|A,r|m,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %17, i32 125)
%19 = extractvalue { i64, i64 } %18, 0
%20 = tail call i64 @kD2ag4(i64 %19, i32 8192000)
ret i64 %20
}