#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void url_log(char *str) {
  FILE *fp;
  char content[100] = {0};
  fp = fopen("/ailvgo/url_log", "a");
  sprintf(content, "----%s----- \n", str);
  fputs(content, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<url_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    0xe8a(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe7d(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_log>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe85(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xe81(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/ailvgo/url_log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [14 x i8] c"----%s----- \0A\00"
define void @url_log(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [100 x i8]
store i8* %0, i8** %2
%5 = bitcast [100 x i8]* %4 to i8*
%6 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %3
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = load i32*, i32** %3
%12 = call i32 @fputs(i8* %10, i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/ailvgo/url_log\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [14 x i8] c"----%s----- \0A\00"
define void @url_log(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = call i32 @fputs(i8* %3, i32* %4)
%7 = tail call i32 @fclose(i32* %4)
ret void
}