#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 Tsoil(double lst_c, int libcropcode) {
  if (libcropcode == 0) {
    printf("unknown crop\n");
    return (lst_c);
  }
  if (libcropcode == 1) {
    printf("CIA Corn 2008-2010 (unpublished)\n");
    return (0.9456 * lst_c - 1.77);
  }
}


x86 assembly (clang, -O0):
<Tsoil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1145 <Tsoil+0x35>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117d <Tsoil+0x6d>
cmpl   $0x1,-0x14(%rbp)
jne    117d <Tsoil+0x6d>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe94(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tsoil>:
push   %rax
cmp    $0x1,%edi
je     1132 <Tsoil+0x22>
test   %edi,%edi
jne    1158 <Tsoil+0x48>
lea    0xf10(%rip),%rdi
movsd  %xmm0,(%rsp)
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret
lea    0xed7(%rip),%rdi
movsd  %xmm0,(%rsp)
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
addsd  0xeb0(%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 @Tsoil(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 %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = load double, double* %4
store double %10, double* %3
br label %18
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%16 = load double, double* %4
%17 = call double @llvm.fmuladd.f64(double 0x3FEE425AEE631F8A, double %16, double -1.770000e+00)
store double %17, double* %3
br label %18
18: ; preds = %8, %14, %11
%19 = load double, double* %3
ret double %19
}

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 @Tsoil(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 0x3FEE425AEE631F8A, double -1.770000e+00)
br label %8
8: ; preds = %2, %3, %5
%9 = phi double [ %0, %3 ], [ %7, %5 ], [ undef, %2 ]
ret double %9
}