#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(void) {
  char *message = "Programming in C is fun\n";
  char message2[] = "You said it!\n";
  char *format = "x = %i\n";
  int x = 100;
  printf("\n");
  printf("Programming in C is fun\n");
  printf("%s", "Programming in C is fun\n");
  printf("%s", message);
  printf("%s", message);
  printf("\n");
  printf("You said it!\n");
  printf("%s", message2);
  printf("%s", message2);
  printf("%s", &message2[0]);
  printf("\n");
  printf("said it\n");
  printf("%s", message2 + 4);
  printf("%s", message2 + 4);
  printf("%s", &message2[4]);
  printf("\n");
  printf("x = %i\n", x);
  printf(format, x);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xee6(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xee0(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x64,-0x2c(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
add    $0x4,%rsi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
add    $0x4,%rsi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1e(%rbp),%rsi
add    $0x4,%rsi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0xa217469206469,%rax
mov    %rax,0xe(%rsp)
movabs $0x6469617320756f59,%rax
61 69 64
mov    %rax,0x8(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe73(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe5e(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdec(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Programming in C is fun\0A\00"
@__const.main.message2 = [14 x i8] c"You said it!\0A\00"
@.str.1 = [8 x i8] c"x = %i\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [14 x i8] c"You said it!\0A\00"
@.str.5 = [9 x i8] c"said it\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [14 x i8]
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = bitcast [14 x i8]* %3 to i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %4
store i32 100, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%24 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%28 = getelementptr inbounds i8, i8* %27, i64 4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = load i8*, i8** %4
%36 = load i32, i32* %5
%37 = call i32 (i8*, ...) @printf(i8* %35, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.message2 = [14 x i8] c"You said it!\0A\00"
@.str.1 = [8 x i8] c"x = %i\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@str.8 = [24 x i8] c"Programming in C is fun\00"
@str.9 = [13 x i8] c"You said it!\00"
@str.10 = [8 x i8] c"said it\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.9, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%13 = call i32 @putchar(i32 10)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0))
%15 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 4
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%19 = call i32 @putchar(i32 10)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 100)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 100)
%22 = call i32 @putchar(i32 10)
ret i32 0
}