#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 *, int, ...);
void showCookTimeForTurkey(int pounds) {
  int necessaryMinutes = 15 + (15 * pounds);
  printf("Cook for %d minutes. \n", necessaryMinutes);
  if (necessaryMinutes > 120) {
    int halfway = necessaryMinutes / 2;
    printf("Rotate after %d of the %d minutes \n", halfway, necessaryMinutes);
  }
}


x86 assembly (clang, -O0):
<showCookTimeForTurkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xf,-0x4(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x78,-0x8(%rbp)
jle    1162 <showCookTimeForTurkey+0x52>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showCookTimeForTurkey>:
push   %rbp
push   %rbx
push   %rax
lea    (%rdi,%rdi,4),%eax
lea    (%rax,%rax,2),%ebp
lea    (%rax,%rax,2),%ebx
add    $0xf,%ebx
lea    0xeda(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x6a,%ebp
jl     114e <showCookTimeForTurkey+0x3e>
mov    %ebx,%esi
shr    %esi
lea    0xed8(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Cook for %d minutes. \0A\00"
@.str.1 = [36 x i8] c"Rotate after %d of the %d minutes \0A\00"
define void @showCookTimeForTurkey(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 15, %5
%7 = add nsw i32 15, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 120
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 2
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16)
br label %18
18: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Cook for %d minutes. \0A\00"
@.str.1 = [36 x i8] c"Rotate after %d of the %d minutes \0A\00"
define void @showCookTimeForTurkey(i32 %0) {
%2 = mul nsw i32 %0, 15
%3 = add nsw i32 %2, 15
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %2, 105
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = lshr i32 %3, 1
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %3)
br label %9
9: ; preds = %6, %1
ret void
}