#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 atoi(char *);
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int c;
  int i = 0;
  char input[3];
  printf("Minutes: ");
  while ((c = getchar()) != '\n') {
    input[i] = c;
    i++;
  }
  input[i] = '\0';
  printf("%s\n", input);
  int bottles = atoi(input) * 12;
  printf("Bottles: %i", bottles);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1182 <main+0x52>
mov    -0x8(%rbp),%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0xf(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x24>
movslq -0xc(%rbp),%rax
movb   $0x0,-0xf(%rbp,%rax,1)
lea    -0xf(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
call   1050 <atoi@plt>
imul   $0xc,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1186 <main+0x46>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %al,0xd(%rsp,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
jne    1170 <main+0x30>
mov    %ebx,%ebx
movb   $0x0,0xd(%rsp,%rbx,1)
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
shl    $0x2,%eax
lea    (%rax,%rax,2),%esi
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Minutes: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [12 x i8] c"Bottles: %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %10, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 %14
store i8 %12, i8* %15
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %7
18: ; preds = %7
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 %20
store i8 0, i8* %21
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%25 = call i32 @atoi(i8* %24)
%26 = mul nsw i32 %25, 12
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [10 x i8] c"Minutes: \00"
@.str.2 = [12 x i8] c"Bottles: %i\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = icmp eq i32 %4, 10
br i1 %5, label %16, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %11, %6 ], [ 0, %0 ]
%8 = phi i32 [ %12, %6 ], [ %4, %0 ]
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 %7
store i8 %9, i8* %10
%11 = add nuw i64 %7, 1
%12 = tail call i32 (...) @getchar()
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %6
14: ; preds = %6
%15 = and i64 %11, 4294967295
br label %16
16: ; preds = %14, %0
%17 = phi i64 [ 0, %0 ], [ %15, %14 ]
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 %17
store i8 0, i8* %18
%19 = call i32 @puts(i8* %2)
%20 = call i32 @atoi(i8* %2)
%21 = mul nsw i32 %20, 12
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %21)
ret i32 0
}