#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 countumlauts(const char *src) {
  int count;
  count = 0;
  for (; *src; src++) {
    printf("%c\n", *src);
    switch (*src) {
    case '\341':
      printf("ß gefunden\n");
      count++;
      break;
    case '\204':
      count++;
      break;
    case '\216':
      count++;
      break;
    case '\224':
      printf("ü gefunden\n");
      count++;
      break;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<countumlauts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11f5 <countumlauts+0xe5>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0xffffff84,%eax
je     11ac <countumlauts+0x9c>
jmp    115d <countumlauts+0x4d>
mov    -0x10(%rbp),%eax
sub    $0xffffff8e,%eax
je     11ba <countumlauts+0xaa>
jmp    116e <countumlauts+0x5e>
mov    -0x10(%rbp),%eax
sub    $0xffffff94,%eax
je     11c8 <countumlauts+0xb8>
jmp    117f <countumlauts+0x6f>
mov    -0x10(%rbp),%eax
sub    $0xffffffe1,%eax
jne    11df <countumlauts+0xcf>
jmp    1190 <countumlauts+0x80>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <countumlauts+0xcf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <countumlauts+0xcf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <countumlauts+0xcf>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e4 <countumlauts+0xd4>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <countumlauts+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countumlauts>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     119f <countumlauts+0x7f>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec4(%rip),%r14
lea    0xec1(%rip),%r15
lea    0xec6(%rip),%r12
xor    %ebp,%ebp
jmp    1166 <countumlauts+0x46>
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11a1 <countumlauts+0x81>
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl -0x1(%rbx),%eax
cmp    $0xffffff93,%eax
jg     1190 <countumlauts+0x70>
cmp    $0xffffff84,%eax
je     1158 <countumlauts+0x38>
cmp    $0xffffff8e,%eax
je     1158 <countumlauts+0x38>
jmp    115b <countumlauts+0x3b>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffff94,%eax
je     1150 <countumlauts+0x30>
cmp    $0xffffffe1,%eax
jne    115b <countumlauts+0x3b>
mov    %r12,%rdi
jmp    1153 <countumlauts+0x33>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [13 x i8] c"\C3\9F gefunden\0A\00"
@.str.2 = [13 x i8] c"\C3\BC gefunden\0A\00"
define i32 @countumlauts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %31, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
switch i32 %15, label %30 [
i32 -31, label %16
i32 -124, label %20
i32 -114, label %23
i32 -108, label %26
]
16: ; preds = %8
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %30
20: ; preds = %8
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %30
23: ; preds = %8
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %30
26: ; preds = %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %8, %26, %23, %20, %16
br label %31
31: ; preds = %30
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
br label %4
34: ; preds = %4
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@str = [12 x i8] c"\C3\BC gefunden\00"
@str.3 = [12 x i8] c"\C3\9F gefunden\00"
define i32 @countumlauts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %27, label %4
4: ; preds = %1, %22
%5 = phi i8 [ %25, %22 ], [ %2, %1 ]
%6 = phi i32 [ %23, %22 ], [ 0, %1 ]
%7 = phi i8* [ %24, %22 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
switch i32 %11, label %22 [
i32 -31, label %12
i32 -124, label %15
i32 -114, label %17
i32 -108, label %19
]
12: ; preds = %4
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%14 = add nsw i32 %6, 1
br label %22
15: ; preds = %4
%16 = add nsw i32 %6, 1
br label %22
17: ; preds = %4
%18 = add nsw i32 %6, 1
br label %22
19: ; preds = %4
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%21 = add nsw i32 %6, 1
br label %22
22: ; preds = %12, %15, %17, %19, %4
%23 = phi i32 [ %6, %4 ], [ %21, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %12 ]
%24 = getelementptr inbounds i8, i8* %7, i64 1
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %4
27: ; preds = %22, %1
%28 = phi i32 [ 0, %1 ], [ %23, %22 ]
ret i32 %28
}