#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 scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
char *calloc(int, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(char *);
int open(char *, int /*<<< orphan*/);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ xor_decrypt(char *, char *, int);
char *getmID(void) {
  char chr[] = {65, 31, 57, 67, 76, 91, 34, 43, 123, 19, 47, 64, 60,
                93, 42, 18, 59, 88, 95, 45, 15, 94,  92, 47, 0};
  xor_decrypt(chr, "niX1c7KITwM5OrGsX06Cjs5K", 24);
  int mid = open(chr, O_RDONLY);
  if (mid < 0)
    return NULL;
  char *id = calloc(33, 1);
  for (int i = 0; i < 33 - 1; i++) {
    ssize_t result = read(mid, id + i, 1);
    if (result < 0) {
      free(id);
      close(mid);
      return NULL;
    }
  }
  close(mid);
  return id;
}


x86 assembly (clang, -O0):
<getmID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xe91(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe89(%rip),%al
mov    %al,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x18,%edx
call   1070 <xor_decrypt@plt>
lea    -0x30(%rbp),%rdi
mov    0x2e36(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    11d3 <getmID+0x73>
movq   $0x0,-0x8(%rbp)
jmp    125f <getmID+0xff>
mov    $0x21,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x20,-0x44(%rbp)
jge    124f <getmID+0xef>
mov    -0x34(%rbp),%edi
mov    -0x40(%rbp),%rsi
movslq -0x44(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1050 <read@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jge    123c <getmID+0xdc>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%edi
call   1040 <close@plt>
movq   $0x0,-0x8(%rbp)
jmp    125f <getmID+0xff>
jmp    1241 <getmID+0xe1>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11ed <getmID+0x8d>
mov    -0x34(%rbp),%edi
call   1040 <close@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmID>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movups 0xe9a(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xe85(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe93(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x18,%edx
call   1070 <xor_decrypt@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <open@plt>
test   %eax,%eax
js     11f2 <getmID+0x92>
mov    %eax,%r14d
mov    $0x21,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%rsi
mov    %r14d,%edi
mov    $0x1,%edx
call   1050 <read@plt>
test   %rax,%rax
js     11f6 <getmID+0x96>
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    11d0 <getmID+0x70>
jmp    1200 <getmID+0xa0>
xor    %ebx,%ebx
jmp    1208 <getmID+0xa8>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %r14d,%edi
call   1040 <close@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.getmID.chr = [25 x i8] c"A\1F9CL[\22+{\13/@<]*\12;X_-\0F^\\/\00"
@.str = [25 x i8] c"niX1c7KITwM5OrGsX06Cjs5K\00"
@O_RDONLY = global i32 0
define i8* @getmID() {
%1 = alloca i8*
%2 = alloca [25 x i8]
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = bitcast [25 x i8]* %2 to i8*
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%9 = call i32 @xor_decrypt(i8* %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 24)
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* @O_RDONLY
%12 = call i32 @open(i8* %10, i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %0
store i8* null, i8** %1
br label %43
16: ; preds = %0
%17 = call i8* @calloc(i32 33, i32 1)
store i8* %17, i8** %4
store i32 0, i32* %5
br label %18
18: ; preds = %36, %16
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 32
br i1 %20, label %21, label %39
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = call i64 @read(i32 %22, i8* %26, i32 1)
store i64 %27, i64* %6
%28 = load i64, i64* %6
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %21
%31 = load i8*, i8** %4
%32 = call i32 @free(i8* %31)
%33 = load i32, i32* %3
%34 = call i32 @close(i32 %33)
store i8* null, i8** %1
br label %43
35: ; preds = %21
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %18
39: ; preds = %18
%40 = load i32, i32* %3
%41 = call i32 @close(i32 %40)
%42 = load i8*, i8** %4
store i8* %42, i8** %1
br label %43
43: ; preds = %39, %30, %15
%44 = load i8*, i8** %1
ret i8* %44
}

LLVM IR (-O2):
@__const.getmID.chr = [25 x i8] c"A\1F9CL[\22+{\13/@<]*\12;X_-\0F^\\/\00"
@.str = [25 x i8] c"niX1c7KITwM5OrGsX06Cjs5K\00"
@O_RDONLY = global i32 0
define noalias i8* @getmID() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @xor_decrypt(i8* %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 24)
%4 = load i32, i32* @O_RDONLY
%5 = call i32 @open(i8* %2, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %0
%8 = call dereferenceable_or_null(33) i8* @calloc(i32 33, i32 1)
br label %12
9: ; preds = %12
%10 = add nuw nsw i64 %13, 1
%11 = icmp eq i64 %10, 32
br i1 %11, label %19, label %12
12: ; preds = %7, %9
%13 = phi i64 [ 0, %7 ], [ %10, %9 ]
%14 = getelementptr inbounds i8, i8* %8, i64 %13
%15 = call i64 @read(i32 %5, i8* %14, i32 1)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %12
%18 = call i32 @free(i8* %8)
br label %19
19: ; preds = %9, %17
%20 = phi i8* [ null, %17 ], [ %8, %9 ]
%21 = call i32 @close(i32 %5)
br label %22
22: ; preds = %19, %0
%23 = phi i8* [ null, %0 ], [ %20, %19 ]
ret i8* %23
}