xunge/DecIR huggingface dataset:
/* Variables and functions */
double strtod(char const *, char **);
int gettype(const char *str) {
  char *ptr;
  double x;
  if (!str)
    return 0;
  x = strtod(str, &ptr);
  if (*ptr == 0)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<gettype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <gettype+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1168 <gettype+0x58>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1161 <gettype+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1168 <gettype+0x58>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettype>:
test   %rdi,%rdi
je     1132 <gettype+0x22>
push   %rax
mov    %rsp,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rax
cmpb   $0x1,(%rax)
mov    $0x2,%eax
sbb    $0x0,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @gettype(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %18
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call double @strtod(i8* %10, i8** %4)
store double %11, double* %5
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 1, i32* %2
br label %18
17: ; preds = %9
store i32 2, i32* %2
br label %18
18: ; preds = %17, %16, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @gettype(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = call double @strtod(i8* %0, i8** %2)
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i32 1, i32 2
br label %11
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
size_t count_digits(const unsigned char *const p, size_t i, const size_t len) {
  const size_t n = i;
  for (; i < len; i++) {
    const unsigned char c = p[i] - '0';
    if (c > 9)
      break;
  }
  return i - n;
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1160 <count_digits+0x60>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
cmp    $0x9,%eax
jle    114a <count_digits+0x4a>
jmp    1160 <count_digits+0x60>
jmp    114f <count_digits+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <count_digits+0x18>
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
mov    %rsi,%rax
cmp    %rdx,%rsi
jae    1128 <count_digits+0x28>
mov    %rsi,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%ecx
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1128 <count_digits+0x28>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <count_digits+0x10>
mov    %rdx,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @count_digits(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
store i64 %9, i64* %7
br label %10
10: ; preds = %27, %3
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %19, 48
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = icmp sgt i32 %23, 9
br i1 %24, label %25, label %26
25: ; preds = %14
br label %30
26: ; preds = %14
br label %27
27: ; preds = %26
%28 = load i64, i64* %5
%29 = add i64 %28, 1
store i64 %29, i64* %5
br label %10
30: ; preds = %25, %10
%31 = load i64, i64* %5
%32 = load i64, i64* %7
%33 = sub i64 %31, %32
ret i64 %33
}

LLVM IR (-O2):
define i64 @count_digits(i8* nocapture %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %1, %2
br i1 %4, label %5, label %14
5: ; preds = %3, %11
%6 = phi i64 [ %12, %11 ], [ %1, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = add i8 %8, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = add i64 %6, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %11, %5, %3
%15 = phi i64 [ %1, %3 ], [ %6, %5 ], [ %2, %11 ]
%16 = sub i64 %15, %1
ret i64 %16
}
/* Variables and functions */
unsigned int tick();
unsigned int gettick_nocache(void) { return tick(); }


x86 assembly (clang, -O0):
<gettick_nocache>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tick@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettick_nocache>:
xor    %eax,%eax
jmp    1030 <tick@plt>

LLVM IR (-O0):
define i32 @gettick_nocache() {
%1 = call i32 (...) @tick()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettick_nocache() {
%1 = tail call i32 (...) @tick()
ret i32 %1
}
int SetAdd(s, e)
char *s;
int e;
{
  int rv;
  rv = s[e];
  s[e] = 1;
  return !rv;
}


x86 assembly (clang, -O0):
<SetAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetAdd>:
movslq %esi,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rdi,%rcx,1)
movb   $0x1,(%rdi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @SetAdd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 1, i8* %15
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @SetAdd(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
store i8 1, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *malloc(size_t);
void *my_malloc(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<my_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int anetUnixGenericConnect(char *, char *, int);
int kr_net_unix_nonblock_connect(char *err, char *path) {
  return anetUnixGenericConnect(err, path, 1);
}


x86 assembly (clang, -O0):
<kr_net_unix_nonblock_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <anetUnixGenericConnect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kr_net_unix_nonblock_connect>:
mov    $0x1,%edx
jmp    1030 <anetUnixGenericConnect@plt>

LLVM IR (-O0):
define i32 @kr_net_unix_nonblock_connect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @anetUnixGenericConnect(i8* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kr_net_unix_nonblock_connect(i8* %0, i8* %1) {
%3 = tail call i32 @anetUnixGenericConnect(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_it(char const *);
int print_routine(const char *salutation, const char *name) {
  const char *strings[] = {salutation, name};
  print_it(name);
  return 0;
}


x86 assembly (clang, -O0):
<print_routine>:
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    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <print_it@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_routine>:
push   %rax
mov    %rsi,%rdi
call   1030 <print_it@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @print_routine(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2 x i8*]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
store i8* %7, i8** %6
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %4
store i8* %9, i8** %8
%10 = load i8*, i8** %4
%11 = call i32 @print_it(i8* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @print_routine(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @print_it(i8* %1)
ret i32 0
}
int no_rescue() { return -1; }


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

x86 assembly (clang, -O2):
<no_rescue>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @no_rescue() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @no_rescue() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ test_failing();
int /*<<< orphan*/ test_passing();
int main(void) {
  test_failing();
  test_passing();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_failing@plt>
mov    $0x0,%al
call   1040 <test_passing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_failing@plt>
xor    %eax,%eax
call   1040 <test_passing@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_failing()
%3 = call i32 (...) @test_passing()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_failing()
%2 = tail call i32 (...) @test_passing()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ assert(char *const *);
int do_fork_exec_kill(char *const *, char *const *, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int do_fork_exec(char *const argv[], char *const envp[], int64_t timeout_msec) {
  assert(argv);
  return do_fork_exec_kill(argv, envp, timeout_msec, SIGTERM);
}


x86 assembly (clang, -O0):
<do_fork_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
call   1030 <do_fork_exec_kill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fork_exec>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <assert@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <do_fork_exec_kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define i32 @do_fork_exec(i8** %0, i8** %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = call i32 @assert(i8** %7)
%9 = load i8**, i8*** %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %6
%12 = load i32, i32* @SIGTERM
%13 = call i32 @do_fork_exec_kill(i8** %9, i8** %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define i32 @do_fork_exec(i8** %0, i8** %1, i32 %2) {
%4 = tail call i32 @assert(i8** %0)
%5 = load i32, i32* @SIGTERM
%6 = tail call i32 @do_fork_exec_kill(i8** %0, i8** %1, i32 %2, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef long long uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t Hal_getTimeInMs() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return ((uint64_t)now.tv_sec * 1000LL) + (now.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<Hal_getTimeInMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hal_getTimeInMs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @Hal_getTimeInMs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @Hal_getTimeInMs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Variables and functions */
scalar_t__ strlen(char const *);
size_t osc_fmtlen(const char *buf) {
  return (((size_t)(strlen(buf) + 2) + 3) & (~3)) - 1;
}


x86 assembly (clang, -O0):
<osc_fmtlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x2,%rax
add    $0x3,%rax
and    $0xfffffffffffffffc,%rax
sub    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osc_fmtlen>:
push   %rax
call   1030 <strlen@plt>
add    $0x5,%rax
and    $0xfffffffffffffffc,%rax
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @osc_fmtlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 2
%6 = add i64 %5, 3
%7 = and i64 %6, -4
%8 = sub i64 %7, 1
ret i64 %8
}

LLVM IR (-O2):
define i64 @osc_fmtlen(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 5
%4 = and i64 %3, -4
%5 = add i64 %4, -1
ret i64 %5
}
unsigned elser(unsigned x, unsigned y, unsigned z) {
  unsigned ret = 0;
  if (x) {
    ret = 1;
  } else {
    ret = 2;
    if (y) {
      ret = 2;
    } else {
      ret = 6;
      if (z) {
        ret = 3;
      } else {
        do {
          ret = 4;
        } while (0);
      }
    }
  }
  if (y > ret) {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<elser>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <elser+0x2a>
movl   $0x1,-0x10(%rbp)
jmp    117f <elser+0x7f>
movl   $0x2,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <elser+0x47>
movl   $0x2,-0x10(%rbp)
jmp    117a <elser+0x7a>
movl   $0x6,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1164 <elser+0x64>
movl   $0x3,-0x10(%rbp)
jmp    1175 <elser+0x75>
jmp    1169 <elser+0x69>
movl   $0x4,-0x10(%rbp)
jmp    1175 <elser+0x75>
jmp    117a <elser+0x7a>
jmp    117f <elser+0x7f>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1192 <elser+0x92>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elser>:
mov    $0x1,%ecx
test   %edi,%edi
jne    111d <elser+0x1d>
mov    $0x2,%ecx
test   %esi,%esi
jne    111d <elser+0x1d>
cmp    $0x1,%edx
mov    $0x3,%ecx
adc    $0x0,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @elser(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 1, i32* %7
br label %24
11: ; preds = %3
store i32 2, i32* %7
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 2, i32* %7
br label %23
15: ; preds = %11
store i32 6, i32* %7
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 3, i32* %7
br label %22
19: ; preds = %15
br label %20
20: ; preds = %19
store i32 4, i32* %7
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21, %18
br label %23
23: ; preds = %22, %14
br label %24
24: ; preds = %23, %10
%25 = load i32, i32* %5
%26 = load i32, i32* %7
%27 = icmp ugt i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 0, i32* %7
br label %29
29: ; preds = %28, %24
%30 = load i32, i32* %7
ret i32 %30
}

LLVM IR (-O2):
define i32 @elser(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = icmp eq i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 4, i32 3
br label %10
10: ; preds = %7, %5, %3
%11 = phi i32 [ 1, %3 ], [ 2, %5 ], [ %9, %7 ]
%12 = icmp ult i32 %11, %1
%13 = select i1 %12, i32 0, i32 %11
ret i32 %13
}
/* Variables and functions */
scalar_t__ _ssp(char *, int);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret += _ssp(argv[0], 0x41414141);
  ret += _ssp(argv[0], 0x00000000);
  return (ret == 0) ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x41414141,%esi
call   1030 <_ssp@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1030 <_ssp@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rdi
mov    $0x41414141,%esi
call   1030 <_ssp@plt>
mov    %rax,%r14
mov    (%rbx),%rdi
xor    %esi,%esi
call   1030 <_ssp@plt>
xor    %ecx,%ecx
add    %r14d,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @_ssp(i8* %10, i32 1094795585)
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i64 @_ssp(i8* %18, i32 0)
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = add nsw i64 %21, %19
%23 = trunc i64 %22 to i32
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 0, i32 2
ret i32 %27
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @_ssp(i8* %3, i32 1094795585)
%5 = load i8*, i8** %1
%6 = tail call i64 @_ssp(i8* %5, i32 0)
%7 = add i64 %6, %4
%8 = trunc i64 %7 to i32
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 2
ret i32 %10
}
int iscommentline(char *line) { return (line[0] == '#'); }


x86 assembly (clang, -O0):
<iscommentline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscommentline>:
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @iscommentline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 35
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @iscommentline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct darray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ darray_clear(struct darray *);
int /*<<< orphan*/ darray_destroy(struct darray *);
void darray_clear_destroy(struct darray *array) {
  if (array) {
    darray_clear(array);
    darray_destroy(array);
  }
}


x86 assembly (clang, -O0):
<darray_clear_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <darray_clear_destroy+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <darray_clear@plt>
mov    -0x8(%rbp),%rdi
call   1040 <darray_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darray_clear_destroy>:
test   %rdi,%rdi
je     1137 <darray_clear_destroy+0x17>
push   %rbx
mov    %rdi,%rbx
call   1030 <darray_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <darray_destroy@plt>
ret

LLVM IR (-O0):
%struct.darray = type { i32 }
define void @darray_clear_destroy(%struct.darray* %0) {
%2 = alloca %struct.darray*
store %struct.darray* %0, %struct.darray** %2
%3 = load %struct.darray*, %struct.darray** %2
%4 = icmp ne %struct.darray* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.darray*, %struct.darray** %2
%7 = call i32 @darray_clear(%struct.darray* %6)
%8 = load %struct.darray*, %struct.darray** %2
%9 = call i32 @darray_destroy(%struct.darray* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.darray = type { i32 }
define void @darray_clear_destroy(%struct.darray* %0) {
%2 = icmp eq %struct.darray* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @darray_clear(%struct.darray* %0)
%5 = tail call i32 @darray_destroy(%struct.darray* %0)
br label %6
6: ; preds = %3, %1
ret void
}
int mv_pp3_ptp_tai_tod_uio_init(struct platform_device *shared_pdev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @mv_pp3_ptp_tai_tod_uio_init(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mv_pp3_ptp_tai_tod_uio_init(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct sockaddr_ll {
  int /*<<< orphan*/ sll_addr;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_macstr(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_mac(struct sockaddr *addr) {
  struct sockaddr_ll *h = ((struct sockaddr_ll *)addr);
  printf("\t");
  print_macstr(h->sll_addr);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <print_macstr@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mac>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <print_macstr@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_ll = type { i32 }
@.str = [2 x i8] c"\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_mac(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
%3 = alloca %struct.sockaddr_ll*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%4 = load %struct.sockaddr*, %struct.sockaddr** %2
%5 = bitcast %struct.sockaddr* %4 to %struct.sockaddr_ll*
store %struct.sockaddr_ll* %5, %struct.sockaddr_ll** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.sockaddr_ll*, %struct.sockaddr_ll** %3
%8 = getelementptr inbounds %struct.sockaddr_ll, %struct.sockaddr_ll* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @print_macstr(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @print_mac(%struct.sockaddr* nocapture %0) {
%2 = tail call i32 @putchar(i32 9)
%3 = getelementptr %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @print_macstr(i32 %4)
%6 = tail call i32 @putchar(i32 10)
ret void
}
void free_grid(unsigned char **p, const unsigned int X) {
  for (unsigned int i = 0; i < X; i++) {
    free(p[i]);
  }
  free(p);
  return;
}


x86 assembly (clang, -O0):
<free_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_grid+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_grid+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_grid>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_grid+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_grid+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_grid(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
void setter(void **target, void *value) { *target = value; }


x86 assembly (clang, -O0):
<setter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setter>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @setter(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t val32(uint8_t *ptr) {
  uint32_t val;
  val = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
  return val;
}


x86 assembly (clang, -O0):
<val32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @val32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = or i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @val32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  do {
    printf("%d = %c\n", i, i);
    i++;
  } while (i <= 127);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jle    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %3
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 127
br i1 %11, label %3, label %12
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d = %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FreeLinedefs();
int /*<<< orphan*/ FreeNodes();
int /*<<< orphan*/ FreeSectors();
int /*<<< orphan*/ FreeSegs();
int /*<<< orphan*/ FreeSidedefs();
int /*<<< orphan*/ FreeStaleNodes();
int /*<<< orphan*/ FreeSubsecs();
int /*<<< orphan*/ FreeThings();
int /*<<< orphan*/ FreeVertices();
int /*<<< orphan*/ FreeWallTips();
void FreeLevel(void) {
  FreeVertices();
  FreeSidedefs();
  FreeLinedefs();
  FreeSectors();
  FreeThings();
  FreeSegs();
  FreeSubsecs();
  FreeNodes();
  FreeStaleNodes();
  FreeWallTips();
}


x86 assembly (clang, -O0):
<FreeLevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10a0 <FreeVertices@plt>
mov    $0x0,%al
call   10c0 <FreeSidedefs@plt>
mov    $0x0,%al
call   1070 <FreeLinedefs@plt>
mov    $0x0,%al
call   10b0 <FreeSectors@plt>
mov    $0x0,%al
call   1030 <FreeThings@plt>
mov    $0x0,%al
call   1080 <FreeSegs@plt>
mov    $0x0,%al
call   1050 <FreeSubsecs@plt>
mov    $0x0,%al
call   1040 <FreeNodes@plt>
mov    $0x0,%al
call   1060 <FreeStaleNodes@plt>
mov    $0x0,%al
call   1090 <FreeWallTips@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeLevel>:
push   %rax
xor    %eax,%eax
call   10a0 <FreeVertices@plt>
xor    %eax,%eax
call   10c0 <FreeSidedefs@plt>
xor    %eax,%eax
call   1070 <FreeLinedefs@plt>
xor    %eax,%eax
call   10b0 <FreeSectors@plt>
xor    %eax,%eax
call   1030 <FreeThings@plt>
xor    %eax,%eax
call   1080 <FreeSegs@plt>
xor    %eax,%eax
call   1050 <FreeSubsecs@plt>
xor    %eax,%eax
call   1040 <FreeNodes@plt>
xor    %eax,%eax
call   1060 <FreeStaleNodes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <FreeWallTips@plt>

LLVM IR (-O0):
define void @FreeLevel() {
%1 = call i32 (...) @FreeVertices()
%2 = call i32 (...) @FreeSidedefs()
%3 = call i32 (...) @FreeLinedefs()
%4 = call i32 (...) @FreeSectors()
%5 = call i32 (...) @FreeThings()
%6 = call i32 (...) @FreeSegs()
%7 = call i32 (...) @FreeSubsecs()
%8 = call i32 (...) @FreeNodes()
%9 = call i32 (...) @FreeStaleNodes()
%10 = call i32 (...) @FreeWallTips()
ret void
}

LLVM IR (-O2):
define void @FreeLevel() {
%1 = tail call i32 (...) @FreeVertices()
%2 = tail call i32 (...) @FreeSidedefs()
%3 = tail call i32 (...) @FreeLinedefs()
%4 = tail call i32 (...) @FreeSectors()
%5 = tail call i32 (...) @FreeThings()
%6 = tail call i32 (...) @FreeSegs()
%7 = tail call i32 (...) @FreeSubsecs()
%8 = tail call i32 (...) @FreeNodes()
%9 = tail call i32 (...) @FreeStaleNodes()
%10 = tail call i32 (...) @FreeWallTips()
ret void
}
unsigned char f7(unsigned char x, unsigned int y) {
  return (x << y) | (x >> (8 - y));
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f7(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 8, %11
%13 = ashr i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f7(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
void rop3_52_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_52_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_52_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_52_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = and i32 %37, %39
%41 = or i32 %34, %40
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
store i8 %42, i8* %43
ret void
}

LLVM IR (-O2):
define void @rop3_52_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %1, -1
%7 = and i8 %6, %2
%8 = or i8 %5, %7
store i8 %8, i8* %0
ret void
}
/* Type definitions */
struct CartItem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct CartItem *);
void freeItem(struct CartItem *item) { free(item); }


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

x86 assembly (clang, -O2):
<freeItem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.CartItem = type { i32 }
define void @freeItem(%struct.CartItem* nocapture %0) {
%2 = tail call i32 @free(%struct.CartItem* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_dev(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ read(int, int *, int);
int main() {
  int gpio_fd = 0;
  int key = 0x00;
  gpio_fd = open_dev("/dev/key_eint");
  if (gpio_fd < 0) {
    perror("open device key_eint");
    return gpio_fd;
  }
  while (1) {
    read(gpio_fd, &key, sizeof(key));
  }
  close(gpio_fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <open_dev@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117b <main+0x4b>
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1180 <main+0x50>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
jmp    1180 <main+0x50>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <open_dev@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1171 <main+0x41>
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <read@plt>
jmp    1160 <main+0x30>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/dev/key_eint\00"
@.str.1 = [21 x i8] c"open device key_eint\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 @open_dev(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
10: ; preds = %0
br label %11
11: ; preds = %10, %11
%12 = load i32, i32* %2
%13 = call i32 @read(i32 %12, i32* %3, i32 4)
br label %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"/dev/key_eint\00"
@.str.1 = [21 x i8] c"open device key_eint\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @open_dev(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
7: ; preds = %0, %7
%8 = call i32 @read(i32 %3, i32* %1, i32 4)
br label %7
}
int test_imm_D5int8_reg(signed char val) {
  return ((val) & (0xD5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D5int8_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, 213
%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_D5int8_reg(i8 signext %0) {
%2 = and i8 %0, -43
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
int /*<<< orphan*/ passwd_free();
enum nss_status _nss_puavoadmins_endpwent(void) {
  passwd_free();
  return NSS_STATUS_SUCCESS;
}


x86 assembly (clang, -O0):
<_nss_puavoadmins_endpwent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <passwd_free@plt>
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_puavoadmins_endpwent>:
push   %rax
xor    %eax,%eax
call   1030 <passwd_free@plt>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_puavoadmins_endpwent() {
%1 = call i32 (...) @passwd_free()
%2 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %2
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_puavoadmins_endpwent() {
%1 = tail call i32 (...) @passwd_free()
%2 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  while (1) {
    int x = __VERIFIER_nondet_int();
    int y = x;
    __VERIFIER_assert(x == y);
    int a = __VERIFIER_nondet_int();
    int b = a;
    __VERIFIER_assert(a == b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
mov    %al,-0x16(%rbp)
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
mov    %al,-0x15(%rbp)
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %0, %6
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %2
%8 = load i32, i32* %2
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assert(i32 %12)
%14 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %14, i32* %4
%15 = load i32, i32* %4
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @__VERIFIER_assert(i32 %19)
br label %6
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = tail call i32 @__VERIFIER_assert(i32 1)
br label %1
}