#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 mysql(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char **);
int login() {
  int mysqla;
  char *pin;
  char *knum;
  printf("Geben Sie die Kundennummer ein:");
  scanf("%c", &knum);
  mysqla = mysql("MySQL Abfrage Kundennummer, knum");
  if (mysqla = 1) {
    printf("Kundennummer unbekannt\n");
  }
  printf("Geben Sie die PIN ein:");
  scanf("%c", &pin);
  mysql("MySQL PIN");
  return 0;
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1050 <mysql@plt>
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1179 <login+0x49>
jmp    1185 <login+0x55>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1050 <mysql@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<login>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb9(%rip),%rdi
call   1060 <mysql@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1060 <mysql@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Geben Sie die Kundennummer ein:\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [33 x i8] c"MySQL Abfrage Kundennummer, knum\00"
@.str.3 = [24 x i8] c"Kundennummer unbekannt\0A\00"
@.str.4 = [23 x i8] c"Geben Sie die PIN ein:\00"
@.str.5 = [10 x i8] c"MySQL PIN\00"
define i32 @login() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3)
%6 = call i32 @mysql(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
store i32 %6, i32* %1
store i32 1, i32* %1
br i1 true, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2)
%12 = call i32 @mysql(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Geben Sie die Kundennummer ein:\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [33 x i8] c"MySQL Abfrage Kundennummer, knum\00"
@.str.4 = [23 x i8] c"Geben Sie die PIN ein:\00"
@.str.5 = [10 x i8] c"MySQL PIN\00"
@str = [23 x i8] c"Kundennummer unbekannt\00"
define i32 @login() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2)
%7 = call i32 @mysql(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%11 = call i32 @mysql(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}