xunge/DecIR huggingface dataset:
/* Variables and functions */
int Util_sscanbool(const char *s) {
  if (*s == '0' && s[1] == '\0')
    return 0;
  if (*s == '1' && s[1] == '\0')
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<Util_sscanbool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1135 <Util_sscanbool+0x35>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1135 <Util_sscanbool+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1169 <Util_sscanbool+0x69>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1162 <Util_sscanbool+0x62>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1162 <Util_sscanbool+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <Util_sscanbool+0x69>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_sscanbool>:
mov    (%rdi),%al
cmp    $0x31,%al
je     1113 <Util_sscanbool+0x13>
cmp    $0x30,%al
jne    1119 <Util_sscanbool+0x19>
cmpb   $0x0,0x1(%rdi)
jne    1119 <Util_sscanbool+0x19>
xor    %eax,%eax
ret
cmpb   $0x0,0x1(%rdi)
je     111f <Util_sscanbool+0x1f>
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Util_sscanbool(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %11 [
i8 48, label %3
i8 49, label %7
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %11
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %1, %3, %7
br label %12
12: ; preds = %7, %3, %11
%13 = phi i32 [ -1, %11 ], [ 0, %3 ], [ 1, %7 ]
ret i32 %13
}
int test_imm_31int8_reg(signed char val) {
  return ((val) & (-0x31 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_31int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -49
%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_31int8_reg(i8 signext %0) {
%2 = and i8 %0, -49
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ l;

/* Variables and functions */
uint32_t msbtohost32(uint32_t l) {
  return ((uint32_t)((((uint32_t)(l) & (uint32_t)0x000000ffUL) << 24) |
                     (((uint32_t)(l) & (uint32_t)0x0000ff00UL) << 8) |
                     (((uint32_t)(l) & (uint32_t)0x00ff0000UL) >> 8) |
                     (((uint32_t)(l) & (uint32_t)0xff000000UL) >> 24)));
}


x86 assembly (clang, -O0):
<msbtohost32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msbtohost32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @msbtohost32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = ashr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @msbtohost32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ print_str(char *);
void task1_func(void) {
  print_str("task1: Created!\n");
  while (1) {
    print_str("task1: Running...\n");
    delay(1000);
  }
}


x86 assembly (clang, -O0):
<task1_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <print_str@plt>
lea    0xeda(%rip),%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1130 <task1_func+0x10>

x86 assembly (clang, -O2):
<task1_func>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <print_str@plt>
lea    0xedd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <print_str@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
jmp    1140 <task1_func+0x20>

LLVM IR (-O0):
@.str = [17 x i8] c"task1: Created!\0A\00"
@.str.1 = [19 x i8] c"task1: Running...\0A\00"
define void @task1_func() {
%1 = call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @delay(i32 1000)
br label %2
}

LLVM IR (-O2):
@.str = [17 x i8] c"task1: Created!\0A\00"
@.str.1 = [19 x i8] c"task1: Running...\0A\00"
define void @task1_func() {
%1 = tail call i32 @print_str(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @print_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @delay(i32 1000)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ CG_ClearDlights();
int /*<<< orphan*/ CG_ClearFragmentedDecals();
int /*<<< orphan*/ CG_ClearLightStyles();
int /*<<< orphan*/ CG_ClearParticles();
int /*<<< orphan*/ CG_ClearShadeBoxes();
void CG_ClearEffects(void) {
  CG_ClearFragmentedDecals();
  CG_ClearParticles();
  CG_ClearDlights();
  CG_ClearLightStyles();
  CG_ClearShadeBoxes();
}


x86 assembly (clang, -O0):
<CG_ClearEffects>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <CG_ClearFragmentedDecals@plt>
mov    $0x0,%al
call   1070 <CG_ClearParticles@plt>
mov    $0x0,%al
call   1030 <CG_ClearDlights@plt>
mov    $0x0,%al
call   1050 <CG_ClearLightStyles@plt>
mov    $0x0,%al
call   1040 <CG_ClearShadeBoxes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_ClearEffects>:
push   %rax
xor    %eax,%eax
call   1060 <CG_ClearFragmentedDecals@plt>
xor    %eax,%eax
call   1070 <CG_ClearParticles@plt>
xor    %eax,%eax
call   1030 <CG_ClearDlights@plt>
xor    %eax,%eax
call   1050 <CG_ClearLightStyles@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CG_ClearShadeBoxes@plt>

LLVM IR (-O0):
define void @CG_ClearEffects() {
%1 = call i32 (...) @CG_ClearFragmentedDecals()
%2 = call i32 (...) @CG_ClearParticles()
%3 = call i32 (...) @CG_ClearDlights()
%4 = call i32 (...) @CG_ClearLightStyles()
%5 = call i32 (...) @CG_ClearShadeBoxes()
ret void
}

LLVM IR (-O2):
define void @CG_ClearEffects() {
%1 = tail call i32 (...) @CG_ClearFragmentedDecals()
%2 = tail call i32 (...) @CG_ClearParticles()
%3 = tail call i32 (...) @CG_ClearDlights()
%4 = tail call i32 (...) @CG_ClearLightStyles()
%5 = tail call i32 (...) @CG_ClearShadeBoxes()
ret void
}
void I2CMasterDisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0xA4)))) &= ~((0x00008000u));
}


x86 assembly (clang, -O0):
<I2CMasterDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffff7fff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDisable>:
add    $0xa4,%edi
andl   $0xffff7fff,(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 164
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -32769
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CMasterDisable(i32 %0) {
%2 = add i32 %0, 164
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -32769
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(struct tm *, struct tm *, int);
struct tm *gmtime_r(const time_t *t, struct tm *r) {
  struct tm *temp;
  temp = gmtime(t);
  memcpy(r, temp, sizeof(struct tm));
  return r;
}


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

x86 assembly (clang, -O2):
<gmtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1040 <gmtime@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%6 = load i32*, i32** %3
%7 = call %struct.tm* @gmtime(i32* %6)
store %struct.tm* %7, %struct.tm** %5
%8 = load %struct.tm*, %struct.tm** %4
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @memcpy(%struct.tm* %8, %struct.tm* %9, i32 4)
%11 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* returned %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = tail call i32 @memcpy(%struct.tm* %1, %struct.tm* %3, i32 4)
ret %struct.tm* %1
}
/* Type definitions */
struct nlattr {
  int nla_len;
};

/* Variables and functions */
int NLA_HDRLEN;
int libbpf_nla_len(const struct nlattr *nla) {
  return nla->nla_len - NLA_HDRLEN;
}


x86 assembly (clang, -O0):
<libbpf_nla_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libbpf_nla_len>:
mov    (%rdi),%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
@NLA_HDRLEN = global i32 0
define i32 @libbpf_nla_len(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @NLA_HDRLEN
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
@NLA_HDRLEN = global i32 0
define i32 @libbpf_nla_len(%struct.nlattr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @NLA_HDRLEN
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
void unaligned_write_le64(void *_u, uint64_t a) {
  struct __attribute__((packed, may_alias)) {
    uint64_t x;
  } *u = _u;
  u->x = le64toh(a);
}


x86 assembly (clang, -O0):
<unaligned_write_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <le64toh@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_le64>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <le64toh@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_le64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @le64toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_le64(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @le64toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
size_t get_filesize(FILE *handle) {
  long size = 0;
  long old_pos = ftell(handle);
  fseek(handle, 0, SEEK_END);
  size = ftell(handle);
  fseek(handle, old_pos, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_filesize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %3
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %3
%12 = load i32*, i32** %2
%13 = load i64, i64* %4
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @get_filesize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
char *xmalloc(n)
unsigned n;
{
  char *p;
  p = malloc(n);
  if (p == 0) {
    error(0, 0, "virtual memory exhausted");
    cleanup();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <xmalloc+0x3d>
xor    %esi,%esi
lea    0xea3(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   1040 <error@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <xmalloc+0x29>
lea    0xeb9(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <error@plt>
xor    %eax,%eax
call   1050 <cleanup@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @cleanup()
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xmalloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @cleanup()
br label %8
8: ; preds = %5, %1
ret i8* %3
}
void nseel_asm_add_op_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_add_op_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, void *, int);
scalar_t__ getpid();
int /*<<< orphan*/ stderr;
void *write_blockf(void *, int);
void *write_block(void *p, int x) {
  fprintf(stderr, "[%d] write_block(%p, %d)\n", (int)getpid(), p, x);
  return write_blockf(p, x);
}


x86 assembly (clang, -O0):
<write_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <write_blockf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_block>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%r14d
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaf(%rip),%rsi
mov    %r14d,%edi
mov    %eax,%edx
mov    %rbx,%rcx
mov    %ebp,%r8d
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <write_blockf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"[%d] write_block(%p, %d)\0A\00"
define i8* @write_block(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i64 (...) @getpid()
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i32 %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i8* @write_blockf(i8* %11, i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"[%d] write_block(%p, %d)\0A\00"
define i8* @write_block(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i64 (...) @getpid()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %0, i32 %1)
%7 = tail call i8* @write_blockf(i8* %0, i32 %1)
ret i8* %7
}
void metric_shift(const double x[3], double b[3]) {
  b[0] = 0.0;
  b[1] = 0.0;
  b[2] = 0.0;
}


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

x86 assembly (clang, -O2):
<metric_shift>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rsi)
movq   $0x0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @metric_shift(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 0.000000e+00, double* %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 1
store double 0.000000e+00, double* %8
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 2
store double 0.000000e+00, double* %10
ret void
}

LLVM IR (-O2):
define void @metric_shift(double* nocapture readnone %0, double* nocapture writeonly %1) {
%3 = bitcast double* %1 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("*%d*\n", 959);
  printf("*%2d*\n", 959);
  printf("*%4d*\n", 959);
  printf("*%-4d*\n", 959);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x3bf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"*%d*\0A\00"
@.str.1 = [7 x i8] c"*%2d*\0A\00"
@.str.2 = [7 x i8] c"*%4d*\0A\00"
@.str.3 = [8 x i8] c"*%-4d*\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 959)
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 959)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 959)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 959)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"*%d*\0A\00"
@.str.1 = [7 x i8] c"*%2d*\0A\00"
@.str.2 = [7 x i8] c"*%4d*\0A\00"
@.str.3 = [8 x i8] c"*%-4d*\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 959)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 959)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 959)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 959)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse();
int main() {
  parse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @parse()
ret i32 0
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_READER_DRE(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_READER_DRE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @config_READER_DRE() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_READER_DRE() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned char port_byte_in(unsigned short port) {
  unsigned char ret;
  __asm__("in %%dx, %%al" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<port_byte_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_byte_in>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @port_byte_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @port_byte_in(i16 zeroext %0) {
%2 = tail call i8 asm "in %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int machine_instr_req_privilege(int opcode) {
  if (opcode >= 23 && opcode <= 34)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<machine_instr_req_privilege>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x17,-0x8(%rbp)
jl     1127 <machine_instr_req_privilege+0x27>
cmpl   $0x22,-0x8(%rbp)
jg     1127 <machine_instr_req_privilege+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <machine_instr_req_privilege+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<machine_instr_req_privilege>:
add    $0xffffffe9,%edi
xor    %eax,%eax
cmp    $0xc,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @machine_instr_req_privilege(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 23
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 34
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @machine_instr_req_privilege(i32 %0) {
%2 = add i32 %0, -23
%3 = icmp ult i32 %2, 12
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSIGNALED(int);
int /*<<< orphan*/ exit_wrapper(int);
int /*<<< orphan*/ kill(int, int);
void handle_sig(int pid, int status) {
  if (WIFEXITED(status)) {
    exit_wrapper(WEXITSTATUS(status));
  } else if (WIFSIGNALED(status)) {
    kill(pid, 9);
    exit_wrapper(1);
  }
}


x86 assembly (clang, -O0):
<handle_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1184 <handle_sig+0x34>
mov    -0x8(%rbp),%edi
call   1060 <WEXITSTATUS@plt>
mov    %eax,%edi
call   1030 <exit_wrapper@plt>
jmp    11b2 <handle_sig+0x62>
mov    -0x8(%rbp),%edi
call   1040 <WIFSIGNALED@plt>
cmp    $0x0,%rax
je     11ad <handle_sig+0x5d>
mov    -0x4(%rbp),%edi
mov    $0x9,%esi
call   1050 <kill@plt>
mov    $0x1,%edi
call   1030 <exit_wrapper@plt>
jmp    11b2 <handle_sig+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sig>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    %esi,%edi
call   1070 <WIFEXITED@plt>
mov    %ebp,%edi
test   %rax,%rax
je     116e <handle_sig+0x1e>
call   1060 <WEXITSTATUS@plt>
mov    %eax,%edi
jmp    1189 <handle_sig+0x39>
call   1040 <WIFSIGNALED@plt>
test   %rax,%rax
je     1194 <handle_sig+0x44>
mov    %ebx,%edi
mov    $0x9,%esi
call   1050 <kill@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <exit_wrapper@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @handle_sig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @WIFEXITED(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @WEXITSTATUS(i32 %9)
%11 = call i32 @exit_wrapper(i32 %10)
br label %21
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i64 @WIFSIGNALED(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32, i32* %3
%18 = call i32 @kill(i32 %17, i32 9)
%19 = call i32 @exit_wrapper(i32 1)
br label %20
20: ; preds = %16, %12
br label %21
21: ; preds = %20, %8
ret void
}

LLVM IR (-O2):
define void @handle_sig(i32 %0, i32 %1) {
%3 = tail call i64 @WIFEXITED(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @WEXITSTATUS(i32 %1)
br label %12
7: ; preds = %2
%8 = tail call i64 @WIFSIGNALED(i32 %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %7
%11 = tail call i32 @kill(i32 %0, i32 9)
br label %12
12: ; preds = %5, %10
%13 = phi i32 [ 1, %10 ], [ %6, %5 ]
%14 = tail call i32 @exit_wrapper(i32 %13)
br label %15
15: ; preds = %12, %7
ret void
}
void setAddress(int *entry, int address) { *(entry + 6) = address; }


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

x86 assembly (clang, -O2):
<setAddress>:
mov    %esi,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @setAddress(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall_cp(int (*)(int, struct sockaddr *, int /*<<< orphan*/ *), int,
                  struct sockaddr *, int /*<<< orphan*/ *, int /*<<< orphan*/,
                  int /*<<< orphan*/, int /*<<< orphan*/);
int accept(int fd, struct sockaddr *addr, socklen_t *len) {
  return socketcall_cp(accept, fd, addr, len, 0, 0, 0);
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    0x2eab(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall_cp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2eb9(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall_cp@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @socketcall_cp(i32 (i32, %struct.sockaddr*, i32*)* @accept, i32 %7, %struct.sockaddr* %8, i32* %9, i32 0, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @socketcall_cp(i32 (i32, %struct.sockaddr*, i32*)* @accept, i32 %0, %struct.sockaddr* %1, i32* %2, i32 0, i32 0, i32 0)
ret i32 %4
}
int emac1_etherstatspkts256to511octets_set(
    unsigned int dev_id, union emac1_etherstatspkts256to511octets_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_etherstatspkts256to511octets_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_etherstatspkts256to511octets_u = type opaque
define i32 @emac1_etherstatspkts256to511octets_set(i32 %0, %union.emac1_etherstatspkts256to511octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts256to511octets_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts256to511octets_u* %1, %union.emac1_etherstatspkts256to511octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts256to511octets_u = type opaque
define i32 @emac1_etherstatspkts256to511octets_set(i32 %0, %union.emac1_etherstatspkts256to511octets_u* nocapture readnone %1) {
ret i32 1
}
void fill_digits(int digit[], int nrd, int n) {
  int ix = nrd - 1;
  while (n > 0) {
    digit[ix--] = n % 10;
    n /= 10;
  }
}


x86 assembly (clang, -O0):
<fill_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1154 <fill_digits+0x54>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    1117 <fill_digits+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_digits>:
test   %edx,%edx
jle    1141 <fill_digits+0x41>
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
add    $0xfffffffffffffffc,%rax
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %edx,%ecx
sub    %edi,%ecx
mov    %ecx,(%rax)
add    $0xfffffffffffffffc,%rax
cmp    $0x9,%edx
mov    %esi,%edx
ja     1120 <fill_digits+0x20>
ret

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

LLVM IR (-O2):
define void @fill_digits(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %10, %7 ]
%9 = phi i32 [ %2, %5 ], [ %13, %7 ]
%10 = add i64 %8, -1
%11 = urem i32 %9, 10
%12 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %11, i32* %12
%13 = udiv i32 %9, 10
%14 = icmp ult i32 %9, 10
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
void INT_Excep_RIIC0_ICTXI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC0_ICTXI0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *const);
scalar_t__ strlen(char const *const);
char *zmalloc(scalar_t__);
char *zstrdup(const char *const s) {
  char *p = zmalloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<zstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <zmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <zmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @zstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @zmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @zstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @zmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void _trace_callback() {}


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

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

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

LLVM IR (-O2):
define void @_trace_callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FatalErrnoError(int, int, char *);
int socket(int, int, int);
int Esocket(int domain, int type, int protocol) {
  int res = socket(domain, type, protocol);
  FatalErrnoError(res == -1, 1, "socket()");
  return res;
}


x86 assembly (clang, -O0):
<Esocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x1,%esi
lea    0xea6(%rip),%rdx
call   1030 <FatalErrnoError@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Esocket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
lea    0xec8(%rip),%rdx
mov    $0x1,%esi
call   1030 <FatalErrnoError@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"socket()\00"
define i32 @Esocket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
%14 = zext i1 %13 to i32
%15 = call i32 @FatalErrnoError(i32 %14, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"socket()\00"
define i32 @Esocket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = tail call i32 @FatalErrnoError(i32 %6, i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int, int, int, int, int, int);
int direct_write(const unsigned char *data, int base, int offset, int size,
                 int blocksize, int first_offset, int overall_size) {
  (void)data;
  print("\t(template driver) direct_write(data, base=0x%x, offset=0x%x, "
        "size=0x%x, blocksize=0x%x, first_offset=0x%x, overall_size=0x%x)\n",
        base, offset, size, blocksize, first_offset, overall_size);
  return 0;
}


x86 assembly (clang, -O0):
<direct_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%eax
lea    0xeb5(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_write>:
push   %rax
mov    0x10(%rsp),%eax
mov    %eax,(%rsp)
lea    0xee1(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [128 x i8] c"\09(template driver) direct_write(data, base=0x%x, offset=0x%x, size=0x%x, blocksize=0x%x, first_offset=0x%x, overall_size=0x%x)\0A\00"
define i32 @direct_write(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @print(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [128 x i8] c"\09(template driver) direct_write(data, base=0x%x, offset=0x%x, size=0x%x, blocksize=0x%x, first_offset=0x%x, overall_size=0x%x)\0A\00"
define i32 @direct_write(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @print(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t bytes_r16le(const uint8_t *data) {
  return ((uint16_t)data[0]) | (((uint16_t)data[1]) << 8);
}


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

x86 assembly (clang, -O2):
<bytes_r16le>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bytes_r16le(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @bytes_r16le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void RTNetIPv6PseudoChecksumEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv6PseudoChecksumEx() {
ret void
}
void ble_rsp_flash_ps_defrag(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_flash_ps_defrag(i8* nocapture %0) {
ret void
}
void gdk_pango_layout_line_get_clip_region() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pango_layout_line_get_clip_region() {
ret void
}
/* Variables and functions */
char *strchr(char *, int);
size_t strcnt(const char *s, int c) {
  size_t n = 0;
  char *s2 = (char *)s;
  while ((s2 = strchr(s2, c)) != NULL) {
    s2++;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<strcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <strcnt+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <strcnt+0x1f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcnt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1147 <strcnt+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0x1,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <strcnt+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @strcnt(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i64 %7, 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %8, i32 %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i64 [ 0, %2 ], [ %9, %5 ]
ret i64 %13
}
void many_compiled() {
  int i;
  if (0)
    if (0)
      if (0)
        if (0)
          if (0)
            if (0)
              if (0)
                if (0)
                  if (0)
                    if (0)
                      1;
}


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

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

LLVM IR (-O0):
define void @many_compiled() {
%1 = alloca i32
ret void
}

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