#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 /*<<< orphan*/ printf(char *);
double Tair(double lst_c, int libcropcode) {
  if (libcropcode == 0) {
    printf("unknown crop\n");
    return (-28678);
  }
  if (libcropcode == 1) {
    printf("CIA Corn 2008-2010 (unpublished)\n");
    return (0.6832 * lst_c + 2.43);
  }
}


x86 assembly (clang, -O0):
<Tair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1148 <Tair+0x38>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <Tair+0x70>
cmpl   $0x1,-0x14(%rbp)
jne    1180 <Tair+0x70>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tair>:
push   %rax
cmp    $0x1,%edi
je     1130 <Tair+0x20>
test   %edi,%edi
jne    1126 <Tair+0x16>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
movsd  0xee2(%rip),%xmm0
pop    %rax
ret
lea    0xee1(%rip),%rdi
movsd  %xmm0,(%rsp)
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
mulsd  0xeb2(%rip),%xmm0
addsd  0xeb2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown crop\0A\00"
@.str.1 = [34 x i8] c"CIA Corn 2008-2010 (unpublished)\0A\00"
define double @Tair(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store double -2.867800e+04, double* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%15 = load double, double* %4
%16 = call double @llvm.fmuladd.f64(double 6.832000e-01, double %15, double 2.430000e+00)
store double %16, double* %3
br label %17
17: ; preds = %8, %13, %10
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
@str = [33 x i8] c"CIA Corn 2008-2010 (unpublished)\00"
@str.2 = [13 x i8] c"unknown crop\00"
define double @Tair(double %0, i32 %1) {
switch i32 %1, label %8 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
br label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%7 = tail call double @llvm.fmuladd.f64(double %0, double 6.832000e-01, double 2.430000e+00)
br label %8
8: ; preds = %2, %3, %5
%9 = phi double [ -2.867800e+04, %3 ], [ %7, %5 ], [ undef, %2 ]
ret double %9
}