#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*/ putchar(char);
void stink_1(void) {
  char string[] = "Is it supposed to smell that way?";
  char ch;
  int x;
  ch = 'a';
  x = 0;
  while (ch != '\0') {
    ch = string[x++];
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<stink_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x22,%edx
call   1040 <memcpy@plt>
movb   $0x61,-0x31(%rbp)
movl   $0x0,-0x38(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x0,%eax
je     1177 <stink_1+0x57>
mov    -0x38(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x38(%rbp)
cltq
mov    -0x30(%rbp,%rax,1),%al
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%edi
call   1030 <putchar@plt>
jmp    1148 <stink_1+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stink_1>:
push   %rax
mov    $0x49,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x75,%edi
call   1030 <putchar@plt>
mov    $0x70,%edi
call   1030 <putchar@plt>
mov    $0x70,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x77,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x79,%edi
call   1030 <putchar@plt>
mov    $0x3f,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__const.stink_1.string = [34 x i8] c"Is it supposed to smell that way?\00"
define void @stink_1() {
%1 = alloca [34 x i8]
%2 = alloca i8
%3 = alloca i32
%4 = bitcast [34 x i8]* %1 to i8*
store i8 97, i8* %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %2
%15 = load i8, i8* %2
%16 = call i32 @putchar(i8 signext %15)
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @stink_1() {
%1 = tail call i32 @putchar(i8 signext 73)
%2 = tail call i32 @putchar(i8 signext 115)
%3 = tail call i32 @putchar(i8 signext 32)
%4 = tail call i32 @putchar(i8 signext 105)
%5 = tail call i32 @putchar(i8 signext 116)
%6 = tail call i32 @putchar(i8 signext 32)
%7 = tail call i32 @putchar(i8 signext 115)
%8 = tail call i32 @putchar(i8 signext 117)
%9 = tail call i32 @putchar(i8 signext 112)
%10 = tail call i32 @putchar(i8 signext 112)
%11 = tail call i32 @putchar(i8 signext 111)
%12 = tail call i32 @putchar(i8 signext 115)
%13 = tail call i32 @putchar(i8 signext 101)
%14 = tail call i32 @putchar(i8 signext 100)
%15 = tail call i32 @putchar(i8 signext 32)
%16 = tail call i32 @putchar(i8 signext 116)
%17 = tail call i32 @putchar(i8 signext 111)
%18 = tail call i32 @putchar(i8 signext 32)
%19 = tail call i32 @putchar(i8 signext 115)
%20 = tail call i32 @putchar(i8 signext 109)
%21 = tail call i32 @putchar(i8 signext 101)
%22 = tail call i32 @putchar(i8 signext 108)
%23 = tail call i32 @putchar(i8 signext 108)
%24 = tail call i32 @putchar(i8 signext 32)
%25 = tail call i32 @putchar(i8 signext 116)
%26 = tail call i32 @putchar(i8 signext 104)
%27 = tail call i32 @putchar(i8 signext 97)
%28 = tail call i32 @putchar(i8 signext 116)
%29 = tail call i32 @putchar(i8 signext 32)
%30 = tail call i32 @putchar(i8 signext 119)
%31 = tail call i32 @putchar(i8 signext 97)
%32 = tail call i32 @putchar(i8 signext 121)
%33 = tail call i32 @putchar(i8 signext 63)
%34 = tail call i32 @putchar(i8 signext 0)
ret void
}