#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*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, int, char *);
int /*<<< orphan*/ strcmp(char *, char *);
char *strecat(char *, char *, ...);
int main(void) {
  char *r;
  r = strecat("a", NULL);
  if (!strcmp(r, "a"))
    printf("%s:%i: OK %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           19, "a");
  else
    printf("%s:%i: FAIL %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           19, r);
  free(r);
  ;
  r = strecat("a", "bbb", NULL);
  if (!strcmp(r, "abbb"))
    printf("%s:%i: OK %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           20, "abbb");
  else
    printf("%s:%i: FAIL %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           20, r);
  free(r);
  ;
  r = strecat("aa", "/", "cc", NULL);
  if (!strcmp(r, "aa/cc"))
    printf("%s:%i: OK %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           21, "aa/cc");
  else
    printf("%s:%i: FAIL %s\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/"
           "ct_strecat.c",
           21, r);
  free(r);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf56(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <strecat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xf3c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11a2 <main+0x62>
lea    0xe7b(%rip),%rdi
lea    0xe82(%rip),%rsi
mov    $0x13,%edx
lea    0xf14(%rip),%rcx
call   1050 <printf@plt>
jmp    11be <main+0x7e>
mov    -0x10(%rbp),%rcx
lea    0xee9(%rip),%rdi
lea    0xe5a(%rip),%rsi
mov    $0x13,%edx
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
lea    0xede(%rip),%rdi
lea    0xed2(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1030 <strecat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1221 <main+0xe1>
lea    0xdfc(%rip),%rdi
lea    0xe03(%rip),%rsi
mov    $0x14,%edx
lea    0xe8f(%rip),%rcx
call   1050 <printf@plt>
jmp    123d <main+0xfd>
mov    -0x10(%rbp),%rcx
lea    0xe6a(%rip),%rdi
lea    0xddb(%rip),%rsi
mov    $0x14,%edx
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
lea    0xe5e(%rip),%rdi
lea    0xe5a(%rip),%rsi
lea    0xe58(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x0,%al
call   1030 <strecat@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a7 <main+0x167>
lea    0xd76(%rip),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x15,%edx
lea    0xe13(%rip),%rcx
call   1050 <printf@plt>
jmp    12c3 <main+0x183>
mov    -0x10(%rbp),%rcx
lea    0xde4(%rip),%rdi
lea    0xd55(%rip),%rsi
mov    $0x15,%edx
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf61(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <strecat@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1181 <main+0x41>
lea    0xf26(%rip),%rdi
lea    0xe97(%rip),%rsi
mov    $0x13,%edx
mov    %rbx,%rcx
jmp    119b <main+0x5b>
lea    0xe78(%rip),%rdi
lea    0xe7f(%rip),%rsi
lea    0xf16(%rip),%rcx
mov    $0x13,%edx
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
lea    0xefd(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <strecat@plt>
mov    %rax,%rbx
lea    0xedd(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     11ed <main+0xad>
lea    0xeba(%rip),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x14,%edx
mov    %rbx,%rcx
jmp    1207 <main+0xc7>
lea    0xe0c(%rip),%rdi
lea    0xe13(%rip),%rsi
lea    0xea4(%rip),%rcx
mov    $0x14,%edx
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
lea    0xe90(%rip),%rdi
lea    0xe8c(%rip),%rsi
lea    0xe8a(%rip),%rdx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <strecat@plt>
mov    %rax,%rbx
lea    0xe74(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1260 <main+0x120>
lea    0xe47(%rip),%rdi
lea    0xdb8(%rip),%rsi
mov    $0x15,%edx
mov    %rbx,%rcx
jmp    127a <main+0x13a>
lea    0xd99(%rip),%rdi
lea    0xda0(%rip),%rsi
lea    0xe3b(%rip),%rcx
mov    $0x15,%edx
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [14 x i8] c"%s:%i: OK %s\0A\00"
@.str.2 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/ct_strecat.c\00"
@.str.3 = [16 x i8] c"%s:%i: FAIL %s\0A\00"
@.str.4 = [4 x i8] c"bbb\00"
@.str.5 = [5 x i8] c"abbb\00"
@.str.6 = [3 x i8] c"aa\00"
@.str.7 = [2 x i8] c"/\00"
@.str.8 = [3 x i8] c"cc\00"
@.str.9 = [6 x i8] c"aa/cc\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* null)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 19, i8* %10)
br label %12
12: ; preds = %9, %7
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
%15 = call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* null)
store i8* %15, i8** %2
%16 = load i8*, i8** %2
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %24
21: ; preds = %12
%22 = load i8*, i8** %2
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* %22)
br label %24
24: ; preds = %21, %19
%25 = load i8*, i8** %2
%26 = call i32 @free(i8* %25)
%27 = call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* null)
store i8* %27, i8** %2
%28 = load i8*, i8** %2
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %24
%32 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %36
33: ; preds = %24
%34 = load i8*, i8** %2
%35 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 21, i8* %34)
br label %36
36: ; preds = %33, %31
%37 = load i8*, i8** %2
%38 = call i32 @free(i8* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [14 x i8] c"%s:%i: OK %s\0A\00"
@.str.2 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/arsv/u2ps/refs/heads/master/test/ct_strecat.c\00"
@.str.3 = [16 x i8] c"%s:%i: FAIL %s\0A\00"
@.str.4 = [4 x i8] c"bbb\00"
@.str.5 = [5 x i8] c"abbb\00"
@.str.6 = [3 x i8] c"aa\00"
@.str.7 = [2 x i8] c"/\00"
@.str.8 = [3 x i8] c"cc\00"
@.str.9 = [6 x i8] c"aa/cc\00"
define i32 @main() {
%1 = tail call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 19, i8* %1)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @free(i8* %1)
%10 = tail call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* null)
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 20, i8* %10)
br label %17
17: ; preds = %15, %13
%18 = tail call i32 @free(i8* %10)
%19 = tail call i8* (i8*, i8*, ...) @strecat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* null)
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %26
24: ; preds = %17
%25 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.2, i64 0, i64 0), i32 21, i8* %19)
br label %26
26: ; preds = %24, %22
%27 = tail call i32 @free(i8* %19)
ret i32 0
}