#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 int /*<<< orphan*/ local_buffer;

/* Variables and functions */
int /*<<< orphan*/ set_TemmaCometTracking(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int set_CometTracking(int RArate, int DECrate) {
  char local_buffer[16];
  if (RArate < -21541) {
    RArate = -21541;
  }
  if (RArate > 21541) {
    RArate = 21541;
  }
  if (DECrate < -600) {
    DECrate = -600;
  }
  if (DECrate > 600) {
    DECrate = 600;
  }
  snprintf(local_buffer, sizeof(local_buffer), "%+6d,%+5d", RArate, DECrate);
  set_TemmaCometTracking(local_buffer);
  return 0;
}


x86 assembly (clang, -O0):
<set_CometTracking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffabdb,-0x4(%rbp)
jge    1142 <set_CometTracking+0x22>
movl   $0xffffabdb,-0x4(%rbp)
cmpl   $0x5425,-0x4(%rbp)
jle    1156 <set_CometTracking+0x36>
movl   $0x5425,-0x4(%rbp)
cmpl   $0xfffffda8,-0x8(%rbp)
jge    116a <set_CometTracking+0x4a>
movl   $0xfffffda8,-0x8(%rbp)
cmpl   $0x258,-0x8(%rbp)
jle    117e <set_CometTracking+0x5e>
movl   $0x258,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x10,%esi
lea    0xe6b(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <set_TemmaCometTracking@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_CometTracking>:
push   %rbx
sub    $0x10,%rsp
cmp    $0xffffabdc,%edi
mov    $0xffffabdb,%eax
cmovge %edi,%eax
cmp    $0x5425,%eax
mov    $0x5425,%ecx
cmovl  %eax,%ecx
cmp    $0xfffffda9,%esi
mov    $0xfffffda8,%eax
cmovge %esi,%eax
cmp    $0x258,%eax
mov    $0x258,%r8d
cmovl  %eax,%r8d
lea    0xe9c(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <set_TemmaCometTracking@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%+6d,%+5d\00"
define i32 @set_CometTracking(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, -21541
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -21541, i32* %3
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 21541
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 21541, i32* %3
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, -600
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 -600, i32* %4
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 600
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 600, i32* %4
br label %21
21: ; preds = %20, %17
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @snprintf(i8* %22, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%27 = call i32 @set_TemmaCometTracking(i8* %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%+6d,%+5d\00"
define i32 @set_CometTracking(i32 %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, -21541
%6 = select i1 %5, i32 %0, i32 -21541
%7 = icmp slt i32 %6, 21541
%8 = select i1 %7, i32 %6, i32 21541
%9 = icmp sgt i32 %1, -600
%10 = select i1 %9, i32 %1, i32 -600
%11 = icmp slt i32 %10, 600
%12 = select i1 %11, i32 %10, i32 600
%13 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12)
%14 = call i32 @set_TemmaCometTracking(i8* %4)
ret i32 0
}