#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 resist_context_t {
  int dummy;
};
struct resist_config_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ resist_config_free(struct resist_config_t *);
int /*<<< orphan*/ resist_config_init_default(struct resist_config_t **);
int /*<<< orphan*/ resist_context_free(struct resist_context_t *);
int /*<<< orphan*/ resist_context_init(struct resist_context_t **,
                                       struct resist_config_t *);
int /*<<< orphan*/ resist_context_output(struct resist_context_t *);
int resist_mini_app(int argc, char *argv[]) {
  struct resist_config_t *config;
  struct resist_context_t *context;
  resist_config_init_default(&config);
  resist_context_init(&context, config);
  resist_config_free(config);
  resist_context_output(context);
  resist_context_free(context);
  return 0;
}


x86 assembly (clang, -O0):
<resist_mini_app>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <resist_config_init_default@plt>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
call   1070 <resist_context_init@plt>
mov    -0x18(%rbp),%rdi
call   1030 <resist_config_free@plt>
mov    -0x20(%rbp),%rdi
call   1050 <resist_context_output@plt>
mov    -0x20(%rbp),%rdi
call   1060 <resist_context_free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resist_mini_app>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1040 <resist_config_init_default@plt>
mov    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdi
call   1070 <resist_context_init@plt>
mov    0x10(%rsp),%rdi
call   1030 <resist_config_free@plt>
mov    0x8(%rsp),%rdi
call   1050 <resist_context_output@plt>
mov    0x8(%rsp),%rdi
call   1060 <resist_context_free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.resist_config_t = type { i32 }
%struct.resist_context_t = type { i32 }
define i32 @resist_mini_app(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.resist_config_t*
%6 = alloca %struct.resist_context_t*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @resist_config_init_default(%struct.resist_config_t** %5)
%8 = load %struct.resist_config_t*, %struct.resist_config_t** %5
%9 = call i32 @resist_context_init(%struct.resist_context_t** %6, %struct.resist_config_t* %8)
%10 = load %struct.resist_config_t*, %struct.resist_config_t** %5
%11 = call i32 @resist_config_free(%struct.resist_config_t* %10)
%12 = load %struct.resist_context_t*, %struct.resist_context_t** %6
%13 = call i32 @resist_context_output(%struct.resist_context_t* %12)
%14 = load %struct.resist_context_t*, %struct.resist_context_t** %6
%15 = call i32 @resist_context_free(%struct.resist_context_t* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.resist_config_t = type { i32 }
%struct.resist_context_t = type { i32 }
define i32 @resist_mini_app(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.resist_config_t*
%4 = alloca %struct.resist_context_t*
%5 = bitcast %struct.resist_config_t** %3 to i8*
%6 = bitcast %struct.resist_context_t** %4 to i8*
%7 = call i32 @resist_config_init_default(%struct.resist_config_t** %3)
%8 = load %struct.resist_config_t*, %struct.resist_config_t** %3
%9 = call i32 @resist_context_init(%struct.resist_context_t** %4, %struct.resist_config_t* %8)
%10 = load %struct.resist_config_t*, %struct.resist_config_t** %3
%11 = call i32 @resist_config_free(%struct.resist_config_t* %10)
%12 = load %struct.resist_context_t*, %struct.resist_context_t** %4
%13 = call i32 @resist_context_output(%struct.resist_context_t* %12)
%14 = load %struct.resist_context_t*, %struct.resist_context_t** %4
%15 = call i32 @resist_context_free(%struct.resist_context_t* %14)
ret i32 0
}