#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*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int zahl1;
  int zahl2;
  int antw;
  int zahl3;
  printf("Zahl1 eingeben\n");
  scanf("%d", &zahl1);
  printf("Zahl2 eingeben\n");
  scanf("%d", &zahl2);
  printf("%d und %d\n", zahl1, zahl2);
  printf("Soll die Zahlen addiert werden?\n");
  scanf("%d", &zahl3);
  if (zahl3 < 1) {
    antw = zahl2 + zahl1;
    printf("%d\n", antw);
  } else {
    printf("Wiedersehn\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe75(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x20(%rbp)
jge    11cd <main+0xad>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b2 <main+0x82>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
jmp    11c8 <main+0x98>
mov    0x8(%rsp),%esi
add    0x4(%rsp),%esi
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Zahl1 eingeben\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Zahl2 eingeben\0A\00"
@.str.3 = [11 x i8] c"%d und %d\0A\00"
@.str.4 = [33 x i8] c"Soll die Zahlen addiert werden?\0A\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [12 x i8] c"Wiedersehn\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%19 = load i32, i32* %9
%20 = icmp slt i32 %19, 1
br i1 %20, label %21, label %27
21: ; preds = %2
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = add nsw i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %25)
br label %29
27: ; preds = %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %29
29: ; preds = %27, %21
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [11 x i8] c"%d und %d\0A\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@str = [15 x i8] c"Zahl1 eingeben\00"
@str.7 = [15 x i8] c"Zahl2 eingeben\00"
@str.8 = [32 x i8] c"Soll die Zahlen addiert werden?\00"
@str.9 = [11 x i8] c"Wiedersehn\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.7, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 1
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %27
25: ; preds = %2
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.9, i64 0, i64 0))
br label %27
27: ; preds = %25, %20
ret i32 0
}