int main(int argc, char **argv) {
  char servip[1024];
  char read_buf[1024];
  char write_buf[1024];
  char m_ip[128];
  int m_fd;
  unsigned int m_port;
  int i0 = 0;
  if (argc < 2) {
    printf("--<%s:%d>--<%s>--"
           "Using: ./client <IP Address>"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/"
           "master/network_utils/usb_hid_ir_service/demo_client.c",
           63, __FUNCTION__);
    return -1;
  }
  memset(servip, 0x0, sizeof(servip));
  printf("--<%s:%d>--<%s>--"
         "get arg: %s"
         "--\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/"
         "master/network_utils/usb_hid_ir_service/demo_client.c",
         68, __FUNCTION__, argv[0], argv[1]);
  sprintf(servip, "%s", argv[1]);
  sprintf(m_ip, "%s", servip);
  m_port = 10240;
  connect_server(m_ip, m_port, &m_fd);
  if (m_fd < 0)
    return m_fd;
  printf("--<%s:%d>--<%s>--"
         "Create write/read data thread"
         "--\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/"
         "master/network_utils/usb_hid_ir_service/demo_client.c",
         78, __FUNCTION__);
  usleep(100000);
  while (1) {
    memset(read_buf, 0x0, sizeof(read_buf));
    memset(write_buf, 0x0, sizeof(write_buf));
    sprintf(write_buf, "%s-%d", __FUNCTION__, i0);
    printf("--<%s:%d>--<%s>--"
           "writing %s"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/"
           "master/network_utils/usb_hid_ir_service/demo_client.c",
           86, __FUNCTION__, write_buf);
    write(m_fd, write_buf, strlen(write_buf));
    read(m_fd, read_buf, sizeof(read_buf));
    printf("--<%s:%d>--<%s>--"
           "get resule: %s"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/"
           "master/network_utils/usb_hid_ir_service/demo_client.c",
           89, __FUNCTION__, read_buf);
    i0++;
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xcb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xc9c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11ea <main+0x5a>
lea    0xe3c(%rip),%rdi
lea    0xe66(%rip),%rsi
mov    $0x3f,%edx
lea    0xf12(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e7 <main+0x257>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r9
lea    0xedb(%rip),%rdi
lea    0xe17(%rip),%rsi
mov    $0x44,%edx
lea    0xec3(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0xc90(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
movl   $0x2800,-0xc98(%rbp)
lea    -0xc90(%rbp),%rdi
mov    -0xc98(%rbp),%esi
lea    -0xc94(%rbp),%rdx
mov    $0x0,%al
call   1040 <connect_server@plt>
cmpl   $0x0,-0xc94(%rbp)
jge    12a6 <main+0x116>
mov    -0xc94(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    13e7 <main+0x257>
lea    0xe64(%rip),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x4e,%edx
lea    0xe29(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x186a0,%edi
mov    $0x0,%al
call   10b0 <usleep@plt>
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
lea    -0xc10(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
lea    -0xc10(%rbp),%rdi
mov    -0xc9c(%rbp),%ecx
lea    0xe36(%rip),%rsi
lea    0xdd5(%rip),%rdx
mov    $0x0,%al
call   1090 <sprintf@plt>
lea    -0xc10(%rbp),%r8
lea    0xe20(%rip),%rdi
lea    0xd01(%rip),%rsi
mov    $0x56,%edx
lea    0xdad(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc94(%rbp),%eax
mov    %eax,-0xcac(%rbp)
lea    -0xc10(%rbp),%rax
mov    %rax,-0xca8(%rbp)
lea    -0xc10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xcac(%rbp),%edi
mov    -0xca8(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0xc94(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1080 <read@plt>
lea    -0x810(%rbp),%r8
lea    0xdc1(%rip),%rdi
lea    0xc83(%rip),%rsi
mov    $0x59,%edx
lea    0xd2f(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xca0(%rbp)
mov    %eax,-0xc9c(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   10a0 <sleep@plt>
jmp    12d3 <main+0x143>
mov    -0x4(%rbp),%eax
add    $0xcb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc98,%rsp
cmp    $0x1,%edi
jg     11e1 <main+0x41>
lea    0xe43(%rip),%rdi
lea    0xe6d(%rip),%rsi
lea    0xf1e(%rip),%rcx
mov    $0x3f,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffff,%eax
jmp    1360 <main+0x1c0>
mov    %rsi,%rbp
lea    0x890(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x0(%rbp),%r8
mov    0x8(%rbp),%r9
lea    0xee4(%rip),%rdi
lea    0xe20(%rip),%rsi
lea    0xed1(%rip),%rcx
mov    $0x44,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rbp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    $0x2800,%esi
xor    %eax,%eax
call   1050 <connect_server@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     1360 <main+0x1c0>
lea    0xea7(%rip),%rdi
lea    0xdc3(%rip),%r14
lea    0xe74(%rip),%r15
mov    %r14,%rsi
mov    $0x4e,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x186a0,%edi
xor    %eax,%eax
call   10c0 <usleep@plt>
lea    0x490(%rsp),%r12
lea    0x90(%rsp),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %rbx,%rdi
lea    0xe68(%rip),%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   10a0 <sprintf@plt>
lea    0xe5b(%rip),%rdi
mov    %r14,%rsi
mov    $0x56,%edx
mov    %r15,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1070 <printf@plt>
mov    0xc(%rsp),%r13d
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <write@plt>
mov    0xc(%rsp),%edi
mov    $0x400,%edx
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <read@plt>
lea    0xe2e(%rip),%rdi
mov    %r14,%rsi
mov    $0x59,%edx
mov    %r15,%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebp
mov    $0x1,%edi
xor    %eax,%eax
call   10b0 <sleep@plt>
jmp    12b0 <main+0x110>
add    $0xc98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"--<%s:%d>--<%s>--Using: ./client <IP Address>--\0A\00"
@.str.1 = [184 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.2 = [32 x i8] c"--<%s:%d>--<%s>--get arg: %s--\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [50 x i8] c"--<%s:%d>--<%s>--Create write/read data thread--\0A\00"
@.str.5 = [6 x i8] c"%s-%d\00"
@.str.6 = [31 x i8] c"--<%s:%d>--<%s>--writing %s--\0A\00"
@.str.7 = [35 x i8] c"--<%s:%d>--<%s>--get resule: %s--\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca [128 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
store i32 -1, i32* %3
br label %65
17: ; preds = %2
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %21, i8* %24)
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%33 = call i32 (i8*, i8*, ...) @sprintf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %32)
store i32 10240, i32* %11
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%35 = load i32, i32* %11
%36 = call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @connect_server to i32 (i8*, i32, i32*, ...)*)(i8* %34, i32 %35, i32* %10)
%37 = load i32, i32* %10
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %17
%40 = load i32, i32* %10
store i32 %40, i32* %3
br label %65
41: ; preds = %17
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
%43 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 100000)
br label %44
44: ; preds = %41, %44
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%48 = load i32, i32* %12
%49 = call i32 (i8*, i8*, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 %48)
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %50)
%52 = load i32, i32* %10
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%55 = call i64 @strlen(i8* %54)
%56 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %52, i8* %53, i64 %55)
%57 = load i32, i32* %10
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%59 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i64, ...)*)(i32 %57, i8* %58, i64 1024)
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 89, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %60)
%62 = load i32, i32* %12
%63 = add nsw i32 %62, 1
store i32 %63, i32* %12
%64 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
br label %44
65: ; preds = %39, %15
%66 = load i32, i32* %3
ret i32 %66
}

LLVM IR (-O2):
@.str = [49 x i8] c"--<%s:%d>--<%s>--Using: ./client <IP Address>--\0A\00"
@.str.1 = [184 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.2 = [32 x i8] c"--<%s:%d>--<%s>--get arg: %s--\0A\00"
@.str.4 = [50 x i8] c"--<%s:%d>--<%s>--Create write/read data thread--\0A\00"
@.str.5 = [6 x i8] c"%s-%d\00"
@.str.6 = [31 x i8] c"--<%s:%d>--<%s>--writing %s--\0A\00"
@.str.7 = [35 x i8] c"--<%s:%d>--<%s>--get resule: %s--\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [128 x i8]
%7 = alloca i32
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = bitcast i32* %7 to i8*
%13 = icmp slt i32 %0, 2
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
br label %42
16: ; preds = %2
%17 = load i8*, i8** %1
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %17, i8* %19)
%21 = load i8*, i8** %18
%22 = call i8* @strcpy(i8* %8, i8* dereferenceable(1) %21)
%23 = call i8* @strcpy(i8* %11, i8* %8)
%24 = call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @connect_server to i32 (i8*, i32, i32*, ...)*)(i8* %11, i32 10240, i32* %7)
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 0
br i1 %26, label %42, label %27
27: ; preds = %16
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
%29 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 100000)
br label %30
30: ; preds = %30, %27
%31 = phi i32 [ 0, %27 ], [ %40, %30 ]
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %10)
%34 = load i32, i32* %7
%35 = call i64 @strlen(i8* %10)
%36 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %34, i8* %10, i64 %35)
%37 = load i32, i32* %7
%38 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i64, ...)*)(i32 %37, i8* %9, i64 1024)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i32 89, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* %9)
%40 = add nuw nsw i32 %31, 1
%41 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
br label %30
42: ; preds = %16, %14
%43 = phi i32 [ -1, %14 ], [ %25, %16 ]
ret i32 %43
}