#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);
int main(void) {
  char string[] = "Darf man wirklich so riechen?";
  char ch = '!';
  int x = 0;
  char *c = &ch;
  while (ch != '\0') {
    ch = string[x];
    putchar(ch);
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x14(%rbp)
movb   $0x21,-0x31(%rbp)
movl   $0x0,-0x38(%rbp)
lea    -0x31(%rbp),%rax
mov    %rax,-0x40(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x0,%eax
je     1196 <main+0x86>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%al
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1167 <main+0x57>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x44,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x66,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x77,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x6b,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x73,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    $0x3f,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.string = [30 x i8] c"Darf man wirklich so riechen?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [30 x i8]* %2 to i8*
store i8 33, i8* %3
store i32 0, i32* %4
store i8* %3, i8** %5
br label %7
7: ; preds = %11, %0
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %3
%16 = load i8, i8* %3
%17 = call i32 @putchar(i8 signext %16)
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %7
20: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 68)
%2 = tail call i32 @putchar(i8 signext 97)
%3 = tail call i32 @putchar(i8 signext 114)
%4 = tail call i32 @putchar(i8 signext 102)
%5 = tail call i32 @putchar(i8 signext 32)
%6 = tail call i32 @putchar(i8 signext 109)
%7 = tail call i32 @putchar(i8 signext 97)
%8 = tail call i32 @putchar(i8 signext 110)
%9 = tail call i32 @putchar(i8 signext 32)
%10 = tail call i32 @putchar(i8 signext 119)
%11 = tail call i32 @putchar(i8 signext 105)
%12 = tail call i32 @putchar(i8 signext 114)
%13 = tail call i32 @putchar(i8 signext 107)
%14 = tail call i32 @putchar(i8 signext 108)
%15 = tail call i32 @putchar(i8 signext 105)
%16 = tail call i32 @putchar(i8 signext 99)
%17 = tail call i32 @putchar(i8 signext 104)
%18 = tail call i32 @putchar(i8 signext 32)
%19 = tail call i32 @putchar(i8 signext 115)
%20 = tail call i32 @putchar(i8 signext 111)
%21 = tail call i32 @putchar(i8 signext 32)
%22 = tail call i32 @putchar(i8 signext 114)
%23 = tail call i32 @putchar(i8 signext 105)
%24 = tail call i32 @putchar(i8 signext 101)
%25 = tail call i32 @putchar(i8 signext 99)
%26 = tail call i32 @putchar(i8 signext 104)
%27 = tail call i32 @putchar(i8 signext 101)
%28 = tail call i32 @putchar(i8 signext 110)
%29 = tail call i32 @putchar(i8 signext 63)
%30 = tail call i32 @putchar(i8 signext 0)
ret i32 0
}