#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 /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  char buchstabe = 'x';
  unsigned short kurze_zahl = 100;
  printf("Ausgabe des Buchstaben 'x' in verschiedenen Formaten: \n");
  printf("%c\n", buchstabe);
  printf("%d\n", buchstabe);
  printf("Ausgabe der Zahl 100 in verschiedenen Formaten: \n");
  printf("dezimal: ");
  printf("%d\n", kurze_zahl);
  printf("hexadezimal: ");
  printf("%x\n", kurze_zahl);
  printf("oktal: ");
  printf("%o\n", kurze_zahl);
  kurze_zahl = -100;
  printf("Ausgabe von - 100: ");
  printf("%d\n", kurze_zahl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
movb   $0x78,-0x5(%rbp)
movw   $0x64,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzwl -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzwl -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzwl -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movw   $0xff9c,-0x8(%rbp)
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movzwl -0x8(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9d(%rip),%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xff9c,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [56 x i8] c"Ausgabe des Buchstaben 'x' in verschiedenen Formaten: \0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [50 x i8] c"Ausgabe der Zahl 100 in verschiedenen Formaten: \0A\00"
@.str.4 = [10 x i8] c"dezimal: \00"
@.str.5 = [14 x i8] c"hexadezimal: \00"
@.str.6 = [4 x i8] c"%x\0A\00"
@.str.7 = [8 x i8] c"oktal: \00"
@.str.8 = [4 x i8] c"%o\0A\00"
@.str.9 = [20 x i8] c"Ausgabe von - 100: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
store i32 0, i32* %1
%4 = load i32, i32* @stdout
%5 = call i32 @setbuf(i32 %4, i32* null)
store i8 120, i8* %2
store i16 100, i16* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%23 = load i16, i16* %3
%24 = zext i16 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %24)
store i16 -100, i16* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%27 = load i16, i16* %3
%28 = zext i16 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.4 = [10 x i8] c"dezimal: \00"
@.str.5 = [14 x i8] c"hexadezimal: \00"
@.str.6 = [4 x i8] c"%x\0A\00"
@.str.7 = [8 x i8] c"oktal: \00"
@.str.8 = [4 x i8] c"%o\0A\00"
@.str.9 = [20 x i8] c"Ausgabe von - 100: \00"
@str = [55 x i8] c"Ausgabe des Buchstaben 'x' in verschiedenen Formaten: \00"
@str.10 = [49 x i8] c"Ausgabe der Zahl 100 in verschiedenen Formaten: \00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 120)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 120)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 100)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 100)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 100)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 65436)
ret i32 0
}