#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo();
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int xarr[8];
  int yarr[argc];
  int x, y, *p, **q;
  p = &x;
  q = &p;
  *q = &y;
  int *ptr;
  ptr = malloc(sizeof(int));
  x = 5;
  *ptr = x;
  y = *ptr;
  if (y != x)
    return EXIT_FAILURE;
  ptr = &x;
  printf("%d", *ptr);
  ptr = &argc;
  int *ptr2 = yarr;
  foo();
  bar(argc > 2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
lea    -0x44(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
lea    -0x48(%rbp),%rcx
mov    %rcx,(%rax)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x5,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x60(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x60(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
je     11e6 <main+0xa6>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
jmp    123b <main+0xfb>
lea    -0x44(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
mov    -0x78(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,-0x70(%rbp)
mov    $0x0,%al
call   1060 <foo@plt>
cmpl   $0x2,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <bar@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1050 <malloc@plt>
lea    0xeac(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <foo@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setge  %dil
call   1030 <bar@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i32]
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32**
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %7
%19 = alloca i32, i64 %17
store i64 %17, i64* %8
store i32* %9, i32** %11
store i32** %11, i32*** %12
%20 = load i32**, i32*** %12
store i32* %10, i32** %20
%21 = call i32* @malloc(i32 4)
store i32* %21, i32** %13
store i32 5, i32* %9
%22 = load i32, i32* %9
%23 = load i32*, i32** %13
store i32 %22, i32* %23
%24 = load i32*, i32** %13
%25 = load i32, i32* %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = load i32, i32* %9
%28 = icmp ne i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %2
%30 = load i32, i32* @EXIT_FAILURE
store i32 %30, i32* %3
store i32 1, i32* %14
br label %41
31: ; preds = %2
store i32* %9, i32** %13
%32 = load i32*, i32** %13
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
store i32* %4, i32** %13
store i32* %19, i32** %15
%35 = call i32 (...) @foo()
%36 = load i32, i32* %4
%37 = icmp sgt i32 %36, 2
%38 = zext i1 %37 to i32
%39 = call i32 @bar(i32 %38)
%40 = load i32, i32* @EXIT_SUCCESS
store i32 %40, i32* %3
store i32 1, i32* %14
br label %41
41: ; preds = %31, %29
%42 = load i8*, i8** %7
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = tail call i32 (...) @foo()
%6 = icmp sgt i32 %0, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @bar(i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}