#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*/ authBL();
int /*<<< orphan*/ fsend(char *);
int /*<<< orphan*/ get();
char *parseHTCBlock();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send(char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ zenity(int);
void getinfo() {
  char *result;
  zenity(15);
  send("info 2");
  get();
  zenity(30);
  result = parseHTCBlock();
  if (strlen(result) != 0)
    printf("[] CID: %s\n", result);
  zenity(50);
  send("getdevinfo");
  get();
  zenity(75);
  result = parseHTCBlock();
  if (strlen(result) != 0)
    printf("[] ModelID: %s\n", result);
  else {
    authBL();
    fsend("getdevinfo");
    get();
    result = parseHTCBlock();
    zenity(85);
    if (strlen(result) != 0)
      printf("[] ModelID: %s\n", result);
    else
      printf("[!!] Your device can't be identified!\n");
    fsend("ruurun 0");
    fsend("ruurun 0");
    get();
    fsend("ResetDevice");
    fsend("ResetDevice");
    get();
  }
  zenity(100);
}


x86 assembly (clang, -O0):
<getinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
call   1070 <zenity@plt>
lea    0xe67(%rip),%rdi
call   1040 <send@plt>
mov    $0x0,%al
call   1090 <get@plt>
mov    $0x1e,%edi
call   1070 <zenity@plt>
mov    $0x0,%al
call   1060 <parseHTCBlock@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     11df <getinfo+0x5f>
mov    -0x8(%rbp),%rsi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x32,%edi
call   1070 <zenity@plt>
lea    0xe23(%rip),%rdi
call   1040 <send@plt>
mov    $0x0,%al
call   1090 <get@plt>
mov    $0x4b,%edi
call   1070 <zenity@plt>
mov    $0x0,%al
call   1060 <parseHTCBlock@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     123b <getinfo+0xbb>
mov    -0x8(%rbp),%rsi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12e0 <getinfo+0x160>
mov    $0x0,%al
call   10a0 <authBL@plt>
lea    0xdca(%rip),%rdi
call   1080 <fsend@plt>
mov    $0x0,%al
call   1090 <get@plt>
mov    $0x0,%al
call   1060 <parseHTCBlock@plt>
mov    %rax,-0x8(%rbp)
mov    $0x55,%edi
call   1070 <zenity@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1294 <getinfo+0x114>
mov    -0x8(%rbp),%rsi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12a2 <getinfo+0x122>
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdac(%rip),%rdi
call   1080 <fsend@plt>
lea    0xda0(%rip),%rdi
call   1080 <fsend@plt>
mov    $0x0,%al
call   1090 <get@plt>
lea    0xd96(%rip),%rdi
call   1080 <fsend@plt>
lea    0xd8a(%rip),%rdi
call   1080 <fsend@plt>
mov    $0x0,%al
call   1090 <get@plt>
mov    $0x64,%edi
call   1070 <zenity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getinfo>:
push   %rbx
mov    $0xf,%edi
call   1070 <zenity@plt>
lea    0xe6e(%rip),%rdi
call   1040 <send@plt>
xor    %eax,%eax
call   1090 <get@plt>
mov    $0x1e,%edi
call   1070 <zenity@plt>
xor    %eax,%eax
call   1060 <parseHTCBlock@plt>
cmpb   $0x0,(%rax)
je     11c5 <getinfo+0x45>
lea    0xe4c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x32,%edi
call   1070 <zenity@plt>
lea    0xe3d(%rip),%rdi
call   1040 <send@plt>
xor    %eax,%eax
call   1090 <get@plt>
mov    $0x4b,%edi
call   1070 <zenity@plt>
xor    %eax,%eax
call   1060 <parseHTCBlock@plt>
cmpb   $0x0,(%rax)
je     120e <getinfo+0x8e>
lea    0xe1f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    129c <getinfo+0x11c>
xor    %eax,%eax
call   10a0 <authBL@plt>
lea    0xdf7(%rip),%rdi
call   1080 <fsend@plt>
xor    %eax,%eax
call   1090 <get@plt>
xor    %eax,%eax
call   1060 <parseHTCBlock@plt>
mov    %rax,%rbx
mov    $0x55,%edi
call   1070 <zenity@plt>
cmpb   $0x0,(%rbx)
je     1254 <getinfo+0xd4>
lea    0xdd6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1260 <getinfo+0xe0>
lea    0xde8(%rip),%rdi
call   1030 <puts@plt>
lea    0xdc7(%rip),%rbx
mov    %rbx,%rdi
call   1080 <fsend@plt>
mov    %rbx,%rdi
call   1080 <fsend@plt>
xor    %eax,%eax
call   1090 <get@plt>
lea    0xdb2(%rip),%rbx
mov    %rbx,%rdi
call   1080 <fsend@plt>
mov    %rbx,%rdi
call   1080 <fsend@plt>
xor    %eax,%eax
call   1090 <get@plt>
mov    $0x64,%edi
pop    %rbx
jmp    1070 <zenity@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"info 2\00"
@.str.1 = [12 x i8] c"[] CID: %s\0A\00"
@.str.2 = [11 x i8] c"getdevinfo\00"
@.str.3 = [16 x i8] c"[] ModelID: %s\0A\00"
@.str.4 = [39 x i8] c"[!!] Your device can't be identified!\0A\00"
@.str.5 = [9 x i8] c"ruurun 0\00"
@.str.6 = [12 x i8] c"ResetDevice\00"
define void @getinfo() {
%1 = alloca i8*
%2 = call i32 @zenity(i32 15)
%3 = call i32 @send(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @get()
%5 = call i32 @zenity(i32 30)
%6 = call i8* (...) @parseHTCBlock()
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = call i64 @strlen(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i8*, i8** %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %0
%14 = call i32 @zenity(i32 50)
%15 = call i32 @send(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (...) @get()
%17 = call i32 @zenity(i32 75)
%18 = call i8* (...) @parseHTCBlock()
store i8* %18, i8** %1
%19 = load i8*, i8** %1
%20 = call i64 @strlen(i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = load i8*, i8** %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %23)
br label %46
25: ; preds = %13
%26 = call i32 (...) @authBL()
%27 = call i32 @fsend(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (...) @get()
%29 = call i8* (...) @parseHTCBlock()
store i8* %29, i8** %1
%30 = call i32 @zenity(i32 85)
%31 = load i8*, i8** %1
%32 = call i64 @strlen(i8* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %25
%35 = load i8*, i8** %1
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %35)
br label %39
37: ; preds = %25
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %37, %34
%40 = call i32 @fsend(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%41 = call i32 @fsend(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 (...) @get()
%43 = call i32 @fsend(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 @fsend(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%45 = call i32 (...) @get()
br label %46
46: ; preds = %39, %22
%47 = call i32 @zenity(i32 100)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"info 2\00"
@.str.1 = [12 x i8] c"[] CID: %s\0A\00"
@.str.2 = [11 x i8] c"getdevinfo\00"
@.str.3 = [16 x i8] c"[] ModelID: %s\0A\00"
@.str.5 = [9 x i8] c"ruurun 0\00"
@.str.6 = [12 x i8] c"ResetDevice\00"
@str = [38 x i8] c"[!!] Your device can't be identified!\00"
define void @getinfo() {
%1 = tail call i32 @zenity(i32 15)
%2 = tail call i32 @send(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @get()
%4 = tail call i32 @zenity(i32 30)
%5 = tail call i8* (...) @parseHTCBlock()
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %10
10: ; preds = %8, %0
%11 = tail call i32 @zenity(i32 50)
%12 = tail call i32 @send(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 (...) @get()
%14 = tail call i32 @zenity(i32 75)
%15 = tail call i8* (...) @parseHTCBlock()
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %10
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %15)
br label %39
20: ; preds = %10
%21 = tail call i32 (...) @authBL()
%22 = tail call i32 @fsend(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i32 (...) @get()
%24 = tail call i8* (...) @parseHTCBlock()
%25 = tail call i32 @zenity(i32 85)
%26 = load i8, i8* %24
%27 = icmp eq i8 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %20
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %24)
br label %32
30: ; preds = %20
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
%33 = tail call i32 @fsend(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%34 = tail call i32 @fsend(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%35 = tail call i32 (...) @get()
%36 = tail call i32 @fsend(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%37 = tail call i32 @fsend(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%38 = tail call i32 (...) @get()
br label %39
39: ; preds = %32, %18
%40 = tail call i32 @zenity(i32 100)
ret void
}