#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 */
char *q_internal(char *, char *, int);
char *remove_char(char *, char *);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
scalar_t__ strcmp(char *, char *);
char *substitute_char(char, char, char *);
char *system_(char *);
char *uname_m(void) {
  char *p = system_("uname -m");
  char *p2;
  p2 = remove_char("\r\n", p);
  (s_internal(p, "p",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/fukamachi/roswell/refs/heads/master/"
              "src/util.c",
              376));
  if (strcmp(p2, "i686") == 0) {
    (s_internal(p2, "p2",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/"
                "heads/master/src/util.c",
                378));
    return (q_internal("x86",
                       "/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/"
                       "roswell/refs/heads/master/src/util.c",
                       379));
  }
  if (strcmp(p2, "amd64") == 0) {
    (s_internal(p2, "p2",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/"
                "heads/master/src/util.c",
                382));
    return (q_internal("x86-64",
                       "/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/"
                       "roswell/refs/heads/master/src/util.c",
                       383));
  }
  if (strcmp(p2, "armv6l") == 0 || strcmp(p2, "rmv7l") == 0) {
    char *result =
        system_("readelf -A /proc/self/exe |grep Tag_ABI_VFP_args|wc -l");
    char *result2 = remove_char("\r\n", result);
    (s_internal(result, "result",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/"
                "heads/master/src/util.c",
                389));
    if (strcmp(result2, "0") != 0) {
      (s_internal(result2, "result2",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/"
                  "heads/master/src/util.c",
                  391));
      return (q_internal("armel",
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                         "fukamachi/roswell/refs/heads/master/src/util.c",
                         392));
    } else {
      (s_internal(result2, "result2",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/"
                  "heads/master/src/util.c",
                  394));
      return (q_internal("armhf",
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                         "fukamachi/roswell/refs/heads/master/src/util.c",
                         395));
    }
  }
  return substitute_char('-', '_', p2);
}


x86 assembly (clang, -O0):
<uname_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xe91(%rip),%rdi
call   1070 <system_@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <remove_char@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe75(%rip),%rsi
lea    0xe70(%rip),%rdx
mov    $0x178,%ecx
call   1030 <s_internal@plt>
mov    -0x18(%rbp),%rdi
lea    0xee4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ff <uname_m+0x9f>
mov    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
lea    0xe3a(%rip),%rdx
mov    $0x17a,%ecx
call   1030 <s_internal@plt>
lea    0xeba(%rip),%rdi
lea    0xe22(%rip),%rsi
mov    $0x17b,%edx
call   1080 <q_internal@plt>
mov    %rax,-0x8(%rbp)
jmp    1375 <uname_m+0x215>
mov    -0x18(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1256 <uname_m+0xf6>
mov    -0x18(%rbp),%rdi
lea    0xe78(%rip),%rsi
lea    0xde3(%rip),%rdx
mov    $0x17e,%ecx
call   1030 <s_internal@plt>
lea    0xe6d(%rip),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x17f,%edx
call   1080 <q_internal@plt>
mov    %rax,-0x8(%rbp)
jmp    1375 <uname_m+0x215>
mov    -0x18(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     128a <uname_m+0x12a>
mov    -0x18(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    135e <uname_m+0x1fe>
lea    0xe2c(%rip),%rdi
call   1070 <system_@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xd64(%rip),%rdi
call   1040 <remove_char@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe3b(%rip),%rsi
lea    0xd4e(%rip),%rdx
mov    $0x185,%ecx
call   1030 <s_internal@plt>
mov    -0x28(%rbp),%rdi
lea    0xe26(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1321 <uname_m+0x1c1>
mov    -0x28(%rbp),%rdi
lea    0xe0e(%rip),%rsi
lea    0xd18(%rip),%rdx
mov    $0x187,%ecx
call   1030 <s_internal@plt>
lea    0xdfe(%rip),%rdi
lea    0xd00(%rip),%rsi
mov    $0x188,%edx
call   1080 <q_internal@plt>
mov    %rax,-0x8(%rbp)
jmp    1375 <uname_m+0x215>
mov    -0x28(%rbp),%rdi
lea    0xdd1(%rip),%rsi
lea    0xcdb(%rip),%rdx
mov    $0x18a,%ecx
call   1030 <s_internal@plt>
lea    0xdc7(%rip),%rdi
lea    0xcc3(%rip),%rsi
mov    $0x18b,%edx
call   1080 <q_internal@plt>
mov    %rax,-0x8(%rbp)
jmp    1375 <uname_m+0x215>
mov    -0x18(%rbp),%rdx
mov    $0x2d,%edi
mov    $0x5f,%esi
call   1060 <substitute_char@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uname_m>:
push   %r14
push   %rbx
push   %rax
lea    0xe95(%rip),%rdi
call   1070 <system_@plt>
mov    %rax,%rbx
lea    0xe8f(%rip),%rdi
mov    %rax,%rsi
call   1040 <remove_char@plt>
mov    %rax,%r14
lea    0xe80(%rip),%rsi
lea    0xe7b(%rip),%rdx
mov    %rbx,%rdi
mov    $0x178,%ecx
call   1030 <s_internal@plt>
lea    0xef0(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     120d <uname_m+0xad>
lea    0xee8(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     123f <uname_m+0xdf>
lea    0xee1(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1271 <uname_m+0x111>
lea    0xed0(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1271 <uname_m+0x111>
mov    $0x2d,%edi
mov    $0x5f,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <substitute_char@plt>
lea    0xe88(%rip),%rsi
lea    0xdf3(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
mov    $0x17a,%ecx
call   1030 <s_internal@plt>
lea    0xe6d(%rip),%rdi
mov    %rbx,%rsi
mov    $0x17b,%edx
jmp    1309 <uname_m+0x1a9>
lea    0xe56(%rip),%rsi
lea    0xdc1(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
mov    $0x17e,%ecx
call   1030 <s_internal@plt>
lea    0xe45(%rip),%rdi
mov    %rbx,%rsi
mov    $0x17f,%edx
jmp    1309 <uname_m+0x1a9>
lea    0xe45(%rip),%rdi
call   1070 <system_@plt>
mov    %rax,%rbx
lea    0xd82(%rip),%rdi
mov    %rax,%rsi
call   1040 <remove_char@plt>
mov    %rax,%r14
lea    0xe5b(%rip),%rsi
lea    0xd6e(%rip),%rdx
mov    %rbx,%rdi
mov    $0x185,%ecx
call   1030 <s_internal@plt>
lea    0xe47(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
lea    0xe3a(%rip),%rsi
lea    0xd44(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rdx
test   %rax,%rax
je     12f0 <uname_m+0x190>
mov    $0x187,%ecx
call   1030 <s_internal@plt>
lea    0xe1f(%rip),%rdi
mov    %rbx,%rsi
mov    $0x188,%edx
jmp    1309 <uname_m+0x1a9>
mov    $0x18a,%ecx
call   1030 <s_internal@plt>
lea    0xe0a(%rip),%rdi
mov    %rbx,%rsi
mov    $0x18b,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <q_internal@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"uname -m\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [2 x i8] c"p\00"
@.str.3 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/heads/master/src/util.c\00"
@.str.4 = [5 x i8] c"i686\00"
@.str.5 = [3 x i8] c"p2\00"
@.str.6 = [4 x i8] c"x86\00"
@.str.7 = [6 x i8] c"amd64\00"
@.str.8 = [7 x i8] c"x86-64\00"
@.str.9 = [7 x i8] c"armv6l\00"
@.str.10 = [6 x i8] c"rmv7l\00"
@.str.11 = [55 x i8] c"readelf -A /proc/self/exe |grep Tag_ABI_VFP_args|wc -l\00"
@.str.12 = [7 x i8] c"result\00"
@.str.13 = [2 x i8] c"0\00"
@.str.14 = [8 x i8] c"result2\00"
@.str.15 = [6 x i8] c"armel\00"
@.str.16 = [6 x i8] c"armhf\00"
define i8* @uname_m() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = call i8* @system_(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @remove_char(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @s_internal(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 376)
%11 = load i8*, i8** %3
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i8*, i8** %3
%16 = call i32 @s_internal(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 378)
%17 = call i8* @q_internal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 379)
store i8* %17, i8** %1
br label %54
18: ; preds = %0
%19 = load i8*, i8** %3
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8*, i8** %3
%24 = call i32 @s_internal(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 382)
%25 = call i8* @q_internal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 383)
store i8* %25, i8** %1
br label %54
26: ; preds = %18
%27 = load i8*, i8** %3
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i8*, i8** %3
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %51
34: ; preds = %30, %26
%35 = call i8* @system_(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
store i8* %35, i8** %4
%36 = load i8*, i8** %4
%37 = call i8* @remove_char(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %36)
store i8* %37, i8** %5
%38 = load i8*, i8** %4
%39 = call i32 @s_internal(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 389)
%40 = load i8*, i8** %5
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %34
%44 = load i8*, i8** %5
%45 = call i32 @s_internal(i8* %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 391)
%46 = call i8* @q_internal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 392)
store i8* %46, i8** %1
br label %54
47: ; preds = %34
%48 = load i8*, i8** %5
%49 = call i32 @s_internal(i8* %48, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 394)
%50 = call i8* @q_internal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 395)
store i8* %50, i8** %1
br label %54
51: ; preds = %30
%52 = load i8*, i8** %3
%53 = call i8* @substitute_char(i8 signext 45, i8 signext 95, i8* %52)
store i8* %53, i8** %1
br label %54
54: ; preds = %51, %47, %43, %22, %14
%55 = load i8*, i8** %1
ret i8* %55
}

LLVM IR (-O2):
@.str = [9 x i8] c"uname -m\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [2 x i8] c"p\00"
@.str.3 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/heads/master/src/util.c\00"
@.str.4 = [5 x i8] c"i686\00"
@.str.5 = [3 x i8] c"p2\00"
@.str.6 = [4 x i8] c"x86\00"
@.str.7 = [6 x i8] c"amd64\00"
@.str.8 = [7 x i8] c"x86-64\00"
@.str.9 = [7 x i8] c"armv6l\00"
@.str.10 = [6 x i8] c"rmv7l\00"
@.str.11 = [55 x i8] c"readelf -A /proc/self/exe |grep Tag_ABI_VFP_args|wc -l\00"
@.str.12 = [7 x i8] c"result\00"
@.str.13 = [2 x i8] c"0\00"
@.str.14 = [8 x i8] c"result2\00"
@.str.15 = [6 x i8] c"armel\00"
@.str.16 = [6 x i8] c"armhf\00"
define i8* @uname_m() {
%1 = tail call i8* @system_(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @remove_char(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @s_internal(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 376)
%4 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @s_internal(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 378)
%8 = tail call i8* @q_internal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 379)
br label %35
9: ; preds = %0
%10 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 @s_internal(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 382)
%14 = tail call i8* @q_internal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 383)
br label %35
15: ; preds = %9
%16 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %18, %15
%22 = tail call i8* @system_(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0))
%23 = tail call i8* @remove_char(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = tail call i32 @s_internal(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 389)
%25 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %21
%28 = tail call i32 @s_internal(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 391)
%29 = tail call i8* @q_internal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 392)
br label %35
30: ; preds = %21
%31 = tail call i32 @s_internal(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 394)
%32 = tail call i8* @q_internal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i32 395)
br label %35
33: ; preds = %18
%34 = tail call i8* @substitute_char(i8 signext 45, i8 signext 95, i8* %2)
br label %35
35: ; preds = %27, %30, %33, %12, %6
%36 = phi i8* [ %8, %6 ], [ %14, %12 ], [ %34, %33 ], [ %29, %27 ], [ %32, %30 ]
ret i8* %36
}