#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 EXIT_SUCCESS;
int gcd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("= Aufgabe 11 =\n");
  printf("ggT(75, 25) = %d (%s)\n", gcd(100, 25),
         (gcd(100, 25) == 25) ? "Korrekt" : "Falsch");
  printf("ggT(45, 25) = %d (%s)\n", gcd(45, 25),
         (gcd(45, 25) == 5) ? "Korrekt" : "Falsch");
  printf("ggT(11, 10) = %d (%s)\n", gcd(11, 10),
         (gcd(11, 10) == 1) ? "Korrekt" : "Falsch");
  printf("ggT(76, 24) = %d (%s)\n", gcd(76, 24),
         (gcd(76, 24) == 4) ? "Korrekt" : "Falsch");
  return EXIT_SUCCESS;
}


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>
mov    $0x64,%edi
mov    $0x19,%esi
call   1040 <gcd@plt>
mov    %eax,-0x20(%rbp)
mov    $0x64,%edi
mov    $0x19,%esi
call   1040 <gcd@plt>
mov    -0x20(%rbp),%esi
mov    %eax,%ecx
lea    0xebe(%rip),%rdx
lea    0xeaf(%rip),%rax
cmp    $0x19,%ecx
cmove  %rax,%rdx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    $0x19,%esi
call   1040 <gcd@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x2d,%edi
mov    $0x19,%esi
call   1040 <gcd@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%ecx
lea    0xe75(%rip),%rdx
lea    0xe66(%rip),%rax
cmp    $0x5,%ecx
cmove  %rax,%rdx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xb,%edi
mov    $0xa,%esi
call   1040 <gcd@plt>
mov    %eax,-0x18(%rbp)
mov    $0xb,%edi
mov    $0xa,%esi
call   1040 <gcd@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%ecx
lea    0xe2c(%rip),%rdx
lea    0xe1d(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4c,%edi
mov    $0x18,%esi
call   1040 <gcd@plt>
mov    %eax,-0x14(%rbp)
mov    $0x4c,%edi
mov    $0x18,%esi
call   1040 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xde3(%rip),%rdx
lea    0xdd4(%rip),%rax
cmp    $0x4,%ecx
cmove  %rax,%rdx
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
mov    %eax,%ebp
mov    $0x64,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
cmp    $0x19,%eax
lea    0xead(%rip),%r14
lea    0xeae(%rip),%rbx
mov    %rbx,%rdx
cmove  %r14,%rdx
lea    0xe81(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2d,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
mov    %eax,%ebp
mov    $0x2d,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
cmp    $0x5,%eax
mov    %rbx,%rdx
cmove  %r14,%rdx
lea    0xe6d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xb,%edi
mov    $0xa,%esi
call   1050 <gcd@plt>
mov    %eax,%ebp
mov    $0xb,%edi
mov    $0xa,%esi
call   1050 <gcd@plt>
cmp    $0x1,%eax
mov    %rbx,%rdx
cmove  %r14,%rdx
lea    0xe4a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4c,%edi
mov    $0x18,%esi
call   1050 <gcd@plt>
mov    %eax,%ebp
mov    $0x4c,%edi
mov    $0x18,%esi
call   1050 <gcd@plt>
cmp    $0x4,%eax
cmove  %r14,%rbx
lea    0xe2a(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"= Aufgabe 11 =\0A\00"
@.str.1 = [23 x i8] c"ggT(75, 25) = %d (%s)\0A\00"
@.str.2 = [8 x i8] c"Korrekt\00"
@.str.3 = [7 x i8] c"Falsch\00"
@.str.4 = [23 x i8] c"ggT(45, 25) = %d (%s)\0A\00"
@.str.5 = [23 x i8] c"ggT(11, 10) = %d (%s)\0A\00"
@.str.6 = [23 x i8] c"ggT(76, 24) = %d (%s)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @gcd(i32 100, i32 25)
%8 = call i32 @gcd(i32 100, i32 25)
%9 = icmp eq i32 %8, 25
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %11)
%13 = call i32 @gcd(i32 45, i32 25)
%14 = call i32 @gcd(i32 45, i32 25)
%15 = icmp eq i32 %14, 5
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %13, i8* %17)
%19 = call i32 @gcd(i32 11, i32 10)
%20 = call i32 @gcd(i32 11, i32 10)
%21 = icmp eq i32 %20, 1
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %19, i8* %23)
%25 = call i32 @gcd(i32 76, i32 24)
%26 = call i32 @gcd(i32 76, i32 24)
%27 = icmp eq i32 %26, 4
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %25, i8* %29)
%31 = load i32, i32* @EXIT_SUCCESS
ret i32 %31
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"ggT(75, 25) = %d (%s)\0A\00"
@.str.2 = [8 x i8] c"Korrekt\00"
@.str.3 = [7 x i8] c"Falsch\00"
@.str.4 = [23 x i8] c"ggT(45, 25) = %d (%s)\0A\00"
@.str.5 = [23 x i8] c"ggT(11, 10) = %d (%s)\0A\00"
@.str.6 = [23 x i8] c"ggT(76, 24) = %d (%s)\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [15 x i8] c"= Aufgabe 11 =\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @gcd(i32 100, i32 25)
%5 = tail call i32 @gcd(i32 100, i32 25)
%6 = icmp eq i32 %5, 25
%7 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* %7)
%9 = tail call i32 @gcd(i32 45, i32 25)
%10 = tail call i32 @gcd(i32 45, i32 25)
%11 = icmp eq i32 %10, 5
%12 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %9, i8* %12)
%14 = tail call i32 @gcd(i32 11, i32 10)
%15 = tail call i32 @gcd(i32 11, i32 10)
%16 = icmp eq i32 %15, 1
%17 = select i1 %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %14, i8* %17)
%19 = tail call i32 @gcd(i32 76, i32 24)
%20 = tail call i32 @gcd(i32 76, i32 24)
%21 = icmp eq i32 %20, 4
%22 = select i1 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %19, i8* %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}