#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 */
typedef int /*<<< orphan*/ foods;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fortune_cooke(char *);
int /*<<< orphan*/ print_lon_lat();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main() {
  char quote[] = "Cookies make you fat";
  char *t = quote;
  fortune_cooke(t);
  printf("%s\n", t);
  print_lon_lat();
  char food[256];
  char *foods = food;
  printf("Enter favorite food: ");
  fgets(foods, sizeof(foods), stdin);
  printf("Food: %s\n", foods);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea2(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe9d(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <fortune_cooke@plt>
mov    -0x28(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_lon_lat@plt>
lea    -0x130(%rbp),%rax
mov    %rax,-0x138(%rbp)
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x138(%rbp),%rdi
mov    0x2e1a(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1050 <fgets@plt>
mov    -0x138(%rbp),%rsi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x120,%rsp
movaps 0xea1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x74616620756f79,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fortune_cooke@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <print_lon_lat@plt>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <fgets@plt>
lea    0xe6f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [22 x i8] c"Enter favorite food: \00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"Food: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [21 x i8]* %2 to i8*
%7 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @fortune_cooke(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @print_lon_lat()
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
store i8* %13, i8** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %5
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %15, i32 8, i32 %16)
%18 = load i8*, i8** %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
@.str.1 = [22 x i8] c"Enter favorite food: \00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"Food: %s\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = call i32 @fortune_cooke(i8* %3)
%5 = call i32 @puts(i8* %3)
%6 = call i32 (...) @print_lon_lat()
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %7, i32 8, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}