#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 */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int sscanf(int /*<<< orphan*/, char *, int *, int *, int *, int *, int *, int *,
           unsigned long long *);
int check_for_filename(const struct dirent *entry) {
  int rc;
  int year, month, day, hour, minute, second;
  unsigned long long number;
  rc = sscanf(entry->d_name, "%d_%d_%d_%d_%d_%d_picture_%09llu.jpg", &year,
              &month, &day, &hour, &minute, &second, &number);

  ;
  if (rc != 7)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_for_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
lea    -0x28(%rbp),%r11
lea    -0x2c(%rbp),%r10
lea    -0x38(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <sscanf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
je     1171 <check_for_filename+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1178 <check_for_filename+0x68>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_filename>:
sub    $0x28,%rsp
mov    (%rdi),%edi
sub    $0x8,%rsp
lea    0x28(%rsp),%rax
lea    0x10(%rsp),%r10
lea    0x14(%rsp),%r11
lea    0xed0(%rip),%rsi
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
push   %rax
push   %r10
push   %r11
call   1030 <sscanf@plt>
add    $0x20,%rsp
xor    %ecx,%ecx
cmp    $0x7,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [37 x i8] c"%d_%d_%d_%d_%d_%d_picture_%09llu.jpg\00"
define i32 @check_for_filename(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
store %struct.dirent* %0, %struct.dirent** %3
%12 = load %struct.dirent*, %struct.dirent** %3
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @sscanf(i32 %14, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i64* %11)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 7
br i1 %17, label %18, label %19
18: ; preds = %1
store i32 0, i32* %2
br label %20
19: ; preds = %1
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [37 x i8] c"%d_%d_%d_%d_%d_%d_picture_%09llu.jpg\00"
define i32 @check_for_filename(%struct.dirent* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = bitcast i64* %8 to i8*
%16 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @sscanf(i32 %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i64* %8)
%19 = icmp eq i32 %18, 7
%20 = zext i1 %19 to i32
ret i32 %20
}