xunge/DecIR huggingface dataset:
unsigned xrop3_176_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_176_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_176_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_176_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ MHD_HW_Reset();
int /*<<< orphan*/ sii9234_initial_registers_set();
int /*<<< orphan*/ sii9234_initializeStateVariables();
void sii9234_tpi_init(void) {
  sii9234_initializeStateVariables();
  MHD_HW_Reset();
  sii9234_initial_registers_set();
}


x86 assembly (clang, -O0):
<sii9234_tpi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sii9234_initializeStateVariables@plt>
mov    $0x0,%al
call   1040 <MHD_HW_Reset@plt>
mov    $0x0,%al
call   1030 <sii9234_initial_registers_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sii9234_tpi_init>:
push   %rax
xor    %eax,%eax
call   1050 <sii9234_initializeStateVariables@plt>
xor    %eax,%eax
call   1040 <MHD_HW_Reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sii9234_initial_registers_set@plt>

LLVM IR (-O0):
define void @sii9234_tpi_init() {
%1 = call i32 (...) @sii9234_initializeStateVariables()
%2 = call i32 (...) @MHD_HW_Reset()
%3 = call i32 (...) @sii9234_initial_registers_set()
ret void
}

LLVM IR (-O2):
define void @sii9234_tpi_init() {
%1 = tail call i32 (...) @sii9234_initializeStateVariables()
%2 = tail call i32 (...) @MHD_HW_Reset()
%3 = tail call i32 (...) @sii9234_initial_registers_set()
ret void
}
extern void add2set(unsigned int *set, int value) {
  *set = *set | (1 << value);
}


x86 assembly (clang, -O0):
<add2set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @add2set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @add2set(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = or i32 %3, %4
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void git__init_structure(void *structure, size_t len, unsigned int version) {
  memset(structure, 0, len);
  *((int *)structure) = version;
}


x86 assembly (clang, -O0):
<git__init_structure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__init_structure>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @git__init_structure(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i32 @memset(i8* %7, i32 0, i64 %8)
%10 = load i32, i32* %6
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @git__init_structure(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%5 = bitcast i8* %0 to i32*
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int str_begins_with(char *str, const char *pref) {
  return memcmp(str, pref, strlen(pref)) == 0;
}


x86 assembly (clang, -O0):
<str_begins_with>:
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 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_begins_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_begins_with(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @memcmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_begins_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cbmap_default_deallocator(void *data) { free((data)); }


x86 assembly (clang, -O0):
<cbmap_default_deallocator>:
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):
<cbmap_default_deallocator>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cbmap_default_deallocator(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int check() { return 0; }


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

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

LLVM IR (-O0):
define i32 @check() {
ret i32 0
}

LLVM IR (-O2):
define i32 @check() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
long long _random_longlong_func(long long, long long);
int64_t _random_64_from_longlong(int64_t min, int64_t max) {
  long long ret = _random_longlong_func((long long)min, (long long)max);
  return (int64_t)ret;
}


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

x86 assembly (clang, -O2):
<_random_64_from_longlong>:
jmp    1030 <_random_longlong_func@plt>

LLVM IR (-O0):
define i64 @_random_64_from_longlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 @_random_longlong_func(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @_random_64_from_longlong(i64 %0, i64 %1) {
%3 = tail call i64 @_random_longlong_func(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void release_persistent_storage(FILE *ps) { fclose(ps); }


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

x86 assembly (clang, -O2):
<release_persistent_storage>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @release_persistent_storage(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lfn_reset();
void new_dir(void) { lfn_reset(); }


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

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

LLVM IR (-O0):
define void @new_dir() {
%1 = call i32 (...) @lfn_reset()
ret void
}

LLVM IR (-O2):
define void @new_dir() {
%1 = tail call i32 (...) @lfn_reset()
ret void
}
/* Type definitions */
struct bitstream {
  int dummy;
};

/* Variables and functions */
scalar_t__ bs_remain(struct bitstream *);
int bs_eof(struct bitstream *bs) { return bs_remain(bs) == 0; }


x86 assembly (clang, -O0):
<bs_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bs_remain@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_eof>:
push   %rax
call   1030 <bs_remain@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bitstream = type { i32 }
define i32 @bs_eof(%struct.bitstream* %0) {
%2 = alloca %struct.bitstream*
store %struct.bitstream* %0, %struct.bitstream** %2
%3 = load %struct.bitstream*, %struct.bitstream** %2
%4 = call i64 @bs_remain(%struct.bitstream* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.bitstream = type { i32 }
define i32 @bs_eof(%struct.bitstream* %0) {
%2 = tail call i64 @bs_remain(%struct.bitstream* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int lis(int *, int);
int main() {
  int array_size = __VERIFIER_nondet_int();
  if (array_size < 1) {
    array_size = 1;
  }
  int *numbers = (int *)alloca(array_size * sizeof(int));
  return lis(numbers, array_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <lis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <lis@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = call i32 @lis(i32* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = shl i32 %3, 2
%5 = tail call i64 @alloca(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @lis(i32* %6, i32 %3)
ret i32 %7
}
/* Variables and functions */
int unix_is_regular_file(char *);
int wfile_is_regular_file(char *filename) {
  return (unix_is_regular_file(filename));
}


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

x86 assembly (clang, -O2):
<wfile_is_regular_file>:
jmp    1030 <unix_is_regular_file@plt>

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

LLVM IR (-O2):
define i32 @wfile_is_regular_file(i8* %0) {
%2 = tail call i32 @unix_is_regular_file(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t n) {
  p = realloc(p, n);
  if (p == NULL)
    error(EXIT_FAILURE, errno, "xrealloc failed");
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116a <xrealloc+0x4a>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    0xe9b(%rip),%rdx
call   1040 <error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xrealloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [16 x i8] c"xrealloc failed\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int amount_in_ar(char const *, int, int);
int notjusttwos(const char *begin, const char *end) {
  int bits = end - begin;
  if (amount_in_ar(begin, bits, 2) == bits)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<notjusttwos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x2,%edx
call   1030 <amount_in_ar@plt>
cmp    -0x1c(%rbp),%eax
jne    1154 <notjusttwos+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115b <notjusttwos+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notjusttwos>:
push   %rbx
mov    %rsi,%rbx
sub    %edi,%ebx
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <amount_in_ar@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @notjusttwos(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = call i32 @amount_in_ar(i8* %13, i32 %14, i32 2)
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 0, i32* %3
br label %20
19: ; preds = %2
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @notjusttwos(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @amount_in_ar(i8* %0, i32 %6, i32 2)
%8 = icmp ne i32 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
void foo790(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo790(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void bad_free(void) {
  char *ptr;
  ptr = (char *)malloc(32);
  ptr++;
  free(ptr);
  return;
}


x86 assembly (clang, -O0):
<bad_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_free>:
push   %rax
mov    $0x20,%edi
call   1040 <malloc@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @bad_free() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 32)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @bad_free() {
%1 = tail call i64 @malloc(i32 32)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Pixmap;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int alock_shade_pixmap(Display *display, Visual *visual, const Pixmap src_pm,
                       Pixmap dst_pm, unsigned char shade, int src_x, int src_y,
                       int dst_x, int dst_y, unsigned int width,
                       unsigned int height) {
  (void)display;
  (void)visual;
  return 0;
}


x86 assembly (clang, -O0):
<alock_shade_pixmap>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    0x30(%rbp),%r8d
mov    0x28(%rbp),%r8d
mov    0x20(%rbp),%r8d
mov    0x18(%rbp),%r8d
mov    0x10(%rbp),%r8d
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %r9d,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @alock_shade_pixmap(i32* %0, i32* %1, i32 %2, i32 %3, i8 zeroext %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %12
store i32* %1, i32** %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i8 %4, i8* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
%23 = load i32*, i32** %12
%24 = load i32*, i32** %13
ret i32 0
}

LLVM IR (-O2):
define i32 @alock_shade_pixmap(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i8 zeroext %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ED_getDoubleArray1DFromXML(void *, char const *, double *,
                                              size_t);
void ED_getDoubleArray2DFromXML(void *_xml, const char *varName, double *a,
                                size_t m, size_t n) {
  ED_getDoubleArray1DFromXML(_xml, varName, a, m * n);
}


x86 assembly (clang, -O0):
<ED_getDoubleArray2DFromXML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
imul   -0x28(%rbp),%rcx
call   1030 <ED_getDoubleArray1DFromXML@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ED_getDoubleArray2DFromXML>:
imul   %r8,%rcx
jmp    1030 <ED_getDoubleArray1DFromXML@plt>

LLVM IR (-O0):
define void @ED_getDoubleArray2DFromXML(i8* %0, i8* %1, double* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store double* %2, double** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load double*, double** %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = mul i64 %14, %15
%17 = call i32 @ED_getDoubleArray1DFromXML(i8* %11, i8* %12, double* %13, i64 %16)
ret void
}

LLVM IR (-O2):
define void @ED_getDoubleArray2DFromXML(i8* %0, i8* %1, double* %2, i64 %3, i64 %4) {
%6 = mul i64 %4, %3
%7 = tail call i32 @ED_getDoubleArray1DFromXML(i8* %0, i8* %1, double* %2, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage is XXX\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Usage is XXX\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Usage is XXX\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int f3(int a) { return 2 * a + 3 * a; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   $0x3,-0x4(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 3, %5
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = mul nsw i32 %0, 5
ret i32 %2
}
void writesn(s) char *s;
{
  writes(s);
  writen();
}


x86 assembly (clang, -O0):
<writesn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <writes@plt>
mov    $0x0,%al
call   1040 <writen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writesn>:
push   %rax
xor    %eax,%eax
call   1030 <writes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <writen@plt>

LLVM IR (-O0):
define void @writesn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @writes to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @writen()
ret void
}

LLVM IR (-O2):
define void @writesn(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @writes to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @writen()
ret void
}
void io_stop(void) { ; }


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

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

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

LLVM IR (-O2):
define void @io_stop() {
ret void
}
void RTVfsSymlinkSetMode(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsSymlinkSetMode() {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRCREATEBITMAPINDIRECT_get(void) {
  return U_WMRCORENONE_get("U_WMRCREATEBITMAPINDIRECT");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"U_WMRCREATEBITMAPINDIRECT\00"
define i32 @U_WMRCREATEBITMAPINDIRECT_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i8] c"U_WMRCREATEBITMAPINDIRECT\00"
define i32 @U_WMRCREATEBITMAPINDIRECT_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void remove_trailing_newline(char *line) {
  while (*line) {
    if (*line == '\n')
      *line = '\0';
    else if (*line == '\r')
      *line = '\0';
    ++line;
  }
  return;
}


x86 assembly (clang, -O0):
<remove_trailing_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <remove_trailing_newline+0x5e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1131 <remove_trailing_newline+0x31>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    114d <remove_trailing_newline+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1148 <remove_trailing_newline+0x48>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    114d <remove_trailing_newline+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <remove_trailing_newline+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_trailing_newline>:
jmp    1117 <remove_trailing_newline+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <remove_trailing_newline+0x10>
cmp    $0xd,%al
je     1110 <remove_trailing_newline+0x10>
test   %al,%al
jne    1113 <remove_trailing_newline+0x13>
ret

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

LLVM IR (-O2):
define void @remove_trailing_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I_SetMusicPosition(float);
void S_SetMusicPosition(float position) { I_SetMusicPosition(position); }


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

x86 assembly (clang, -O2):
<S_SetMusicPosition>:
jmp    1030 <I_SetMusicPosition@plt>

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

LLVM IR (-O2):
define void @S_SetMusicPosition(float %0) {
%2 = tail call i32 @I_SetMusicPosition(float %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int base64_decode_value_signed(int /*<<< orphan*/);
int base64_decode_value(char value_in) {
  return base64_decode_value_signed(*((int8_t *)&value_in));
}


x86 assembly (clang, -O0):
<base64_decode_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%edi
call   1030 <base64_decode_value_signed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_value>:
movzbl %dil,%edi
jmp    1030 <base64_decode_value_signed@plt>

LLVM IR (-O0):
define i32 @base64_decode_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = call i32 @base64_decode_value_signed(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @base64_decode_value(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 @base64_decode_value_signed(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fec_init();
int /*<<< orphan*/ fec_start(int, int);
void network_init_fec() {
  fec_init();
  fec_start(false, true);
}


x86 assembly (clang, -O0):
<network_init_fec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fec_init@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <fec_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_init_fec>:
push   %rax
xor    %eax,%eax
call   1040 <fec_init@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <fec_start@plt>

LLVM IR (-O0):
define void @network_init_fec() {
%1 = call i32 (...) @fec_init()
%2 = call i32 @fec_start(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @network_init_fec() {
%1 = tail call i32 (...) @fec_init()
%2 = tail call i32 @fec_start(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myusec_delay(int);
int /*<<< orphan*/ usleep(int);
void internal_delay(int usecs) {
  if (usecs > 1000000) {
    usleep(usecs);
  } else {
    myusec_delay(usecs);
  }
}


x86 assembly (clang, -O0):
<internal_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jle    1145 <internal_delay+0x25>
mov    -0x4(%rbp),%edi
call   1040 <usleep@plt>
jmp    114d <internal_delay+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <myusec_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_delay>:
cmp    $0xf4241,%edi
jl     112d <internal_delay+0xd>
jmp    1040 <usleep@plt>
jmp    1030 <myusec_delay@plt>

LLVM IR (-O0):
define void @internal_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @usleep(i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @myusec_delay(i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @internal_delay(i32 %0) {
%2 = icmp sgt i32 %0, 1000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @usleep(i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @myusec_delay(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t __myntohl(const unsigned char *c) {
  return (((uint32_t)c[0]) << 24) + (((uint32_t)c[1]) << 16) +
         (((uint32_t)c[2]) << 8) + ((uint32_t)c[3]);
}


x86 assembly (clang, -O0):
<__myntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__myntohl>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__myntohl(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 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @__myntohl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mi_read_op(void) {
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001 | 0x0004);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0004);
  udelay(100);
}


x86 assembly (clang, -O0):
<mi_read_op>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc000c20,%eax
movw   $0x9,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xd,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0x8,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xc,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_read_op>:
push   %rax
movw   $0x9,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xd,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0x8,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xc,0xc000c20
mov    $0x64,%edi
pop    %rax
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @mi_read_op() {
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%1 = call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%2 = call i32 @udelay(i32 100)
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%3 = call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%4 = call i32 @udelay(i32 100)
ret void
}

LLVM IR (-O2):
define void @mi_read_op() {
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%1 = tail call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%2 = tail call i32 @udelay(i32 100)
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%3 = tail call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%4 = tail call i32 @udelay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\nBefore...\n");
  printf("\nDuring...");
  printf("\n\nAfter...\n\n");
  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>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"\0ABefore...\0A\00"
@.str.1 = [11 x i8] c"\0ADuring...\00"
@.str.2 = [13 x i8] c"\0A\0AAfter...\0A\0A\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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\0ADuring...\00"
@str = [11 x i8] c"\0ABefore...\00"
@str.3 = [12 x i8] c"\0A\0AAfter...\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void c2rgba(unsigned long c, unsigned char *r, unsigned char *g,
            unsigned char *b, unsigned char *a) {
  *a = (c & 0xff000000) >> 24;
  *r = (c & 0x00ff0000) >> 16;
  *g = (c & 0x0000ff00) >> 8;
  *b = (c & 0x000000ff);
}


x86 assembly (clang, -O0):
<c2rgba>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
and    $0xff0000,%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2rgba>:
mov    %rdi,%rax
shr    $0x18,%rdi
mov    %dil,(%r8)
mov    %rax,%rdi
shr    $0x10,%rdi
mov    %dil,(%rsi)
mov    %ah,(%rdx)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @c2rgba(i64 %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i64 %0, i64* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i64, i64* %6
%12 = and i64 %11, 4278190080
%13 = lshr i64 %12, 24
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %10
store i8 %14, i8* %15
%16 = load i64, i64* %6
%17 = and i64 %16, 16711680
%18 = lshr i64 %17, 16
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %7
store i8 %19, i8* %20
%21 = load i64, i64* %6
%22 = and i64 %21, 65280
%23 = lshr i64 %22, 8
%24 = trunc i64 %23 to i8
%25 = load i8*, i8** %8
store i8 %24, i8* %25
%26 = load i64, i64* %6
%27 = and i64 %26, 255
%28 = trunc i64 %27 to i8
%29 = load i8*, i8** %9
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
define void @c2rgba(i64 %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4) {
%6 = lshr i64 %0, 24
%7 = trunc i64 %6 to i8
store i8 %7, i8* %4
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
store i8 %9, i8* %1
%10 = lshr i64 %0, 8
%11 = trunc i64 %10 to i8
store i8 %11, i8* %2
%12 = trunc i64 %0 to i8
store i8 %12, i8* %3
ret void
}
int nofield(char *str, char sep) {
  int no;
  char *ep;
  no = 0;
  for (ep = str; *ep != 0; ep++)
    if (*ep == sep)
      no++;
  if (str != ep)
    no++;
  return (no);
}


x86 assembly (clang, -O0):
<nofield>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <nofield+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <nofield+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <nofield+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <nofield+0x1d>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1176 <nofield+0x76>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nofield>:
mov    (%rdi),%al
xor    %r8d,%r8d
mov    %rdi,%rdx
test   %al,%al
je     1127 <nofield+0x27>
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    %sil,%al
sete   %cl
add    %ecx,%r8d
movzbl 0x1(%rdx),%eax
add    $0x1,%rdx
test   %al,%al
jne    1110 <nofield+0x10>
xor    %eax,%eax
cmp    %rdi,%rdx
setne  %al
add    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @nofield(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = phi i8* [ %0, %2 ], [ %12, %5 ]
%18 = icmp ne i8* %17, %0
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %16, %19
ret i32 %20
}
/* Variables and functions */
int strlen(char *);
int verify_essid(char *essid) {
  return essid == NULL || strlen(essid) < 1 || strlen(essid) > 32;
}


x86 assembly (clang, -O0):
<verify_essid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1157 <verify_essid+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jl     1157 <verify_essid+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x20,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_essid>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %rdi,%rdi
je     113a <verify_essid+0x2a>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113a <verify_essid+0x2a>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x21,%eax
setge  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @verify_essid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %7, 1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = icmp sgt i32 %11, 32
br label %13
13: ; preds = %9, %5, %1
%14 = phi i1 [ true, %5 ], [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @verify_essid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp sgt i32 %7, 32
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
void op_clean(int argc, char *argv[], int index) {}


x86 assembly (clang, -O0):
<op_clean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @op_clean(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}