int string_cmp() {
  printf("----- START %s\n", __FUNCTION__);
  char str[] = "ciao", str1[] = "ciao";
  printf((str == str1) ? "Day" : "Night");
  printf("\n");
  printf("** look at %s:%d **\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/reslaurentii/sandbox/refs/heads/master/src/"
         "printf_jokes.c",
         62);
  printf("----- END %s\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xee8(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xee3(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xed6(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x6(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x3e,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_cmp>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xee1(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec9(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x3e,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf58(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"----- START %s\0A\00"
@__FUNCTION__.string_cmp = [11 x i8] c"string_cmp\00"
@__const.string_cmp.str = [5 x i8] c"ciao\00"
@__const.string_cmp.str1 = [5 x i8] c"ciao\00"
@.str.1 = [6 x i8] c"Night\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [21 x i8] c"** look at %s:%d **\0A\00"
@.str.4 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/reslaurentii/sandbox/refs/heads/master/src/printf_jokes.c\00"
@.str.5 = [14 x i8] c"----- END %s\0A\00"
define i32 @string_cmp() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.string_cmp, i64 0, i64 0))
%4 = bitcast [5 x i8]* %1 to i8*
%5 = bitcast [5 x i8]* %2 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 62)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.string_cmp, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"----- START %s\0A\00"
@__FUNCTION__.string_cmp = [11 x i8] c"string_cmp\00"
@.str.1 = [6 x i8] c"Night\00"
@.str.3 = [21 x i8] c"** look at %s:%d **\0A\00"
@.str.4 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/reslaurentii/sandbox/refs/heads/master/src/printf_jokes.c\00"
@.str.5 = [14 x i8] c"----- END %s\0A\00"
define i32 @string_cmp() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.string_cmp, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 62)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.string_cmp, i64 0, i64 0))
ret i32 0
}