#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 /*<<< orphan*/ err(scalar_t__, int /*<<< orphan*/ *);
scalar_t__ errno;
int /*<<< orphan*/ errx(int, char *);
scalar_t__ xipm_symlink(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    errx(1, "path arguments required");
  }
  errno = xipm_symlink(argv[1], argv[2]);
  if (errno)
    err(errno, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1161 <main+0x31>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <xipm_symlink@plt>
mov    %rax,%rcx
mov    0x2e60(%rip),%rax
mov    %rcx,(%rax)
mov    0x2e56(%rip),%rax
cmpq   $0x0,(%rax)
je     11a7 <main+0x77>
mov    0x2e45(%rip),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     114a <main+0x1a>
lea    0xec0(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <xipm_symlink@plt>
mov    0x2e82(%rip),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     1170 <main+0x40>
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <err@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"path arguments required\00"
@errno = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @xipm_symlink(i8* %13, i8* %16)
store i64 %17, i64* @errno
%18 = load i64, i64* @errno
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %10
%21 = load i64, i64* @errno
%22 = call i32 @err(i64 %21, i32* null)
br label %23
23: ; preds = %20, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"path arguments required\00"
@errno = global i64 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @xipm_symlink(i8* %8, i8* %10)
store i64 %11, i64* @errno
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %6
%14 = tail call i32 @err(i64 %11, i32* null)
br label %15
15: ; preds = %13, %6
ret i32 0
}