#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*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ letmesee(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
void info_wpa() {
  system("CLS");
  fprintf(stdout,
          "Source: https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access\n\n");
  fprintf(stdout,
          "\4 WPA:\n"
          "The WPA protocol implements much of the IEEE 802.11i standard.\n"
          "Specifically, the Temporal Key Integrity Protocol (TKIP) was "
          "adopted for WPA.\n"
          "WEP used a 64-bit or 128-bit encryption key that must be manually "
          "entered \n"
          "on wireless access points and devices and does not change.\n"
          "TKIP employs a per-packet key, meaning that it dynamically "
          "generates a new\n"
          "128-bit key for each packet and\n"
          "thus prevents the types of attacks that compromised WEP.\n\n");
  if ((letmesee(6 + 11)) == 0)
    return;
  fprintf(
      stdout,
      "\n\4 WPA2:\n"
      "WPA2 replaced WPA. WPA2, which requires testing and certification\n"
      "by the Wi-Fi Alliance, implements the mandatory elements of IEEE "
      "802.11i.\n"
      "In particular, it includes mandatory support for CCMP, an AES-based\n"
      "encryption mode with strong security. Certification began in September, "
      "2004;\n"
      "from March 13, 2006, WPA2 certifications mandatory for all new devices\n"
      "to bear the Wi-Fi trademark.\n\n");
  if ((letmesee(11)) == 0)
    return;
  fprintf(
      stdout,
      "\n\4 Security issues:\n"
      "Pre-shared key WPA and WPA2 remain vulnerable to password\n"
      "cracking attacks if users rely on a weak password or passphrase.\n"
      "To protect against a brute force attack, a truly random passphrase\n"
      "of 20 characters (selected from the set of 95 permitted characters)\n"
      "is probably sufficient. Brute forcing of simple passwords can be\n"
      "attempted using he Aircrack Suite starting from the four-way\n"
      "authentication handshake exchanged during association or periodic\n"
      "re-authentication. To further protect against intrusion, the network's\n"
      "SSID should not match any entry in the top 1,000 SSIDs as downloadable\n"
      "rainbow tables have been pre-generated for them and a multitude\n"
      "of common passwords.\n\n");
  pause();
  system("CLS");
}


x86 assembly (clang, -O0):
<info_wpa>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x11,%edi
call   1040 <letmesee@plt>
cmp    $0x0,%rax
jne    1193 <info_wpa+0x53>
jmp    11e9 <info_wpa+0xa9>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0x1060(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xb,%edi
call   1040 <letmesee@plt>
cmp    $0x0,%rax
jne    11c1 <info_wpa+0x81>
jmp    11e9 <info_wpa+0xa9>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0x11bf(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1060 <pause@plt>
lea    0xe1c(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_wpa>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <system@plt>
mov    0x2e8c(%rip),%rbx
mov    (%rbx),%edi
lea    0xea7(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed8(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x11,%edi
call   1040 <letmesee@plt>
test   %rax,%rax
je     11be <info_wpa+0x7e>
mov    (%rbx),%edi
lea    0x107b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xb,%edi
call   1040 <letmesee@plt>
test   %rax,%rax
je     11be <info_wpa+0x7e>
mov    (%rbx),%edi
lea    0x11eb(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1060 <pause@plt>
lea    0xe48(%rip),%rdi
pop    %rbx
jmp    1030 <system@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"CLS\00"
@stdout = global i32 0
@.str.1 = [63 x i8] c"Source: https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access\0A\0A\00"
@.str.2 = [448 x i8] c"\04 WPA:\0AThe WPA protocol implements much of the IEEE 802.11i standard.\0ASpecifically, the Temporal Key Integrity Protocol (TKIP) was adopted for WPA.\0AWEP used a 64-bit or 128-bit encryption key that must be manually entered \0Aon wireless access points and devices and does not change.\0ATKIP employs a per-packet key, meaning that it dynamically generates a new\0A128-bit key for each packet and\0Athus prevents the types of attacks that compromised WEP.\0A\0A\00"
@.str.3 = [397 x i8] c"\0A\04 WPA2:\0AWPA2 replaced WPA. WPA2, which requires testing and certification\0Aby the Wi-Fi Alliance, implements the mandatory elements of IEEE 802.11i.\0AIn particular, it includes mandatory support for CCMP, an AES-based\0Aencryption mode with strong security. Certification began in September, 2004;\0Afrom March 13, 2006, WPA2 certifications mandatory for all new devices\0Ato bear the Wi-Fi trademark.\0A\0A\00"
@.str.4 = [699 x i8] c"\0A\04 Security issues:\0APre-shared key WPA and WPA2 remain vulnerable to password\0Acracking attacks if users rely on a weak password or passphrase.\0ATo protect against a brute force attack, a truly random passphrase\0Aof 20 characters (selected from the set of 95 permitted characters)\0Ais probably sufficient. Brute forcing of simple passwords can be\0Aattempted using he Aircrack Suite starting from the four-way\0Aauthentication handshake exchanged during association or periodic\0Are-authentication. To further protect against intrusion, the network's\0ASSID should not match any entry in the top 1,000 SSIDs as downloadable\0Arainbow tables have been pre-generated for them and a multitude\0Aof common passwords.\0A\0A\00"
define void @info_wpa() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([448 x i8], [448 x i8]* @.str.2, i64 0, i64 0))
%6 = call i64 @letmesee(i32 17)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
br label %20
9: ; preds = %0
%10 = load i32, i32* @stdout
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str.3, i64 0, i64 0))
%12 = call i64 @letmesee(i32 11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %20
15: ; preds = %9
%16 = load i32, i32* @stdout
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([699 x i8], [699 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (...) @pause()
%19 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %15, %14, %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"CLS\00"
@stdout = global i32 0
@.str.1 = [63 x i8] c"Source: https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access\0A\0A\00"
@.str.2 = [448 x i8] c"\04 WPA:\0AThe WPA protocol implements much of the IEEE 802.11i standard.\0ASpecifically, the Temporal Key Integrity Protocol (TKIP) was adopted for WPA.\0AWEP used a 64-bit or 128-bit encryption key that must be manually entered \0Aon wireless access points and devices and does not change.\0ATKIP employs a per-packet key, meaning that it dynamically generates a new\0A128-bit key for each packet and\0Athus prevents the types of attacks that compromised WEP.\0A\0A\00"
@.str.3 = [397 x i8] c"\0A\04 WPA2:\0AWPA2 replaced WPA. WPA2, which requires testing and certification\0Aby the Wi-Fi Alliance, implements the mandatory elements of IEEE 802.11i.\0AIn particular, it includes mandatory support for CCMP, an AES-based\0Aencryption mode with strong security. Certification began in September, 2004;\0Afrom March 13, 2006, WPA2 certifications mandatory for all new devices\0Ato bear the Wi-Fi trademark.\0A\0A\00"
@.str.4 = [699 x i8] c"\0A\04 Security issues:\0APre-shared key WPA and WPA2 remain vulnerable to password\0Acracking attacks if users rely on a weak password or passphrase.\0ATo protect against a brute force attack, a truly random passphrase\0Aof 20 characters (selected from the set of 95 permitted characters)\0Ais probably sufficient. Brute forcing of simple passwords can be\0Aattempted using he Aircrack Suite starting from the four-way\0Aauthentication handshake exchanged during association or periodic\0Are-authentication. To further protect against intrusion, the network's\0ASSID should not match any entry in the top 1,000 SSIDs as downloadable\0Arainbow tables have been pre-generated for them and a multitude\0Aof common passwords.\0A\0A\00"
define void @info_wpa() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([448 x i8], [448 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i64 @letmesee(i32 17)
%7 = icmp eq i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %0
%9 = load i32, i32* @stdout
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i64 @letmesee(i32 11)
%12 = icmp eq i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i32, i32* @stdout
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([699 x i8], [699 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 (...) @pause()
%17 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %8, %0, %13
ret void
}