#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_search_path();
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  char buffer[4096];
  printf("***************************************\n");
  printf("HINSHISTU Manufacturing Private Limited\n");
  printf("***************************************\n");
  printf("\n");
  printf("\n");
  read_search_path();
  while (1) {
    printf("Scan or type code: ");
    memset(buffer, 0, 4096);
    scanf("%4095s", buffer);
    buffer[4095] = '\0';
    printf("\n");
    printf("\n");
    printf("%s\n", buffer);
    if (strcmp("exit", buffer) == 0) {
      return 0;
    }
    system(buffer);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <read_search_path@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1050 <memset@plt>
lea    -0x1010(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1070 <scanf@plt>
movb   $0x0,-0x11(%rbp)
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1010(%rbp),%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1010(%rbp),%rsi
lea    0xe34(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1257 <main+0xf7>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret
lea    -0x1010(%rbp),%rdi
call   1030 <system@plt>
jmp    11c6 <main+0x66>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1008,%rsp
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   10a0 <read_search_path@plt>
lea    0xe2d(%rip),%r14
mov    %rsp,%rbx
lea    0xe37(%rip),%r15
lea    0xe37(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1070 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
movb   $0x0,0xfff(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1252 <main+0xd2>
mov    %rbx,%rdi
call   1050 <system@plt>
jmp    11f0 <main+0x70>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [41 x i8] c"***************************************\0A\00"
@.str.1 = [41 x i8] c"HINSHISTU Manufacturing Private Limited\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [20 x i8] c"Scan or type code: \00"
@.str.4 = [7 x i8] c"%4095s\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [5 x i8] c"exit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4096 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (...) @read_search_path()
br label %13
13: ; preds = %2, %28
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%16 = call i32 @memset(i8* %15, i32 0, i32 4096)
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%18 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 4095
store i8 0, i8* %19
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%25 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %13
ret i32 0
28: ; preds = %13
%29 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%30 = call i32 @system(i8* %29)
br label %13
}

LLVM IR (-O2):
@.str.3 = [20 x i8] c"Scan or type code: \00"
@.str.4 = [7 x i8] c"%4095s\00"
@.str.6 = [5 x i8] c"exit\00"
@str.7 = [40 x i8] c"HINSHISTU Manufacturing Private Limited\00"
@str.8 = [40 x i8] c"***************************************\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 (...) @read_search_path()
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 4095
br label %12
12: ; preds = %22, %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @memset(i8* %4, i32 0, i32 4096)
%15 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %4)
store i8 0, i8* %11
%16 = call i32 @putchar(i32 10)
%17 = call i32 @putchar(i32 10)
%18 = call i32 @puts(i8* %4)
%19 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %12
ret i32 0
22: ; preds = %12
%23 = call i32 @system(i8* %4)
br label %12
}