#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 main(int argc, char **argv) {
  int number_of_carrots = 5;
  double amount_of_juice = 1.23;
  char *unit_of_tomatoes = "a bag";
  char middle_initial = 'G';
  printf("I have %d carrots.\n", number_of_carrots);
  printf("Did you drink %g quarts of tomato juice?\n", amount_of_juice);
  printf("I bought %s of tomatoes.\n", unit_of_tomatoes);
  printf("Is he Henry %c. Upham?\n", middle_initial);
  printf("\n");
  printf("\tIndented line, and missing newline...");
  printf("...new line here.\n");
  printf("\n");
  printf("Altogether we have %d carrots, %g quarts of tomato juice, %s, "
         "and a guy whose middle initial is \"%c\".\n",
         number_of_carrots, amount_of_juice, unit_of_tomatoes, middle_initial);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
movb   $0x47,-0x29(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x29(%rbp),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
movsbl -0x29(%rbp),%ecx
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed6(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed7(%rip),%rdi
movsd  0xead(%rip),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0xea0(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x47,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf68(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeeb(%rip),%rdi
mov    $0x5,%esi
movsd  0xe39(%rip),%xmm0
mov    %rbx,%rdx
mov    $0x47,%ecx
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a bag\00"
@.str.1 = [20 x i8] c"I have %d carrots.\0A\00"
@.str.2 = [42 x i8] c"Did you drink %g quarts of tomato juice?\0A\00"
@.str.3 = [26 x i8] c"I bought %s of tomatoes.\0A\00"
@.str.4 = [24 x i8] c"Is he Henry %c. Upham?\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [39 x i8] c"\09Indented line, and missing newline...\00"
@.str.7 = [19 x i8] c"...new line here.\0A\00"
@.str.8 = [103 x i8] c"Altogether we have %d carrots, %g quarts of tomato juice, %s, and a guy whose middle initial is \22%c\22.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store double 1.230000e+00, double* %7
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %8
store i8 71, i8* %9
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load double, double* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load i8*, i8** %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = load i8, i8* %9
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32, i32* %6
%24 = load double, double* %7
%25 = load i8*, i8** %8
%26 = load i8, i8* %9
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str.8, i64 0, i64 0), i32 %23, double %24, i8* %25, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a bag\00"
@.str.1 = [20 x i8] c"I have %d carrots.\0A\00"
@.str.2 = [42 x i8] c"Did you drink %g quarts of tomato juice?\0A\00"
@.str.3 = [26 x i8] c"I bought %s of tomatoes.\0A\00"
@.str.4 = [24 x i8] c"Is he Henry %c. Upham?\0A\00"
@.str.6 = [39 x i8] c"\09Indented line, and missing newline...\00"
@.str.8 = [103 x i8] c"Altogether we have %d carrots, %g quarts of tomato juice, %s, and a guy whose middle initial is \22%c\22.\0A\00"
@str = [18 x i8] c"...new line here.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), double 1.230000e+00)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 71)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @.str.8, i64 0, i64 0), i32 5, double 1.230000e+00, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 71)
ret i32 0
}