int getcodi(co, di)
int *co;
double *di;
{
  *co = getintpar("Course");
  if (*co < 0 || *co > 360)
    return (1);
  *di = getfltpar("Distance");
  if (*di <= 0.0 || *di > 15.0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<getcodi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <getintpar@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1163 <getcodi+0x43>
mov    -0x10(%rbp),%rax
cmpl   $0x168,(%rax)
jle    116f <getcodi+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    11c7 <getcodi+0xa7>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <getfltpar@plt>
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jae    11b4 <getcodi+0x94>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe56(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c0 <getcodi+0xa0>
movl   $0x1,-0x4(%rbp)
jmp    11c7 <getcodi+0xa7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcodi>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <getintpar@plt>
mov    %eax,%ecx
mov    %eax,(%rbx)
mov    $0x1,%eax
cmp    $0x168,%ecx
ja     116d <getcodi+0x4d>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <getfltpar@plt>
mov    %eax,%ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
add    $0xfffffff0,%ecx
xor    %eax,%eax
cmp    $0xfffffff1,%ecx
setb   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Course\00"
@.str.1 = [9 x i8] c"Distance\00"
define i32 @getcodi(i32* %0, double* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %4
store double* %1, double** %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @getintpar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %4
store i32 %6, i32* %7
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = icmp sgt i32 %13, 360
br i1 %14, label %15, label %16
15: ; preds = %11, %2
store i32 1, i32* %3
br label %29
16: ; preds = %11
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @getfltpar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%18 = sitofp i32 %17 to double
%19 = load double*, double** %5
store double %18, double* %19
%20 = load double*, double** %5
%21 = load double, double* %20
%22 = fcmp ole double %21, 0.000000e+00
br i1 %22, label %27, label %23
23: ; preds = %16
%24 = load double*, double** %5
%25 = load double, double* %24
%26 = fcmp ogt double %25, 1.500000e+01
br i1 %26, label %27, label %28
27: ; preds = %23, %16
store i32 1, i32* %3
br label %29
28: ; preds = %23
store i32 0, i32* %3
br label %29
29: ; preds = %28, %27, %15
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [7 x i8] c"Course\00"
@.str.1 = [9 x i8] c"Distance\00"
define i32 @getcodi(i32* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getintpar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %0
%4 = icmp ugt i32 %3, 360
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getfltpar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = sitofp i32 %6 to double
store double %7, double* %1
%8 = add i32 %6, -16
%9 = icmp ult i32 %8, -15
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ 1, %2 ], [ %10, %5 ]
ret i32 %12
}