#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 */
int function_with_param(int, long, char);
int function_with_variable(int, char **);
int main(int argc, char **argv) {
  int a = 50;
  long data = 0xABCD;
  char id = 'a';
  int ret = 0;
  ret = function_with_param(a, data, id);
  if (ret)
    return 1;
  ret = function_with_variable(argc, argv);
  if (ret)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x32,-0x14(%rbp)
movq   $0xabcd,-0x20(%rbp)
movb   $0x61,-0x21(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
movsbl -0x21(%rbp),%edx
call   1040 <function_with_param@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1179 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <main+0x85>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <function_with_variable@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     119e <main+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <main+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xabcd,%esi
mov    $0x32,%edi
mov    $0x61,%edx
call   1040 <function_with_param@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    115a <main+0x3a>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <function_with_variable@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 50, i32* %6
store i64 43981, i64* %7
store i8 97, i8* %8
store i32 0, i32* %9
%10 = load i32, i32* %6
%11 = load i64, i64* %7
%12 = load i8, i8* %8
%13 = call i32 @function_with_param(i32 %10, i64 %11, i8 signext %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %25
17: ; preds = %2
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @function_with_variable(i32 %18, i8** %19)
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %3
br label %25
24: ; preds = %17
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23, %16
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @function_with_param(i32 50, i64 43981, i8 signext 97)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @function_with_variable(i32 %0, i8** %1)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}