#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
scalar_t__ validate_license(char *, char *, char *);
int main() {
  if (validate_license("resources/license-good.txt",
                       "resources/license-good-sig.b64",
                       "resources/dsip-uuid.txt")) {
    printf("license-good.txt:	valid\n");
  } else {
    printf("license-good.txt:	invalid\n");
  }
  if (validate_license("resources/license-bad.txt",
                       "resources/license-bad-sig.b64",
                       "resources/dsip-uuid.txt")) {
    printf("license-bad.txt:	valid\n");
  } else {
    printf("license-bad.txt:	invalid\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0xef6(%rip),%rdx
call   1040 <validate_license@plt>
cmp    $0x0,%rax
je     1164 <main+0x44>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
lea    0xf22(%rip),%rsi
lea    0xeb5(%rip),%rdx
call   1040 <validate_license@plt>
cmp    $0x0,%rax
je     11a5 <main+0x85>
lea    0xf23(%rip),%rdi
call   1030 <printf@plt>
jmp    11b1 <main+0x91>
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xf04(%rip),%rbx
mov    %rbx,%rdx
call   1040 <validate_license@plt>
test   %rax,%rax
lea    0xf42(%rip),%rax
lea    0xf85(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
lea    0xf06(%rip),%rsi
mov    %rbx,%rdx
call   1040 <validate_license@plt>
test   %rax,%rax
lea    0xf2c(%rip),%rax
lea    0xf3e(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"resources/license-good.txt\00"
@.str.1 = [31 x i8] c"resources/license-good-sig.b64\00"
@.str.2 = [24 x i8] c"resources/dsip-uuid.txt\00"
@.str.3 = [25 x i8] c"license-good.txt:\09valid\0A\00"
@.str.4 = [27 x i8] c"license-good.txt:\09invalid\0A\00"
@.str.5 = [26 x i8] c"resources/license-bad.txt\00"
@.str.6 = [30 x i8] c"resources/license-bad-sig.b64\00"
@.str.7 = [24 x i8] c"license-bad.txt:\09valid\0A\00"
@.str.8 = [26 x i8] c"license-bad.txt:\09invalid\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @validate_license(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = call i64 @validate_license(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [27 x i8] c"resources/license-good.txt\00"
@.str.1 = [31 x i8] c"resources/license-good-sig.b64\00"
@.str.2 = [24 x i8] c"resources/dsip-uuid.txt\00"
@.str.5 = [26 x i8] c"resources/license-bad.txt\00"
@.str.6 = [30 x i8] c"resources/license-bad-sig.b64\00"
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"license-good.txt:\09invalid\00"
@str.9 = [25 x i8] c"license-bad.txt:\09invalid\00"
@str.10 = [23 x i8] c"license-bad.txt:\09valid\00"
@str.11 = [24 x i8] c"license-good.txt:\09valid\00"
define i32 @main() {
%1 = tail call i64 @validate_license(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.11, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i64 @validate_license(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}