#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*/ puts(int /*<<< orphan*/);
void thing_2(void) {
  const char *hello = "Greetings from your computer!";
  char bye_bye[] = "So long now!";
  char *b;
  b = bye_bye;
  while (*hello)
    puts(hello++);
}


x86 assembly (clang, -O0):
<thing_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xef4(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xef2(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xeed(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <thing_2+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1030 <puts@plt>
jmp    1148 <thing_2+0x38>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thing_2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %ebx,%edi
call   1030 <puts@plt>
lea    0x1(%rbx),%edi
call   1030 <puts@plt>
lea    0x2(%rbx),%edi
call   1030 <puts@plt>
lea    0x3(%rbx),%edi
call   1030 <puts@plt>
lea    0x4(%rbx),%edi
call   1030 <puts@plt>
lea    0x5(%rbx),%edi
call   1030 <puts@plt>
lea    0x6(%rbx),%edi
call   1030 <puts@plt>
lea    0x7(%rbx),%edi
call   1030 <puts@plt>
lea    0x8(%rbx),%edi
call   1030 <puts@plt>
lea    0x9(%rbx),%edi
call   1030 <puts@plt>
lea    0xa(%rbx),%edi
call   1030 <puts@plt>
lea    0xb(%rbx),%edi
call   1030 <puts@plt>
lea    0xc(%rbx),%edi
call   1030 <puts@plt>
lea    0xd(%rbx),%edi
call   1030 <puts@plt>
lea    0xe(%rbx),%edi
call   1030 <puts@plt>
lea    0xf(%rbx),%edi
call   1030 <puts@plt>
lea    0x10(%rbx),%edi
call   1030 <puts@plt>
lea    0x11(%rbx),%edi
call   1030 <puts@plt>
lea    0x12(%rbx),%edi
call   1030 <puts@plt>
lea    0x13(%rbx),%edi
call   1030 <puts@plt>
lea    0x14(%rbx),%edi
call   1030 <puts@plt>
lea    0x15(%rbx),%edi
call   1030 <puts@plt>
lea    0x16(%rbx),%edi
call   1030 <puts@plt>
lea    0x17(%rbx),%edi
call   1030 <puts@plt>
lea    0x18(%rbx),%edi
call   1030 <puts@plt>
lea    0x19(%rbx),%edi
call   1030 <puts@plt>
lea    0x1a(%rbx),%edi
call   1030 <puts@plt>
lea    0x1b(%rbx),%edi
call   1030 <puts@plt>
add    $0x1c,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Greetings from your computer!\00"
@__const.thing_2.bye_bye = [13 x i8] c"So long now!\00"
define void @thing_2() {
%1 = alloca i8*
%2 = alloca [13 x i8]
%3 = alloca i8*
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
br label %6
6: ; preds = %10, %0
%7 = load i8*, i8** %1
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %1
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %1
%13 = ptrtoint i8* %11 to i32
%14 = call i32 @puts(i32 %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Greetings from your computer!\00"
define void @thing_2() {
%1 = tail call i32 @puts(i32 ptrtoint ([30 x i8]* @.str to i32))
%2 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 1) to i32))
%3 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 2) to i32))
%4 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 3) to i32))
%5 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 4) to i32))
%6 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 5) to i32))
%7 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 6) to i32))
%8 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 7) to i32))
%9 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 8) to i32))
%10 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 9) to i32))
%11 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 10) to i32))
%12 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 11) to i32))
%13 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 12) to i32))
%14 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 13) to i32))
%15 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 14) to i32))
%16 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 15) to i32))
%17 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 16) to i32))
%18 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 17) to i32))
%19 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 18) to i32))
%20 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 19) to i32))
%21 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 20) to i32))
%22 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 21) to i32))
%23 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 22) to i32))
%24 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 23) to i32))
%25 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 24) to i32))
%26 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 25) to i32))
%27 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 26) to i32))
%28 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 27) to i32))
%29 = tail call i32 @puts(i32 ptrtoint (i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 28) to i32))
ret void
}