xunge/DecIR huggingface dataset:
/* Variables and functions */
long LONG_MAX;
long LONG_MIN;
scalar_t__ errno;
long strtol(char *, int /*<<< orphan*/ *, int);
__attribute__((unused)) long cvt(char *str) {
  long ret;
  errno = 0;
  ret = strtol(str, NULL, 10);
  if ((ret == LONG_MAX || ret == LONG_MIN) && errno)
    ret = -1;
  return ret;
}


x86 assembly (clang, -O0):
<cvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
je     1168 <cvt+0x58>
mov    -0x10(%rbp),%rax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    1181 <cvt+0x71>
mov    0x2e61(%rip),%rax
cmpq   $0x0,(%rax)
je     1181 <cvt+0x71>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt>:
push   %rbx
mov    0x2eb8(%rip),%rbx
movq   $0x0,(%rbx)
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     1143 <cvt+0x33>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
jne    1150 <cvt+0x40>
cmpq   $0x0,(%rbx)
je     1150 <cvt+0x40>
mov    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@LONG_MAX = global i64 0
@LONG_MIN = global i64 0
define i64 @cvt(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* @errno
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* @LONG_MAX
%8 = icmp eq i64 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i64, i64* %3
%11 = load i64, i64* @LONG_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9, %1
%14 = load i64, i64* @errno
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i64 -1, i64* %3
br label %17
17: ; preds = %16, %13, %9
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
@errno = global i64 0
@LONG_MAX = global i64 0
@LONG_MIN = global i64 0
define i64 @cvt(i8* nocapture %0) {
store i64 0, i64* @errno
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @LONG_MAX
%4 = icmp eq i64 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i64, i64* @LONG_MIN
%7 = icmp eq i64 %2, %6
%8 = load i64, i64* @errno
%9 = icmp ne i64 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %14, label %15
11: ; preds = %1
%12 = load i64, i64* @errno
%13 = icmp eq i64 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %5, %11
br label %15
15: ; preds = %14, %11, %5
%16 = phi i64 [ -1, %14 ], [ %2, %11 ], [ %2, %5 ]
ret i64 %16
}
void CFGMR3QueryGCPtr(void) {}


x86 assembly (clang, -O0):
<CFGMR3QueryGCPtr>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CFGMR3QueryGCPtr>:
ret

LLVM IR (-O0):
define void @CFGMR3QueryGCPtr() {
ret void
}

LLVM IR (-O2):
define void @CFGMR3QueryGCPtr() {
ret void
}
int f(int a, int b, int c, _Bool d, _Bool e, _Bool f, char g) {
  if (g != 1 || d != 1 || e != 1 || f != 1)
    abort();
  return a + b + c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x20(%rbp)
mov    %ecx,%eax
mov    -0x20(%rbp),%ecx
mov    %eax,-0x1c(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
mov    %eax,-0x18(%rbp)
mov    %esi,%eax
mov    -0x18(%rbp),%esi
mov    %eax,-0x14(%rbp)
mov    %edi,%r8d
mov    -0x14(%rbp),%edi
mov    %r9b,%al
mov    0x10(%rbp),%r9b
mov    %r8d,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
and    $0x1,%dl
mov    %dl,-0xd(%rbp)
and    $0x1,%cl
mov    %cl,-0xe(%rbp)
and    $0x1,%al
mov    %al,-0xf(%rbp)
movsbl 0x10(%rbp),%eax
cmp    $0x1,%eax
jne    119c <f+0x8c>
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    119c <f+0x8c>
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    119c <f+0x8c>
mov    -0xf(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
je     11a1 <f+0x91>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
test   %ecx,%ecx
je     112e <f+0x1e>
test   %r8b,%r8b
je     112e <f+0x1e>
test   %r9b,%r9b
je     112e <f+0x1e>
cmpb   $0x1,0x10(%rsp)
jne    112e <f+0x1e>
add    %edi,%esi
add    %edx,%esi
mov    %esi,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i1 zeroext %3, i1 zeroext %4, i1 zeroext %5, i8 signext %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
%15 = zext i1 %3 to i8
store i8 %15, i8* %11
%16 = zext i1 %4 to i8
store i8 %16, i8* %12
%17 = zext i1 %5 to i8
store i8 %17, i8* %13
store i8 %6, i8* %14
%18 = load i8, i8* %14
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 1
br i1 %20, label %36, label %21
21: ; preds = %7
%22 = load i8, i8* %11
%23 = trunc i8 %22 to i1
%24 = zext i1 %23 to i32
%25 = icmp ne i32 %24, 1
br i1 %25, label %36, label %26
26: ; preds = %21
%27 = load i8, i8* %12
%28 = trunc i8 %27 to i1
%29 = zext i1 %28 to i32
%30 = icmp ne i32 %29, 1
br i1 %30, label %36, label %31
31: ; preds = %26
%32 = load i8, i8* %13
%33 = trunc i8 %32 to i1
%34 = zext i1 %33 to i32
%35 = icmp ne i32 %34, 1
br i1 %35, label %36, label %37
36: ; preds = %31, %26, %21, %7
unreachable
37: ; preds = %31
%38 = load i32, i32* %8
%39 = load i32, i32* %9
%40 = add nsw i32 %38, %39
%41 = load i32, i32* %10
%42 = add nsw i32 %40, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i1 zeroext %3, i1 zeroext %4, i1 zeroext %5, i8 signext %6) {
%8 = icmp eq i8 %6, 1
%9 = and i1 %3, %4
%10 = and i1 %9, %5
%11 = and i1 %10, %8
br i1 %11, label %13, label %12
12: ; preds = %7
tail call void @abort()
unreachable
13: ; preds = %7
%14 = add nsw i32 %1, %0
%15 = add nsw i32 %14, %2
ret i32 %15
}
const char *yaml_get_version_string(void) { return "0.1.2"; }


x86 assembly (clang, -O0):
<yaml_get_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaml_get_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.1.2\00"
define i8* @yaml_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.1.2\00"
define i8* @yaml_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int satisfyCapacity(int capacity[], int lenArr, int numPeople) {
  int index;
  for (index = 0; index < lenArr; index++)
    if (capacity[index] >= numPeople)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<satisfyCapacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <satisfyCapacity+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jl     1141 <satisfyCapacity+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <satisfyCapacity+0x5b>
jmp    1146 <satisfyCapacity+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <satisfyCapacity+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<satisfyCapacity>:
test   %esi,%esi
jle    111e <satisfyCapacity+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
jge    1121 <satisfyCapacity+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <satisfyCapacity+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @satisfyCapacity(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @satisfyCapacity(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %7, label %15
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void b(unsigned short x) {
  if (x < 0)
    return;
  if (x >= 0)
    return;
  if (0 > x)
    return;
  if (0 <= x)
    return;
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    111d <b+0x1d>
jmp    1155 <b+0x55>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     112f <b+0x2f>
jmp    1155 <b+0x55>
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jle    1142 <b+0x42>
jmp    1155 <b+0x55>
movzwl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1155 <b+0x55>
jmp    1155 <b+0x55>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
ret

LLVM IR (-O0):
define void @b(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %22
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %22
12: ; preds = %7
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = icmp sgt i32 0, %14
br i1 %15, label %16, label %17
16: ; preds = %12
br label %22
17: ; preds = %12
%18 = load i16, i16* %2
%19 = zext i16 %18 to i32
%20 = icmp sle i32 0, %19
br i1 %20, label %21, label %22
21: ; preds = %17
br label %22
22: ; preds = %6, %11, %16, %21, %17
ret void
}

LLVM IR (-O2):
define void @b(i16 zeroext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
size_t xsize_t(off_t len) { return (size_t)len; }


x86 assembly (clang, -O0):
<xsize_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsize_t>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @xsize_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @xsize_t(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}
vdiqci() {}


x86 assembly (clang, -O0):
<vdiqci>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdiqci>:
ret

LLVM IR (-O0):
define i32 @vdiqci() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdiqci() {
ret i32 undef
}
void foo(int *a) {
  int *p = a;
#pragma acc kernels pcopyin(a [0:1], p [0:1])
  {
    *a = 0;
    *p = 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %2
store i32 0, i32* %5
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
void AONIOCFreezeDisable(void) {
  (*((volatile unsigned long *)(0x40094000 + 0x0000000C))) = 0x00000001;
}


x86 assembly (clang, -O0):
<AONIOCFreezeDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4009400c,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONIOCFreezeDisable>:
movq   $0x1,0x4009400c
ret

LLVM IR (-O0):
define void @AONIOCFreezeDisable() {
store volatile i64 1, i64* inttoptr (i64 1074348044 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONIOCFreezeDisable() {
store volatile i64 1, i64* inttoptr (i64 1074348044 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ stderr;
void nalloc_default_oos(size_t size) {
  fprintf(stderr, "Nalloc, out of memroy, size %zu\n", size);
  fflush(stderr);
  abort();
  return;
}


x86 assembly (clang, -O0):
<nalloc_default_oos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<nalloc_default_oos>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Nalloc, out of memroy, size %zu\0A\00"
define void @nalloc_default_oos(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stderr
%4 = load i64, i64* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Nalloc, out of memroy, size %zu\0A\00"
define void @nalloc_default_oos(i64 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ input_moveto(int /*<<< orphan*/);
void begin_of_line(char *dummy) { input_moveto(0); }


x86 assembly (clang, -O0):
<begin_of_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <input_moveto@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_of_line>:
xor    %edi,%edi
jmp    1030 <input_moveto@plt>

LLVM IR (-O0):
define void @begin_of_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @input_moveto(i32 0)
ret void
}

LLVM IR (-O2):
define void @begin_of_line(i8* nocapture readnone %0) {
%2 = tail call i32 @input_moveto(i32 0)
ret void
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashtable_clear_with_callback(struct hashtable *,
                                                 int /*<<< orphan*/ *);
void hashtable_clear(struct hashtable *ht) {
  hashtable_clear_with_callback(ht, NULL);
}


x86 assembly (clang, -O0):
<hashtable_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <hashtable_clear_with_callback@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_clear>:
xor    %esi,%esi
jmp    1030 <hashtable_clear_with_callback@plt>

LLVM IR (-O0):
%struct.hashtable = type { i32 }
define void @hashtable_clear(%struct.hashtable* %0) {
%2 = alloca %struct.hashtable*
store %struct.hashtable* %0, %struct.hashtable** %2
%3 = load %struct.hashtable*, %struct.hashtable** %2
%4 = call i32 @hashtable_clear_with_callback(%struct.hashtable* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define void @hashtable_clear(%struct.hashtable* %0) {
%2 = tail call i32 @hashtable_clear_with_callback(%struct.hashtable* %0, i32* null)
ret void
}
int test_imm_80int8_reg(signed char val) {
  return ((val) & (-0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80int8_reg>:
test   %dil,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_80int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_80int8_reg(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GPSSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GPSSettingsLogging() { UAVObjLogging(GPSSettingsHandle()); }


x86 assembly (clang, -O0):
<GPSSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GPSSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <GPSSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @GPSSettingsLogging() {
%1 = call i32 (...) @GPSSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSettingsLogging() {
%1 = tail call i32 (...) @GPSSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void skipLine(char **in) {
  for (;;) {
    if (**in == 0)
      return;
    if (**in == '\n') {
      (*in)++;
      return;
    }
    (*in)++;
  }
}


x86 assembly (clang, -O0):
<skipLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1120 <skipLine+0x20>
jmp    1159 <skipLine+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1146 <skipLine+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1159 <skipLine+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipLine+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipLine>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1129 <skipLine+0x29>
cmp    $0xa,%cl
je     1126 <skipLine+0x26>
mov    %rax,(%rdi)
jmp    1110 <skipLine+0x10>
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @skipLine(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %20, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %24
10: ; preds = %3
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
br label %24
20: ; preds = %10
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %21
br label %3
24: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @skipLine(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %8, %1
%4 = phi i8* [ %9, %8 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %10
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %9, i8** %0
br label %3
10: ; preds = %3, %6
ret void
}
/* Type definitions */
struct parser_ctx_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PRINTFUNC();
scalar_t__ parser_condition_lvalue(struct parser_ctx_t *);
scalar_t__ parser_other_conditions(struct parser_ctx_t *);
int parser_conditions(struct parser_ctx_t *ctx) {
  PRINTFUNC();
  if (parser_condition_lvalue(ctx))
    return -1;
  if (parser_other_conditions(ctx))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<parser_conditions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <PRINTFUNC@plt>
mov    -0x10(%rbp),%rdi
call   1050 <parser_condition_lvalue@plt>
cmp    $0x0,%rax
je     1162 <parser_conditions+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <parser_conditions+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <parser_other_conditions@plt>
cmp    $0x0,%rax
je     1181 <parser_conditions+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <parser_conditions+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_conditions>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <PRINTFUNC@plt>
mov    %rbx,%rdi
call   1050 <parser_condition_lvalue@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1152 <parser_conditions+0x22>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <parser_other_conditions@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.parser_ctx_t = type { i32 }
define i32 @parser_conditions(%struct.parser_ctx_t* %0) {
%2 = alloca i32
%3 = alloca %struct.parser_ctx_t*
store %struct.parser_ctx_t* %0, %struct.parser_ctx_t** %3
%4 = call i32 (...) @PRINTFUNC()
%5 = load %struct.parser_ctx_t*, %struct.parser_ctx_t** %3
%6 = call i64 @parser_condition_lvalue(%struct.parser_ctx_t* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %15
9: ; preds = %1
%10 = load %struct.parser_ctx_t*, %struct.parser_ctx_t** %3
%11 = call i64 @parser_other_conditions(%struct.parser_ctx_t* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 -1, i32* %2
br label %15
14: ; preds = %9
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.parser_ctx_t = type { i32 }
define i32 @parser_conditions(%struct.parser_ctx_t* %0) {
%2 = tail call i32 (...) @PRINTFUNC()
%3 = tail call i64 @parser_condition_lvalue(%struct.parser_ctx_t* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i64 @parser_other_conditions(%struct.parser_ctx_t* %0)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ -1, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SO_SNDTIMEO;
int pd_socket_time_option(struct PdSocket *, int /*<<< orphan*/, int);
int pd_socket_send_timeo(struct PdSocket *sock, int time) {
  return pd_socket_time_option(sock, SO_SNDTIMEO, time);
}


x86 assembly (clang, -O0):
<pd_socket_send_timeo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <pd_socket_time_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_send_timeo>:
mov    %esi,%edx
mov    0x2ed7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <pd_socket_time_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@SO_SNDTIMEO = global i32 0
define i32 @pd_socket_send_timeo(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @SO_SNDTIMEO
%7 = load i32, i32* %4
%8 = call i32 @pd_socket_time_option(%struct.PdSocket* %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@SO_SNDTIMEO = global i32 0
define i32 @pd_socket_send_timeo(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @SO_SNDTIMEO
%4 = tail call i32 @pd_socket_time_option(%struct.PdSocket* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int readname(char *, int);
int check(char *buffer) {
  int of = 0;
  int loc;
  int rt = 0;
  of = of + 13;
  loc = readname(buffer, of);
  if (buffer[loc + 1] == 28) {
    rt = 1;
  } else {
    rt = 0;
  }
  return rt;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <readname@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1c,%eax
jne    1168 <check+0x58>
movl   $0x1,-0x14(%rbp)
jmp    116f <check+0x5f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd,%esi
call   1030 <readname@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x1c,0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 13
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = call i32 @readname(i8* %8, i32 %9)
store i32 %10, i32* %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 28
br i1 %18, label %19, label %20
19: ; preds = %1
store i32 1, i32* %5
br label %21
20: ; preds = %1
store i32 0, i32* %5
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @check(i8* %0) {
%2 = tail call i32 @readname(i8* %0, i32 13)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 28
%8 = zext i1 %7 to i32
ret i32 %8
}
int colorbits(int c) {
  switch (c) {
  default:
  case 256:
    return 8;
  case 32768:
    return 15;
  case 65536:
    return 16;
  case 256 * 65536:
    return 24;
  }
}


x86 assembly (clang, -O0):
<colorbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x100,%eax
je     115b <colorbits+0x5b>
jmp    111d <colorbits+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x8000,%eax
je     1167 <colorbits+0x67>
jmp    1130 <colorbits+0x30>
mov    -0xc(%rbp),%eax
sub    $0x10000,%eax
je     1173 <colorbits+0x73>
jmp    1143 <colorbits+0x43>
mov    -0xc(%rbp),%eax
sub    $0x1000000,%eax
je     117f <colorbits+0x7f>
jmp    1156 <colorbits+0x56>
jmp    115b <colorbits+0x5b>
movl   $0x8,-0x4(%rbp)
jmp    1186 <colorbits+0x86>
movl   $0xf,-0x4(%rbp)
jmp    1186 <colorbits+0x86>
movl   $0x10,-0x4(%rbp)
jmp    1186 <colorbits+0x86>
movl   $0x18,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorbits>:
cmp    $0x1000000,%edi
je     1123 <colorbits+0x23>
cmp    $0x10000,%edi
je     1129 <colorbits+0x29>
mov    $0x8,%eax
cmp    $0x8000,%edi
jne    1128 <colorbits+0x28>
mov    $0xf,%eax
ret
mov    $0x18,%eax
ret
mov    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @colorbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 256, label %6
i32 32768, label %7
i32 65536, label %8
i32 16777216, label %9
]
5: ; preds = %1
br label %6
6: ; preds = %1, %5
store i32 8, i32* %2
br label %10
7: ; preds = %1
store i32 15, i32* %2
br label %10
8: ; preds = %1
store i32 16, i32* %2
br label %10
9: ; preds = %1
store i32 24, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @colorbits(i32 %0) {
switch i32 %0, label %5 [
i32 16777216, label %4
i32 32768, label %2
i32 65536, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 16, %3 ], [ 15, %2 ], [ 24, %4 ], [ 8, %1 ]
ret i32 %6
}
int mysh_exit(char **args) { return 0; }


x86 assembly (clang, -O0):
<mysh_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysh_exit>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mysh_exit(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @mysh_exit(i8** nocapture readnone %0) {
ret i32 0
}
int f4(unsigned char c) {
  if (c == 0x22 || c == 0x20 || c < 0x20)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x22,%eax
je     1131 <f4+0x31>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1131 <f4+0x31>
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jge    113d <f4+0x3d>
movl   $0x2,-0x4(%rbp)
jmp    1144 <f4+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
and    $0xfd,%al
cmp    $0x20,%al
sete   %al
cmp    $0x20,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f4(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 34
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 2, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @f4(i8 zeroext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 32
%4 = icmp ult i8 %0, 32
%5 = or i1 %4, %3
%6 = select i1 %5, i32 2, i32 0
ret i32 %6
}
/* Variables and functions */
long g_load_library(char *);
long xrdp_mm_sync_load(long param1, long param2) {
  long rv;
  char *libname;
  libname = (char *)param1;
  rv = g_load_library(libname);
  return rv;
}


x86 assembly (clang, -O0):
<xrdp_mm_sync_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <g_load_library@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrdp_mm_sync_load>:
jmp    1030 <g_load_library@plt>

LLVM IR (-O0):
define i64 @xrdp_mm_sync_load(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i64 @g_load_library(i8* %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @xrdp_mm_sync_load(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i8*
%4 = tail call i64 @g_load_library(i8* %3)
ret i64 %4
}
/* Variables and functions */
int term_baud_up(int);
int baud_up(int baud) { return term_baud_up(baud); }


x86 assembly (clang, -O0):
<baud_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <term_baud_up@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_up>:
jmp    1030 <term_baud_up@plt>

LLVM IR (-O0):
define i32 @baud_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @term_baud_up(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @baud_up(i32 %0) {
%2 = tail call i32 @term_baud_up(i32 %0)
ret i32 %2
}
void strip_trailing(char *start, char **endp) {
  char *end;
  end = *endp;
  while (end > start && end[-1] == ' ')
    --end;
  *endp = end;
}


x86 assembly (clang, -O0):
<strip_trailing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jbe    113b <strip_trailing+0x3b>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114b <strip_trailing+0x4b>
jmp    115c <strip_trailing+0x5c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <strip_trailing+0x17>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_trailing>:
mov    (%rsi),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
cmp    %rdi,%rcx
jbe    1122 <strip_trailing+0x22>
lea    -0x1(%rax),%rcx
cmpb   $0x20,-0x1(%rax)
je     1110 <strip_trailing+0x10>
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @strip_trailing(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8* %7, i8** %5
br label %8
8: ; preds = %20, %2
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = icmp ugt i8* %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 -1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br label %18
18: ; preds = %12, %8
%19 = phi i1 [ false, %8 ], [ %17, %12 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 -1
store i8* %22, i8** %5
br label %8
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = load i8**, i8*** %4
store i8* %24, i8** %25
ret void
}

LLVM IR (-O2):
define void @strip_trailing(i8* readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
br label %4
4: ; preds = %7, %2
%5 = phi i8* [ %3, %2 ], [ %8, %7 ]
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %4, label %11
11: ; preds = %4, %7
store i8* %5, i8** %1
ret void
}
void lgtd_lifx_bulb_close(struct lgtd_lifx_bulb *bulb) { (void)bulb; }


x86 assembly (clang, -O0):
<lgtd_lifx_bulb_close>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgtd_lifx_bulb_close>:
ret

LLVM IR (-O0):
%struct.lgtd_lifx_bulb = type opaque
define void @lgtd_lifx_bulb_close(%struct.lgtd_lifx_bulb* %0) {
%2 = alloca %struct.lgtd_lifx_bulb*
store %struct.lgtd_lifx_bulb* %0, %struct.lgtd_lifx_bulb** %2
%3 = load %struct.lgtd_lifx_bulb*, %struct.lgtd_lifx_bulb** %2
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_bulb = type opaque
define void @lgtd_lifx_bulb_close(%struct.lgtd_lifx_bulb* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ portRead(char *, int, int);
scalar_t__ portWrite(char *);
int get_TemmaLatitude(char *local_buffer) {
  if (portWrite("i") < 0)
    return -1;
  portRead(local_buffer, -1, 1);
  if (local_buffer[0] == 'i') {
    return 0;
  } else
    return -1;
}


x86 assembly (clang, -O0):
<get_TemmaLatitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <portWrite@plt>
cmp    $0x0,%rax
jge    114e <get_TemmaLatitude+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <get_TemmaLatitude+0x64>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x69,%eax
jne    117d <get_TemmaLatitude+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1184 <get_TemmaLatitude+0x64>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_TemmaLatitude>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <portWrite@plt>
test   %rax,%rax
js     1153 <get_TemmaLatitude+0x33>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x1,%edx
call   1040 <portRead@plt>
xor    %eax,%eax
cmpb   $0x69,(%rbx)
setne  %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"i\00"
define i32 @get_TemmaLatitude(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 @portWrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %17
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @portRead(i8* %8, i32 -1, i32 1)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 105
br i1 %14, label %15, label %16
15: ; preds = %7
store i32 0, i32* %2
br label %17
16: ; preds = %7
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"i\00"
define i32 @get_TemmaLatitude(i8* %0) {
%2 = tail call i64 @portWrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @portRead(i8* %0, i32 -1, i32 1)
%6 = load i8, i8* %0
%7 = icmp ne i8 %6, 105
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ -1, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Available commands :\n\n"
         "  ./client --help\n"
         "  ./client -h\n"
         "\tdisplay this help.\n\n"
         "  ./client --list\n"
         "  ./client -l\n"
         "\tgives the list of registers functions in the server.\n\n"
         "  ./client --shutdown password\n"
         "  ./client -s password\n"
         "\tshutdown the server; by default, password is admin.\n\n"
         "  ./client --command CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\n"
         "  ./client -c CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\n"
         "\tCMD is the command name to call.\n"
         "\t-ret TYP is the return rype.\n"
         "\tTYP has to be int, str or void.\n"
         "\tif TYP is void, ARG must not be set.\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [525 x i8] c"Available commands :\0A\0A ./client --help\0A ./client -h\0A\09display this help.\0A\0A ./client --list\0A ./client -l\0A\09gives the list of registers functions in the server.\0A\0A ./client --shutdown password\0A ./client -s password\0A\09shutdown the server; by default, password is admin.\0A\0A ./client --command CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\0A ./client -c CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\0A\09CMD is the command name to call.\0A\09-ret TYP is the return rype.\0A\09TYP has to be int, str or void.\0A\09if TYP is void, ARG must not be set.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([525 x i8], [525 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [524 x i8] c"Available commands :\0A\0A ./client --help\0A ./client -h\0A\09display this help.\0A\0A ./client --list\0A ./client -l\0A\09gives the list of registers functions in the server.\0A\0A ./client --shutdown password\0A ./client -s password\0A\09shutdown the server; by default, password is admin.\0A\0A ./client --command CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\0A ./client -c CMD -ret -TYP [-TYP1 ARG1 ... -TYPN ARGN]\0A\09CMD is the command name to call.\0A\09-ret TYP is the return rype.\0A\09TYP has to be int, str or void.\0A\09if TYP is void, ARG must not be set.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([524 x i8], [524 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void CMN_error(char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<CMN_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<CMN_error>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @CMN_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @CMN_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int recv(int, char *, size_t, int /*<<< orphan*/);
void readSocket(int sockfd, char *buff, size_t bufflen) {
  if (recv(sockfd, buff, bufflen, 0) == -1)
    err(1, "receive failed");
}


x86 assembly (clang, -O0):
<readSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    115f <readSocket+0x3f>
mov    $0x1,%edi
lea    0xea6(%rip),%rsi
call   1040 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSocket>:
push   %rax
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     112f <readSocket+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <err@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"receive failed\00"
define void @readSocket(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @recv(i32 %7, i8* %8, i64 %9, i32 0)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"receive failed\00"
define void @readSocket(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long bad(int reg, unsigned long inWord) {
  union {
    unsigned long word;
    unsigned char byte[4];
  } data;
  data.word = inWord;
  data.byte[reg] = 0;
  return data.word;
}


x86 assembly (clang, -O0):
<bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
movb   $0x0,-0x18(%rbp,%rax,1)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad>:
mov    %rsi,-0x8(%rsp)
movslq %edi,%rax
movb   $0x0,-0x8(%rsp,%rax,1)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @bad(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca %union.anon
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = bitcast %union.anon* %5 to i64*
store i64 %6, i64* %7
%8 = bitcast %union.anon* %5 to [4 x i8]*
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 %10
store i8 0, i8* %11
%12 = bitcast %union.anon* %5 to i64*
%13 = load i64, i64* %12
ret i64 %13
}

LLVM IR (-O2):
%union.anon = type { i64 }
define i64 @bad(i32 %0, i64 %1) {
%3 = alloca %union.anon
%4 = bitcast %union.anon* %3 to i8*
%5 = getelementptr inbounds %union.anon, %union.anon* %3, i64 0, i32 0
store i64 %1, i64* %5
%6 = bitcast %union.anon* %3 to [4 x i8]*
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 %7
store i8 0, i8* %8
%9 = load i64, i64* %5
ret i64 %9
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t getPerformanceCounter() {
  struct timespec ts;
  return (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0)
             ? (int64_t)ts.tv_sec * 1000000000LL + (int64_t)ts.tv_nsec
             : -1;
}


x86 assembly (clang, -O0):
<getPerformanceCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
jne    1149 <getPerformanceCounter+0x39>
imul   $0x3b9aca00,-0x8(%rbp),%rax
3b
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <getPerformanceCounter+0x49>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <getPerformanceCounter+0x49>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPerformanceCounter>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%rcx
9a 3b
add    0x8(%rsp),%rcx
neg    %rax
sbb    %rax,%rax
or     %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i64 @getPerformanceCounter() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i64 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
br label %13
12: ; preds = %0
br label %13
13: ; preds = %12, %5
%14 = phi i64 [ %11, %5 ], [ -1, %12 ]
ret i64 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define i64 @getPerformanceCounter() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = select i1 %5, i64 %11, i64 -1
ret i64 %12
}