#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int fingerprint_aus_Datei_auslesen(char *fingerprint) {
  int i, j, start = 0;
  char c, fingerprint_unmodifiziert[100];
  for (i = 0; i < 100; i++)
    fingerprint_unmodifiziert[i] = ' ';
  FILE *fingerprint_datei = fopen("fingerprint", "r");
  if (fingerprint_datei) {
    for (i = 0; (c = getc(fingerprint_datei)) != EOF; i++) {
      fingerprint_unmodifiziert[i] = c;
    }
  } else {
    printf("Error opening file!\n");
    exit(1);
  }
  fclose(fingerprint_datei);
  for (i = 0, j = 0; i < 100; i++) {
    if (start == 1 && fingerprint_unmodifiziert[i] != ' ') {
      fingerprint[j] = fingerprint_unmodifiziert[i];
      j++;
    }
    if (fingerprint_unmodifiziert[i] == '=')
      start = 1;
  }
  return --j;
}


x86 assembly (clang, -O0):
<fingerprint_aus_Datei_auslesen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    118e <fingerprint_aus_Datei_auslesen+0x3e>
movslq -0xc(%rbp),%rax
movb   $0x20,-0x80(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <fingerprint_aus_Datei_auslesen+0x1d>
lea    0xe6b(%rip),%rdi
lea    0xe70(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     11ff <fingerprint_aus_Datei_auslesen+0xaf>
movl   $0x0,-0xc(%rbp)
mov    -0x88(%rbp),%rdi
call   1070 <getc@plt>
mov    %al,-0x15(%rbp)
movsbl %al,%eax
mov    0x2e12(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11fa <fingerprint_aus_Datei_auslesen+0xaa>
mov    -0x15(%rbp),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bd <fingerprint_aus_Datei_auslesen+0x6d>
jmp    1215 <fingerprint_aus_Datei_auslesen+0xc5>
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x88(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    129d <fingerprint_aus_Datei_auslesen+0x14d>
cmpl   $0x1,-0x14(%rbp)
jne    1271 <fingerprint_aus_Datei_auslesen+0x121>
movslq -0xc(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     1271 <fingerprint_aus_Datei_auslesen+0x121>
movslq -0xc(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x3d,%eax
jne    128a <fingerprint_aus_Datei_auslesen+0x13a>
movl   $0x1,-0x14(%rbp)
jmp    128f <fingerprint_aus_Datei_auslesen+0x13f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122f <fingerprint_aus_Datei_auslesen+0xdf>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingerprint_aus_Datei_auslesen>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x20202020,0x60(%rsp)
20
lea    0xe7f(%rip),%rdi
lea    0xe84(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     122a <fingerprint_aus_Datei_auslesen+0xda>
mov    %rax,%r12
mov    %rax,%rdi
call   1070 <getc@plt>
mov    0x2e30(%rip),%r15
cmp    (%r15),%al
je     11d3 <fingerprint_aus_Datei_auslesen+0x83>
mov    %rsp,%rbx
mov    %al,(%rbx)
mov    %r12,%rdi
call   1070 <getc@plt>
add    $0x1,%rbx
cmp    (%r15),%al
jne    11c0 <fingerprint_aus_Datei_auslesen+0x70>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %ecx,%ecx
mov    $0x1,%edx
xor    %eax,%eax
xor    %esi,%esi
mov    $0x1,%edi
jmp    1209 <fingerprint_aus_Datei_auslesen+0xb9>
nopl   (%rax)
cltq
mov    %bl,(%r14,%rax,1)
add    $0x1,%eax
cmp    $0x3d,%bl
cmove  %edx,%esi
add    $0x1,%rcx
cmp    $0x64,%rcx
je     121b <fingerprint_aus_Datei_auslesen+0xcb>
movzbl (%rsp,%rcx,1),%ebx
cmp    $0x1,%esi
jne    11f9 <fingerprint_aus_Datei_auslesen+0xa9>
cmp    $0x20,%bl
jne    11f0 <fingerprint_aus_Datei_auslesen+0xa0>
mov    %edi,%esi
jmp    11ff <fingerprint_aus_Datei_auslesen+0xaf>
add    $0xffffffff,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xded(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"fingerprint\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.2 = [21 x i8] c"Error opening file!\0A\00"
define i32 @fingerprint_aus_Datei_auslesen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca [100 x i8]
%8 = alloca i32*
store i8* %0, i8** %2
store i32 0, i32* %5
store i32 0, i32* %3
br label %9
9: ; preds = %16, %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %14
store i8 32, i8* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %9
19: ; preds = %9
%20 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %8
%21 = load i32*, i32** %8
%22 = icmp ne i32* %21, null
br i1 %22, label %23, label %40
23: ; preds = %19
store i32 0, i32* %3
br label %24
24: ; preds = %36, %23
%25 = load i32*, i32** %8
%26 = call signext i8 @getc(i32* %25)
store i8 %26, i8* %6
%27 = sext i8 %26 to i32
%28 = load i8, i8* @EOF
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %27, %29
br i1 %30, label %31, label %39
31: ; preds = %24
%32 = load i8, i8* %6
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %34
store i8 %32, i8* %35
br label %36
36: ; preds = %31
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %24
39: ; preds = %24
br label %43
40: ; preds = %19
%41 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %39
%44 = load i32*, i32** %8
%45 = call i32 @fclose(i32* %44)
store i32 0, i32* %3
store i32 0, i32* %4
br label %46
46: ; preds = %79, %43
%47 = load i32, i32* %3
%48 = icmp slt i32 %47, 100
br i1 %48, label %49, label %82
49: ; preds = %46
%50 = load i32, i32* %5
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %70
52: ; preds = %49
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 32
br i1 %58, label %59, label %70
59: ; preds = %52
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = load i8*, i8** %2
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
store i8 %63, i8* %67
%68 = load i32, i32* %4
%69 = add nsw i32 %68, 1
store i32 %69, i32* %4
br label %70
70: ; preds = %59, %52, %49
%71 = load i32, i32* %3
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 61
br i1 %76, label %77, label %78
77: ; preds = %70
store i32 1, i32* %5
br label %78
78: ; preds = %77, %70
br label %79
79: ; preds = %78
%80 = load i32, i32* %3
%81 = add nsw i32 %80, 1
store i32 %81, i32* %3
br label %46
82: ; preds = %46
%83 = load i32, i32* %4
%84 = add nsw i32 %83, -1
store i32 %84, i32* %4
ret i32 %84
}

LLVM IR (-O2):
@.str = [12 x i8] c"fingerprint\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
@str = [20 x i8] c"Error opening file!\00"
define i32 @fingerprint_aus_Datei_auslesen(i8* nocapture writeonly %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = tail call signext i8 @getc(i32* %5)
%9 = load i8, i8* @EOF
%10 = icmp eq i8 %8, %9
br i1 %10, label %22, label %11
11: ; preds = %7, %11
%12 = phi i64 [ %15, %11 ], [ 0, %7 ]
%13 = phi i8 [ %16, %11 ], [ %8, %7 ]
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %12
store i8 %13, i8* %14
%15 = add nuw i64 %12, 1
%16 = tail call signext i8 @getc(i32* %5)
%17 = load i8, i8* @EOF
%18 = icmp eq i8 %16, %17
br i1 %18, label %22, label %11
19: ; preds = %1
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%21 = tail call i32 @exit(i32 1)
unreachable
22: ; preds = %11, %7
%23 = tail call i32 @fclose(i32* %5)
br label %24
24: ; preds = %22, %41
%25 = phi i64 [ 0, %22 ], [ %44, %41 ]
%26 = phi i32 [ 0, %22 ], [ %42, %41 ]
%27 = phi i32 [ 0, %22 ], [ %43, %41 ]
%28 = icmp eq i32 %27, 1
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %25
%30 = load i8, i8* %29
br i1 %28, label %31, label %37
31: ; preds = %24
%32 = icmp eq i8 %30, 32
br i1 %32, label %41, label %33
33: ; preds = %31
%34 = sext i32 %26 to i64
%35 = getelementptr inbounds i8, i8* %0, i64 %34
store i8 %30, i8* %35
%36 = add nsw i32 %26, 1
br label %37
37: ; preds = %24, %33
%38 = phi i32 [ %36, %33 ], [ %26, %24 ]
%39 = icmp eq i8 %30, 61
%40 = select i1 %39, i32 1, i32 %27
br label %41
41: ; preds = %37, %31
%42 = phi i32 [ %26, %31 ], [ %38, %37 ]
%43 = phi i32 [ 1, %31 ], [ %40, %37 ]
%44 = add nuw nsw i64 %25, 1
%45 = icmp eq i64 %44, 100
br i1 %45, label %46, label %24
46: ; preds = %41
%47 = add nsw i32 %42, -1
ret i32 %47
}