#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 */
char toupper(char);
void entferne_Zwischenzeichen_aus_Fingerprint(char *argv_fingerprint,
                                              char *eigener_fingerprint,
                                              int laenge) {
  int i, j;
  for (i = 0, j = 0; i < 100; i++) {
    if (!(argv_fingerprint[i] == '-' || argv_fingerprint[i] == '_') &&
        j < laenge) {
      eigener_fingerprint[j] = toupper(argv_fingerprint[i]);
      j++;
    }
  }
}


x86 assembly (clang, -O0):
<entferne_Zwischenzeichen_aus_Fingerprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    11ab <entferne_Zwischenzeichen_aus_Fingerprint+0x9b>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     1198 <entferne_Zwischenzeichen_aus_Fingerprint+0x88>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
je     1198 <entferne_Zwischenzeichen_aus_Fingerprint+0x88>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1198 <entferne_Zwischenzeichen_aus_Fingerprint+0x88>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119d <entferne_Zwischenzeichen_aus_Fingerprint+0x8d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <entferne_Zwischenzeichen_aus_Fingerprint+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entferne_Zwischenzeichen_aus_Fingerprint>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %r12d,%r12d
jmp    113a <entferne_Zwischenzeichen_aus_Fingerprint+0x2a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    $0x64,%rbp
je     1160 <entferne_Zwischenzeichen_aus_Fingerprint+0x50>
movzbl (%rbx,%rbp,1),%eax
cmp    $0x2d,%al
je     1130 <entferne_Zwischenzeichen_aus_Fingerprint+0x20>
cmp    $0x5f,%al
je     1130 <entferne_Zwischenzeichen_aus_Fingerprint+0x20>
cmp    %r15d,%r12d
jge    1130 <entferne_Zwischenzeichen_aus_Fingerprint+0x20>
movsbl %al,%edi
call   1030 <toupper@plt>
movslq %r12d,%rcx
mov    %al,(%r14,%rcx,1)
add    $0x1,%r12d
jmp    1130 <entferne_Zwischenzeichen_aus_Fingerprint+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @entferne_Zwischenzeichen_aus_Fingerprint(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %46, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %49
12: ; preds = %9
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %45, label %20
20: ; preds = %12
%21 = load i8*, i8** %4
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 95
br i1 %27, label %45, label %28
28: ; preds = %20
%29 = load i32, i32* %8
%30 = load i32, i32* %6
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %45
32: ; preds = %28
%33 = load i8*, i8** %4
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
%37 = load i8, i8* %36
%38 = call signext i8 @toupper(i8 signext %37)
%39 = load i8*, i8** %5
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
store i8 %38, i8* %42
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
br label %45
45: ; preds = %32, %28, %20, %12
br label %46
46: ; preds = %45
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
br label %9
49: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @entferne_Zwischenzeichen_aus_Fingerprint(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
br label %4
4: ; preds = %3, %16
%5 = phi i64 [ 0, %3 ], [ %18, %16 ]
%6 = phi i32 [ 0, %3 ], [ %17, %16 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 45, label %16
i8 95, label %16
]
9: ; preds = %4
%10 = icmp slt i32 %6, %2
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = tail call signext i8 @toupper(i8 signext %8)
%13 = sext i32 %6 to i64
%14 = getelementptr inbounds i8, i8* %1, i64 %13
store i8 %12, i8* %14
%15 = add nsw i32 %6, 1
br label %16
16: ; preds = %4, %4, %9, %11
%17 = phi i32 [ %6, %4 ], [ %15, %11 ], [ %6, %9 ], [ %6, %4 ]
%18 = add nuw nsw i64 %5, 1
%19 = icmp eq i64 %18, 100
br i1 %19, label %20, label %4
20: ; preds = %16
ret void
}