#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 */
char *flon_lookup_exid(char *);
int /*<<< orphan*/ flon_pp_execution(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int scope(char **args) {
  char *exid = flon_lookup_exid(args[1]);
  printf("-----------------------------------------------------------------\n");
  printf("fragment  >%s<\n", args[1]);
  printf("exid      >%s<\n", exid);
  printf("--------------------------------------------------- flon scope --\n");
  if (exid == NULL) {
    fprintf(stderr, "\n ** no execution matching >%s< **\n\n", args[1]);
    return 1;
  }
  flon_pp_execution(exid);
  return 0;
}


x86 assembly (clang, -O0):
<scope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <flon_lookup_exid@plt>
mov    %rax,-0x18(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
jne    11d5 <scope+0x95>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xee2(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e5 <scope+0xa5>
mov    -0x18(%rbp),%rdi
call   1060 <flon_pp_execution@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scope>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x8(%rdi),%rdi
call   1060 <flon_lookup_exid@plt>
mov    %rax,%rbx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%r14),%rsi
lea    0xe86(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     11af <scope+0x5f>
mov    %rbx,%rdi
call   1070 <flon_pp_execution@plt>
jmp    11cd <scope+0x7d>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r14),%rdx
lea    0xe5d(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [67 x i8] c"-----------------------------------------------------------------\0A\00"
@.str.1 = [16 x i8] c"fragment >%s<\0A\00"
@.str.2 = [16 x i8] c"exid >%s<\0A\00"
@.str.3 = [67 x i8] c"--------------------------------------------------- flon scope --\0A\00"
@stderr = global i32 0
@.str.4 = [37 x i8] c"\0A ** no execution matching >%s< **\0A\0A\00"
define i32 @scope(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i8* @flon_lookup_exid(i8* %7)
store i8* %8, i8** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
%17 = load i8*, i8** %4
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %25
19: ; preds = %1
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %3
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %23)
store i32 1, i32* %2
br label %28
25: ; preds = %1
%26 = load i8*, i8** %4
%27 = call i32 @flon_pp_execution(i8* %26)
store i32 0, i32* %2
br label %28
28: ; preds = %25, %19
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"fragment >%s<\0A\00"
@.str.2 = [16 x i8] c"exid >%s<\0A\00"
@stderr = global i32 0
@.str.4 = [37 x i8] c"\0A ** no execution matching >%s< **\0A\0A\00"
@str = [66 x i8] c"-----------------------------------------------------------------\00"
@str.5 = [66 x i8] c"--------------------------------------------------- flon scope --\00"
define i32 @scope(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i8* @flon_lookup_exid(i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.5, i64 0, i64 0))
%10 = icmp eq i8* %4, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %2
%14 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %13)
br label %17
15: ; preds = %1
%16 = tail call i32 @flon_pp_execution(i8* %4)
br label %17
17: ; preds = %15, %11
%18 = phi i32 [ 1, %11 ], [ 0, %15 ]
ret i32 %18
}