#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*/ fprintf(int /*<<< orphan*/, char *, char *, char *, int,
                           char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strrchr(char *, char);
int /*<<< orphan*/ writeLog(char *, char *, int);
void main(void) {
  char tmp_msg[1024];
  int i;
  fprintf(stderr, "%s[%s:%d] %s", "",
          (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                   "heads/master/example/test.c",
                   '/')
               ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/oknow23/"
                         "logAgent/refs/heads/master/example/test.c",
                         '/') +
                     1
               : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                 "heads/master/example/test.c"),
          19, "only print\n");
  fprintf(stderr, "%s[%s:%d] %s", "",
          (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                   "heads/master/example/test.c",
                   '/')
               ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/oknow23/"
                         "logAgent/refs/heads/master/example/test.c",
                         '/') +
                     1
               : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                 "heads/master/example/test.c"),
          20, "print and write to log\n");
  writeLog("print and write to log\n",
           (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                    "heads/master/example/test.c",
                    '/')
                ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/oknow23/"
                          "logAgent/refs/heads/master/example/test.c",
                          '/') +
                      1
                : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                  "heads/master/example/test.c"),
           20);
  ;
  for (i = 0; i < 10; i++) {
    sprintf(tmp_msg, "count = %d\n", i);
    fprintf(stdout, "%s[%s:%d] %s", "",
            (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                     "heads/master/example/test.c",
                     '/')
                 ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                           "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                           "oknow23/logAgent/refs/heads/master/example/test.c",
                           '/') +
                       1
                 : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                   "heads/master/example/test.c"),
            22, tmp_msg);
    writeLog(tmp_msg,
             (strrchr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                      "heads/master/example/test.c",
                      '/')
                  ? strrchr("/scratch/repos/new/home/jordi_armengol_estape/"
                            "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                            "oknow23/logAgent/refs/heads/master/example/test.c",
                            '/') +
                        1
                  : "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/"
                    "heads/master/example/test.c"),
             22);
    ;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x408(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     1196 <main+0x56>
lea    0xe91(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x410(%rbp)
jmp    11a9 <main+0x69>
lea    0xe70(%rip),%rax
mov    %rax,-0x410(%rbp)
jmp    11a9 <main+0x69>
mov    -0x408(%rbp),%edi
mov    -0x410(%rbp),%rcx
lea    0xe43(%rip),%rsi
lea    0xf04(%rip),%rdx
mov    $0x13,%r8d
lea    0xec8(%rip),%r9
call   1050 <fprintf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x414(%rbp)
lea    0xe21(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     1221 <main+0xe1>
lea    0xe06(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x420(%rbp)
jmp    1234 <main+0xf4>
lea    0xde5(%rip),%rax
mov    %rax,-0x420(%rbp)
jmp    1234 <main+0xf4>
mov    -0x414(%rbp),%edi
mov    -0x420(%rbp),%rcx
lea    0xdb8(%rip),%rsi
lea    0xe79(%rip),%rdx
mov    $0x14,%r8d
lea    0xe49(%rip),%r9
call   1050 <fprintf@plt>
lea    0xda5(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     129d <main+0x15d>
lea    0xd8a(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x428(%rbp)
jmp    12b0 <main+0x170>
lea    0xd69(%rip),%rax
mov    %rax,-0x428(%rbp)
jmp    12b0 <main+0x170>
mov    -0x428(%rbp),%rsi
lea    0xde7(%rip),%rdi
mov    $0x14,%edx
call   1030 <writeLog@plt>
movl   $0x0,-0x404(%rbp)
cmpl   $0xa,-0x404(%rbp)
jge    140c <main+0x2cc>
lea    -0x400(%rbp),%rdi
mov    -0x404(%rbp),%edx
lea    0xdca(%rip),%rsi
call   1060 <sprintf@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x42c(%rbp)
lea    0xcff(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     1343 <main+0x203>
lea    0xce4(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
jmp    1356 <main+0x216>
lea    0xcc3(%rip),%rax
mov    %rax,-0x438(%rbp)
jmp    1356 <main+0x216>
mov    -0x42c(%rbp),%edi
mov    -0x438(%rbp),%rcx
lea    -0x400(%rbp),%r9
lea    0xc8f(%rip),%rsi
lea    0xd50(%rip),%rdx
mov    $0x16,%r8d
call   1050 <fprintf@plt>
lea    -0x400(%rbp),%rax
mov    %rax,-0x440(%rbp)
lea    0xc75(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
cmp    $0x0,%rax
je     13cd <main+0x28d>
lea    0xc5a(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x448(%rbp)
jmp    13e0 <main+0x2a0>
lea    0xc39(%rip),%rax
mov    %rax,-0x448(%rbp)
jmp    13e0 <main+0x2a0>
mov    -0x440(%rbp),%rdi
mov    -0x448(%rbp),%rsi
mov    $0x16,%edx
call   1030 <writeLog@plt>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    12d2 <main+0x192>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    0x2e98(%rip),%r14
mov    (%r14),%edi
lea    0xeae(%rip),%rbp
lea    0xf6f(%rip),%rbx
lea    0xf32(%rip),%r13
lea    0xf32(%rip),%r9
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    $0x13,%r8d
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xf20(%rip),%r14
mov    %rbp,%rsi
mov    %rbx,%r15
mov    %rbx,%rdx
mov    %r13,%rcx
mov    $0x14,%r8d
mov    %r14,%r9
call   1040 <fprintf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    $0x14,%edx
call   1030 <writeLog@plt>
xor    %ebp,%ebp
lea    0xf05(%rip),%r12
mov    %rsp,%rbx
mov    0x2e16(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    (%r14),%edi
lea    0xe19(%rip),%rsi
mov    %r15,%rdx
mov    %r13,%rcx
mov    $0x16,%r8d
mov    %rbx,%r9
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x16,%edx
call   1030 <writeLog@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    11d0 <main+0xa0>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"%s[%s:%d] %s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/heads/master/example/test.c\00"
@.str.3 = [12 x i8] c"only print\0A\00"
@.str.4 = [24 x i8] c"print and write to log\0A\00"
@.str.5 = [12 x i8] c"count = %d\0A\00"
@stdout = global i32 0
define void @main() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = load i32, i32* @stderr
%4 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%8 = getelementptr inbounds i8, i8* %7, i64 1
br label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %6
%11 = phi i8* [ %8, %6 ], [ getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), %9 ]
%12 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%18 = getelementptr inbounds i8, i8* %17, i64 1
br label %20
19: ; preds = %10
br label %20
20: ; preds = %19, %16
%21 = phi i8* [ %18, %16 ], [ getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), %19 ]
%22 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%23 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%27 = getelementptr inbounds i8, i8* %26, i64 1
br label %29
28: ; preds = %20
br label %29
29: ; preds = %28, %25
%30 = phi i8* [ %27, %25 ], [ getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), %28 ]
%31 = call i32 @writeLog(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %30, i32 20)
store i32 0, i32* %2
br label %32
32: ; preds = %60, %29
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 10
br i1 %34, label %35, label %63
35: ; preds = %32
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%37 = load i32, i32* %2
%38 = call i32 @sprintf(i8* %36, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %37)
%39 = load i32, i32* @stdout
%40 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%44 = getelementptr inbounds i8, i8* %43, i64 1
br label %46
45: ; preds = %35
br label %46
46: ; preds = %45, %42
%47 = phi i8* [ %44, %42 ], [ getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), %45 ]
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%49 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %47, i32 22, i8* %48)
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%51 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%52 = icmp ne i8* %51, null
br i1 %52, label %53, label %56
53: ; preds = %46
%54 = call i8* @strrchr(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%55 = getelementptr inbounds i8, i8* %54, i64 1
br label %57
56: ; preds = %46
br label %57
57: ; preds = %56, %53
%58 = phi i8* [ %55, %53 ], [ getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 0), %56 ]
%59 = call i32 @writeLog(i8* %50, i8* %58, i32 22)
br label %60
60: ; preds = %57
%61 = load i32, i32* %2
%62 = add nsw i32 %61, 1
store i32 %62, i32* %2
br label %32
63: ; preds = %32
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"%s[%s:%d] %s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/oknow23/logAgent/refs/heads/master/example/test.c\00"
@.str.3 = [12 x i8] c"only print\0A\00"
@.str.4 = [24 x i8] c"print and write to log\0A\00"
@.str.5 = [12 x i8] c"count = %d\0A\00"
@stdout = global i32 0
define void @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 133), i32 19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 133), i32 20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @writeLog(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 133), i32 20)
br label %8
8: ; preds = %0, %8
%9 = phi i32 [ 0, %0 ], [ %14, %8 ]
%10 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 133), i32 22, i8* %2)
%13 = call i32 @writeLog(i8* %2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.2, i64 0, i64 133), i32 22)
%14 = add nuw nsw i32 %9, 1
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %8
16: ; preds = %8
ret void
}