xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fmod(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_mod(void) {
  lua_pushnumber(fmod(luaL_check_number(1), luaL_check_number(2)));
}


x86 assembly (clang, -O0):
<math_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <fmod@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_mod>:
push   %rbx
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <luaL_check_number@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <fmod@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_mod() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @luaL_check_number(i32 2)
%3 = call i32 @fmod(i32 %1, i32 %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @math_mod() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @luaL_check_number(i32 2)
%3 = tail call i32 @fmod(i32 %1, i32 %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
unsigned int digestdb_hash(const void *a) {
  const unsigned char *ma = a;
  return *ma;
}


x86 assembly (clang, -O0):
<digestdb_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digestdb_hash>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @digestdb_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @digestdb_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Ttl_TPM_SaveState();
uint32_t TtlSaveState(void) {
  do {
  } while (0);
  return Ttl_TPM_SaveState();
}


x86 assembly (clang, -O0):
<TtlSaveState>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <TtlSaveState+0x9>
jmp    111e <TtlSaveState+0xe>
mov    $0x0,%al
call   1030 <Ttl_TPM_SaveState@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @TtlSaveState() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 (...) @Ttl_TPM_SaveState()
ret i32 %3
}

LLVM IR (-O2):
define i32 @TtlSaveState() {
%1 = tail call i32 (...) @Ttl_TPM_SaveState()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

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


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

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

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

LLVM IR (-O2):
define i32 @badvpn_read_le32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i8, i8* %0, i64 16
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %12, %7
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i64, i64* %2
%21 = trunc i64 %20 to i32
%22 = or i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ my_free(void *);
void _FAT_mem_free(void *mem) { my_free(mem); }


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

x86 assembly (clang, -O2):
<_FAT_mem_free>:
jmp    1030 <my_free@plt>

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

LLVM IR (-O2):
define void @_FAT_mem_free(i8* %0) {
%2 = tail call i32 @my_free(i8* %0)
ret void
}
void pause(void) { __asm__ volatile("pause" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
char *monikor_read_fd(int);
int open(char const *, int /*<<< orphan*/);
char *monikor_read_file(const char *filepath) {
  int fd;
  char *content;
  if ((fd = open(filepath, O_RDONLY)) == -1)
    return NULL;
  content = monikor_read_fd(fd);
  close(fd);
  return content;
}


x86 assembly (clang, -O0):
<monikor_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1167 <monikor_read_file+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1183 <monikor_read_file+0x53>
mov    -0x14(%rbp),%edi
call   1040 <monikor_read_fd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monikor_read_file>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     115f <monikor_read_file+0x2f>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <monikor_read_fd@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <close@plt>
mov    %r14,%rax
jmp    1161 <monikor_read_file+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i8* @monikor_read_file(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i8* @monikor_read_fd(i32 %3)
%7 = tail call i32 @close(i32 %3)
br label %8
8: ; preds = %1, %5
%9 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
int util_checkalnum(char *str) {
  while (*str) {
    if (!isalnum(*str))
      return -1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_checkalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <util_checkalnum+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    114a <util_checkalnum+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <util_checkalnum+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <util_checkalnum+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_checkalnum>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114e <util_checkalnum+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
je     1149 <util_checkalnum+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <util_checkalnum+0x20>
jmp    114e <util_checkalnum+0x3e>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @util_checkalnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isalnum(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ -1, %7 ]
ret i32 %14
}
int func1(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @func1() {
ret i32 3
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
char *read_uint16(char *buf, uint16_t *val) {
  uint16_t tmp = ntohs(*((uint32_t *)buf));
  memcpy(val, &tmp, 2);
  return buf + 2;
}


x86 assembly (clang, -O0):
<read_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <ntohs@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read_uint16(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 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = call i32 @ntohs(i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = call i32 @memcpy(i32* %10, i32* %5, i32 2)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
ret i8* %13
}

LLVM IR (-O2):
define i8* @read_uint16(i8* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @ntohs(i32 %6)
store i32 %7, i32* %3
%8 = call i32 @memcpy(i32* %1, i32* %3, i32 2)
%9 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %9
}
void initialiseStatesAndConstants(double *states, double *variables) {
  variables[0] = 123.0;
  states[0] = variables[0];
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movabs $0x405ec00000000000,%rax
c0 5e 40
mov    %rax,(%rsi)
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
store double 1.230000e+02, double* %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture writeonly %1) {
store double 1.230000e+02, double* %1
store double 1.230000e+02, double* %0
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int mutt_strcasecmp(const char *a, const char *b) {
  return strcasecmp(a ? a : "", b ? b : "");
}


x86 assembly (clang, -O0):
<mutt_strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <mutt_strcasecmp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <mutt_strcasecmp+0x38>
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <mutt_strcasecmp+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <mutt_strcasecmp+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <mutt_strcasecmp+0x68>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <mutt_strcasecmp+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcasecmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_strcasecmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strcasecmp(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i8*, i8** %4
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %14
%18 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%19 = call i32 @strcasecmp(i8* %11, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strcasecmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t fingerprint(uint64_t hash) {
  return (uint32_t)(hash & ((1 << 8) - 1));
}


x86 assembly (clang, -O0):
<fingerprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fingerprint>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @fingerprint(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ func_44(int);
int main(void) {
  func_44(2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <func_44@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func_44(i32 2)
ret i32 0
}
int search_service(int n, int *list, int val) {
  int i;
  for (i = 0; i < n; i++) {
    if (list[i] == val)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<search_service>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <search_service+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <search_service+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search_service+0x5a>
jmp    1145 <search_service+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search_service+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_service>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <search_service+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
je     111f <search_service+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <search_service+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search_service(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ a450();
int /*<<< orphan*/ a7550();
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ my_malloc1(int);
int /*<<< orphan*/ my_malloc3(int);
int main(void) {
  a7550();
  a450();
  my_malloc1(4000);
  malloc(16000);
  my_malloc3(400);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <a7550@plt>
mov    $0x0,%al
call   1070 <a450@plt>
mov    $0xfa0,%edi
call   1040 <my_malloc1@plt>
mov    $0x3e80,%edi
call   1060 <malloc@plt>
mov    $0x190,%edi
call   1050 <my_malloc3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <a7550@plt>
xor    %eax,%eax
call   1070 <a450@plt>
mov    $0xfa0,%edi
call   1040 <my_malloc1@plt>
mov    $0x3e80,%edi
call   1060 <malloc@plt>
mov    $0x190,%edi
call   1050 <my_malloc3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a7550()
%3 = call i32 (...) @a450()
%4 = call i32 @my_malloc1(i32 4000)
%5 = call i32 @malloc(i32 16000)
%6 = call i32 @my_malloc3(i32 400)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a7550()
%2 = tail call i32 (...) @a450()
%3 = tail call i32 @my_malloc1(i32 4000)
%4 = tail call i32 @malloc(i32 16000)
%5 = tail call i32 @my_malloc3(i32 400)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int login() {
  while (1) {
    system("/bin/login");
  }
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <login+0x9>
lea    0xee0(%rip),%rdi
call   1030 <system@plt>
jmp    1119 <login+0x9>

x86 assembly (clang, -O2):
<login>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <system@plt>
jmp    1120 <login+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"/bin/login\00"
define i32 @login() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"/bin/login\00"
define i32 @login() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ redirLogMode(char *, char *);
void redirLog(char *fileName) { redirLogMode(fileName, "w"); }


x86 assembly (clang, -O0):
<redirLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <redirLogMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirLog>:
lea    0xee9(%rip),%rsi
jmp    1030 <redirLogMode@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @redirLog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @redirLogMode(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @redirLog(i8* %0) {
%2 = tail call i32 @redirLogMode(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
scalar_t__ malloc(int);
int main(int argc, char *argv[]) {
  bool *p = (bool *)malloc(sizeof(bool));
  bool boolean = *p;
  f(boolean);
  f(!boolean);
  return 0;
}


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)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <f@plt>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    (%rax),%ebx
mov    %ebx,%edi
call   1030 <f@plt>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @f(i32 %5)
%7 = icmp eq i32 %5, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @f(i32 %8)
ret i32 0
}
void dis_assemble_12(as12, x, y) unsigned int as12;
unsigned int *x, *y;
{
  *y = (as12 & 0x800) >> 11;
  *x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10);
}


x86 assembly (clang, -O0):
<dis_assemble_12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x800,%ecx
shr    $0xb,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0x3ff,%ecx
shl    $0x1,%ecx
mov    -0x4(%rbp),%eax
and    $0x400,%eax
shr    $0xa,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_assemble_12>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0x1,%eax
mov    %eax,(%rdx)
mov    %edi,%eax
and    $0x3ff,%eax
shr    $0xa,%edi
and    $0x1,%edi
lea    (%rdi,%rax,2),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @dis_assemble_12(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = and i32 %7, 2048
%9 = lshr i32 %8, 11
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 1023
%13 = shl i32 %12, 1
%14 = load i32, i32* %4
%15 = and i32 %14, 1024
%16 = lshr i32 %15, 10
%17 = or i32 %13, %16
%18 = load i32*, i32** %5
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @dis_assemble_12(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = lshr i32 %0, 11
%5 = and i32 %4, 1
store i32 %5, i32* %2
%6 = shl i32 %0, 1
%7 = and i32 %6, 2046
%8 = lshr i32 %0, 10
%9 = and i32 %8, 1
%10 = or i32 %7, %9
store i32 %10, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(
    const uint8_t *event) {
  return little_endian_read_16(event, 14);
}


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

x86 assembly (clang, -O2):
<hci_event_synchronous_connection_complete_get_rx_packet_length>:
mov    $0xe,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_rx_packet_length(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 14)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_data(void) { printf("get_data() - getting data from Sql conn\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"get_data() - getting data from Sql conn\0A\00"
define void @get_data() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"get_data() - getting data from Sql conn\00"
define void @get_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
int qux(unsigned g, unsigned h) {
  unsigned t = g - h;
  return (t - 1) < g;
}


x86 assembly (clang, -O0):
<qux>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cmp    -0x4(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qux>:
xor    %eax,%eax
cmp    %edi,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @qux(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sub i32 %9, 1
%11 = load i32, i32* %3
%12 = icmp ult i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @qux(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rvid_puts(char const *);
int cputs(const char *str) {
  rvid_puts(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<cputs>:
push   %rax
call   1030 <rvid_puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cputs(i8* %0) {
%2 = tail call i32 @rvid_puts(i8* %0)
ret i32 0
}
__attribute__((warning("call to default write_r"))) long
_undef_write_r(struct _reent *r, int fd, const char *ptr, int len) {
  return len;
}


x86 assembly (clang, -O0):
<_undef_write_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_undef_write_r>:
movslq %ecx,%rax
ret

LLVM IR (-O0):
%struct._reent = type opaque
define i64 @_undef_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct._reent = type opaque
define i64 @_undef_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = sext i32 %3 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ main_test();
main() { main_test(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @main_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_test()
ret i32 0
}
int test_imm_7Eint16_reg(short val) {
  return ((val) & (-0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff82,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Eint16_reg>:
test   $0xff82,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -126
%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_7Eint16_reg(i16 signext %0) {
%2 = and i16 %0, -126
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int IsOnlyDigits(char *isbn) {
  int index = 0;
  for (; index < strlen(isbn); index++) {
    if (isbn[index] < '0' || isbn[index] > '9' || isbn[index] != '-') {
      break;
      return -1;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<IsOnlyDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1196 <IsOnlyDigits+0x86>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     117e <IsOnlyDigits+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     117e <IsOnlyDigits+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     1183 <IsOnlyDigits+0x73>
jmp    1196 <IsOnlyDigits+0x86>
jmp    1188 <IsOnlyDigits+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <IsOnlyDigits+0x13>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsOnlyDigits>:
push   %rax
call   1030 <strlen@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsOnlyDigits(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ksft_exit_skip(char *);
void nscheck(void) {
  if (access("/proc/self/ns/time", F_OK) < 0)
    ksft_exit_skip("Time namespaces are not supported\n");
}


x86 assembly (clang, -O0):
<nscheck>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <access@plt>
cmp    $0x0,%rax
jge    114f <nscheck+0x2f>
lea    0xec9(%rip),%rdi
call   1030 <ksft_exit_skip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nscheck>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <access@plt>
test   %rax,%rax
js     113d <nscheck+0x1d>
pop    %rax
ret
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <ksft_exit_skip@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/proc/self/ns/time\00"
@F_OK = global i32 0
@.str.1 = [35 x i8] c"Time namespaces are not supported\0A\00"
define void @nscheck() {
%1 = load i32, i32* @F_OK
%2 = call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @ksft_exit_skip(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/proc/self/ns/time\00"
@F_OK = global i32 0
@.str.1 = [35 x i8] c"Time namespaces are not supported\0A\00"
define void @nscheck() {
%1 = load i32, i32* @F_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @ksft_exit_skip(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *ss_realloc(void *ptr, size_t new_size) {
  void *new = realloc(ptr, new_size);
  if (new == NULL) {
    free(ptr);
    ptr = NULL;
    exit(EXIT_FAILURE);
  }
  return new;
}


x86 assembly (clang, -O0):
<ss_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <ss_realloc+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <ss_realloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @ss_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
store i8* null, i8** %3
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @ss_realloc(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 = tail call i32 @free(i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void mmio_write(uint32_t reg, uint32_t data) {
  *(volatile uint32_t *)reg = data;
}


x86 assembly (clang, -O0):
<mmio_write>:
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):
<mmio_write>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @mmio_write(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @mmio_write(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_convert_primary_reg_value_to_bool(void) { gen_call("ccbool"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"ccbool\00"
define void @gen_convert_primary_reg_value_to_bool() {
%1 = call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ccbool\00"
define void @gen_convert_primary_reg_value_to_bool() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vpic_get_codingtype(const uint8_t *p_mp2vpic) {
  return (p_mp2vpic[5] >> 3) & 0x7;
}


x86 assembly (clang, -O0):
<mp2vpic_get_codingtype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
sar    $0x3,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpic_get_codingtype>:
mov    0x14(%rdi),%eax
shr    $0x3,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpic_get_codingtype(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = ashr i32 %5, 3
%7 = and i32 %6, 7
ret i32 %7
}

LLVM IR (-O2):
define i32 @mp2vpic_get_codingtype(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 7
ret i32 %5
}
/* Variables and functions */
int _process_set_inetd_program(int, char *);
int libamg_process_start_inetd_program(char *name) {
  return _process_set_inetd_program(1, name);
}


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

x86 assembly (clang, -O2):
<libamg_process_start_inetd_program>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <_process_set_inetd_program@plt>

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

LLVM IR (-O2):
define i32 @libamg_process_start_inetd_program(i8* %0) {
%2 = tail call i32 @_process_set_inetd_program(i32 1, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void just_exit(int unused) {
  signal(SIGABRT, SIG_DFL);
  abort();
}


x86 assembly (clang, -O0):
<just_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<just_exit>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @just_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGABRT
%4 = load i32, i32* @SIG_DFL
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @just_exit(i32 %0) {
%2 = load i32, i32* @SIGABRT
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %2, i32 %3)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *realpath(char const *, char *);
char *Realpath(const char *_path, char *resolved_path) {
  return realpath(_path, resolved_path);
}


x86 assembly (clang, -O0):
<Realpath>:
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 <realpath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realpath>:
jmp    1030 <realpath@plt>

LLVM IR (-O0):
define i8* @Realpath(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 i8* @realpath(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @Realpath(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @realpath(i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ time_t;
struct stat {
  scalar_t__ st_atime;
};

/* Variables and functions */
scalar_t__ stat(char const *const, struct stat *);
scalar_t__ time(int /*<<< orphan*/ *);
time_t idletime(const char *restrict const tty) {
  struct stat sbuf;
  if (stat(tty, &sbuf) != 0)
    return 0;
  return time(NULL) - sbuf.st_atime;
}


x86 assembly (clang, -O0):
<idletime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1150 <idletime+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1161 <idletime+0x41>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idletime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     1132 <idletime+0x12>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <time@plt>
sub    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @idletime(i8* noalias %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 0, i64* %2
br label %14
9: ; preds = %1
%10 = call i64 @time(i32* null)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sub nsw i64 %10, %12
store i64 %13, i64* %2
br label %14
14: ; preds = %9, %8
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @idletime(i8* noalias %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i64 @time(i32* null)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sub nsw i64 %7, %9
br label %11
11: ; preds = %1, %6
%12 = phi i64 [ %10, %6 ], [ 0, %1 ]
ret i64 %12
}