#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*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
int wCustomLog(char *in, char *out) {
  char *q, *p;
  int pin;
  p = strstr(in, ":");
  p++;
  sscanf(p, "%d", &pin);
  p = strstr(p, "\"");
  p++;
  q = strstr(p, "\"");
  strcpy(q, "\0");
  strcpy(out, p);
  return (pin);
}


x86 assembly (clang, -O0):
<wCustomLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe97(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wCustomLog>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0x3a,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rbx
lea    0xeb4(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
lea    0xe85(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [2 x i8] zeroinitializer
define i32 @wCustomLog(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @strstr(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%14 = load i8*, i8** %6
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = call i8* @strstr(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%22 = load i8*, i8** %4
%23 = load i8*, i8** %6
%24 = call i32 @strcpy(i8* %22, i8* %23)
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] zeroinitializer
define i32 @wCustomLog(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = call i8* @strchr(i8* %6, i32 34)
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = call i8* @strchr(i8* %9, i32 34)
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @strcpy(i8* %1, i8* %9)
%13 = load i32, i32* %3
ret i32 %13
}