#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 *get_arg(int, char **, char *);
scalar_t__ get_flag(int, char **, char *);
int resume(char const *);
int do_resume(int argc, char *argv[]) {
  const char *resume_file = "";
  const char *resume_arg;
  resume_arg = get_arg(argc, argv, "resume=");
  resume_file = resume_arg ? resume_arg : resume_file;
  if (!resume_file[0])
    return 0;
  if (get_flag(argc, argv, "noresume"))
    return 0;
  return resume(resume_file);
}


x86 assembly (clang, -O0):
<do_resume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdx
call   1040 <get_arg@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1179 <do_resume+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1181 <do_resume+0x51>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11a2 <do_resume+0x72>
movl   $0x0,-0x4(%rbp)
jmp    11d7 <do_resume+0xa7>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe58(%rip),%rdx
call   1030 <get_flag@plt>
cmp    $0x0,%rax
je     11cb <do_resume+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    11d7 <do_resume+0xa7>
mov    -0x18(%rbp),%rdi
call   1050 <resume@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_resume>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xec0(%rip),%rdx
call   1040 <get_arg@plt>
test   %rax,%rax
lea    0xeb8(%rip),%rbx
cmovne %rax,%rbx
cmpb   $0x0,(%rbx)
je     116e <do_resume+0x3e>
lea    0xea9(%rip),%rdx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <get_flag@plt>
test   %rax,%rax
je     1175 <do_resume+0x45>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <resume@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [8 x i8] c"resume=\00"
@.str.2 = [9 x i8] c"noresume\00"
define i32 @do_resume(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i8* @get_arg(i32 %8, i8** %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i8*, i8** %7
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
br label %17
17: ; preds = %15, %13
%18 = phi i8* [ %14, %13 ], [ %16, %15 ]
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %17
store i32 0, i32* %3
br label %33
24: ; preds = %17
%25 = load i32, i32* %4
%26 = load i8**, i8*** %5
%27 = call i64 @get_flag(i32 %25, i8** %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
store i32 0, i32* %3
br label %33
30: ; preds = %24
%31 = load i8*, i8** %6
%32 = call i32 @resume(i8* %31)
store i32 %32, i32* %3
br label %33
33: ; preds = %30, %29, %23
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [8 x i8] c"resume=\00"
@.str.2 = [9 x i8] c"noresume\00"
define i32 @do_resume(i32 %0, i8** %1) {
%3 = tail call i8* @get_arg(i32 %0, i8** %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = tail call i64 @get_flag(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @resume(i8* %5)
br label %13
13: ; preds = %8, %2, %11
%14 = phi i32 [ %12, %11 ], [ 0, %2 ], [ 0, %8 ]
ret i32 %14
}