int main(int argc, char **argv) {
  char str1[30] = "hwe";
  char str2[30] = "hwer";
  const char jpg[15] = "jpg";
  const char png[15] = "png";
  char *answer1;
  char *answer2;
  strcpy(str1, argv[argc - 1]);
  strcpy(str2, str1);
  answer1 = strstr(str1, jpg);
  answer2 = strstr(str2, png);
  if (answer1 && *answer1 || answer2 && *answer2)
    printf("??%s, %d\n", answer1, answer1);
  else
    abort();
  printf("still runngin\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe98(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe83(%rip),%eax
mov    %eax,-0x38(%rbp)
mov    0xe7d(%rip),%ax
mov    %ax,-0x34(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x5f(%rbp)
mov    0xe72(%rip),%eax
mov    %eax,-0x57(%rbp)
mov    0xe6c(%rip),%ax
mov    %ax,-0x53(%rbp)
mov    0xe64(%rip),%al
mov    %al,-0x51(%rbp)
mov    0xe5b(%rip),%rax
mov    %rax,-0x6e(%rbp)
mov    0xe59(%rip),%eax
mov    %eax,-0x66(%rbp)
mov    0xe53(%rip),%ax
mov    %ax,-0x62(%rbp)
mov    0xe4b(%rip),%al
mov    %al,-0x60(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x5f(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x78(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x6e(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x78(%rbp)
je     1277 <main+0x137>
mov    -0x78(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1292 <main+0x152>
cmpq   $0x0,-0x80(%rbp)
je     12ad <main+0x16d>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12ad <main+0x16d>
mov    -0x78(%rbp),%rsi
mov    -0x78(%rbp),%rdx
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12b2 <main+0x172>
call   1030 <abort@plt>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movups 0xeb0(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xeb8(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,(%rsp)
movslq %edi,%rax
mov    -0x8(%rsi,%rax,8),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
mov    %rax,%rbx
lea    0xe8b(%rip),%rsi
mov    %r14,%rdi
call   1070 <strstr@plt>
test   %rbx,%rbx
je     11d4 <main+0x84>
cmpb   $0x0,(%rbx)
jne    11de <main+0x8e>
test   %rax,%rax
je     1208 <main+0xb8>
cmpb   $0x0,(%rax)
je     1208 <main+0xb8>
lea    0xe77(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe6d(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.str1 = [30 x i8] c"hwe\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str2 = [30 x i8] c"hwer\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.jpg = [15 x i8] c"jpg\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.png = [15 x i8] c"png\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [10 x i8] c"??%s, %d\0A\00"
@.str.1 = [15 x i8] c"still runngin\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [30 x i8]
%7 = alloca [30 x i8]
%8 = alloca [15 x i8]
%9 = alloca [15 x i8]
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [30 x i8]* %6 to i8*
%13 = bitcast [30 x i8]* %7 to i8*
%14 = bitcast [15 x i8]* %8 to i8*
%15 = bitcast [15 x i8]* %9 to i8*
%16 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%17 = load i8**, i8*** %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %17, i64 %20
%22 = load i8*, i8** %21
%23 = call i8* @strcpy(i8* %16, i8* %22)
%24 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%26 = call i8* @strcpy(i8* %24, i8* %25)
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%28 = getelementptr inbounds [15 x i8], [15 x i8]* %8, i64 0, i64 0
%29 = call i8* @strstr(i8* %27, i8* %28)
store i8* %29, i8** %10
%30 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%31 = getelementptr inbounds [15 x i8], [15 x i8]* %9, i64 0, i64 0
%32 = call i8* @strstr(i8* %30, i8* %31)
store i8* %32, i8** %11
%33 = load i8*, i8** %10
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %40
35: ; preds = %2
%36 = load i8*, i8** %10
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 0
br i1 %39, label %48, label %40
40: ; preds = %35, %2
%41 = load i8*, i8** %11
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %52
43: ; preds = %40
%44 = load i8*, i8** %11
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %43, %35
%49 = load i8*, i8** %10
%50 = load i8*, i8** %10
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %49, i8* %50)
br label %53
52: ; preds = %43, %40
unreachable
53: ; preds = %48
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [30 x i8] c"hwe\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.str2 = [30 x i8] c"hwer\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.jpg = [15 x i8] c"jpg\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.png = [15 x i8] c"png\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [10 x i8] c"??%s, %d\0A\00"
@str = [14 x i8] c"still runngin\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%7 = add nsw i32 %0, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = call i8* @strcpy(i8* %5, i8* dereferenceable(1) %10)
%12 = call i8* @strcpy(i8* %6, i8* %5)
%13 = call i8* @strstr(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @__const.main.jpg, i64 0, i64 0))
%14 = call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @__const.main.png, i64 0, i64 0))
%15 = icmp eq i8* %13, null
br i1 %15, label %19, label %16
16: ; preds = %2
%17 = load i8, i8* %13
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16, %2
%20 = icmp eq i8* %14, null
br i1 %20, label %27, label %21
21: ; preds = %19
%22 = load i8, i8* %14
%23 = icmp eq i8 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21, %16
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %13)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
27: ; preds = %21, %19
unreachable
}