xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ send_privmsg(int, char *, char *);
char *strcat(char *, char *);
void send_action(int fd, char *target, char *message) {
  send_privmsg(fd, target, strcat("ACTION", strcat(message, "")));
}


x86 assembly (clang, -O0):
<send_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <strcat@plt>
mov    %rax,%rsi
lea    0xea5(%rip),%rdi
call   1040 <strcat@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1030 <send_privmsg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_action>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
movw   $0x1,(%rbx,%rax,1)
lea    0xeac(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <send_privmsg@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\01ACTION\00"
@.str.1 = [2 x i8] c"\01\00"
define void @send_action(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = call i8* @strcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @send_privmsg(i32 %7, i8* %8, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\01ACTION\00"
define void @send_action(i32 %0, i8* %1, i8* nocapture %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = getelementptr i8, i8* %2, i64 %4
%6 = bitcast i8* %5 to i16*
store i16 1, i16* %6
%7 = tail call i8* @strcat(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %2)
%8 = tail call i32 @send_privmsg(i32 %0, i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct btf_type {
  int /*<<< orphan*/ info;
};
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ BTF_INFO_KIND(int /*<<< orphan*/);
__u16 btf_kind(const struct btf_type *t) { return BTF_INFO_KIND(t->info); }


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

x86 assembly (clang, -O2):
<btf_kind>:
mov    (%rdi),%edi
jmp    1030 <BTF_INFO_KIND@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_kind(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @BTF_INFO_KIND(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_kind(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INFO_KIND(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ sw_fill(int);
void sw_fill_test(void **state) {
  assert_int_equal(sw_fill(0x8000000000000000ul), 0x8040201008040201ul);
}


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

x86 assembly (clang, -O2):
<sw_fill_test>:
push   %rax
xor    %edi,%edi
call   1030 <sw_fill@plt>
mov    %eax,%edi
mov    $0x8040201,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @sw_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @sw_fill(i32 0)
%4 = call i32 @assert_int_equal(i32 %3, i32 134480385)
ret void
}

LLVM IR (-O2):
define void @sw_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @sw_fill(i32 0)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 134480385)
ret void
}
/* Variables and functions */
int perfect(long);
int /*<<< orphan*/ printf(char *, long);
void main(void) {
  long number;
  for (number = 2; number <= 10000000; number++) {
    if (1 == perfect(number)) {
      printf("%ld\n", number);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x8(%rbp)
cmpq   $0x989680,-0x8(%rbp)
jg     117c <main+0x5c>
mov    -0x8(%rbp),%rdi
call   1030 <perfect@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1166 <main+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
jmp    116b <main+0x4b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <main+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
jmp    114d <main+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x989681,%rbx
je     1167 <main+0x47>
mov    %rbx,%rdi
call   1030 <perfect@plt>
cmp    $0x1,%eax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i64 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i32 @perfect(i64 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i64 %2, 1
%9 = icmp eq i64 %8, 10000001
br i1 %9, label %10, label %1
10: ; preds = %7
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
unsigned int le24put(void *p, uint32_t v) {
  uint8_t *a;
  a = p;
  a[0] = v;
  a[1] = v >> 8;
  a[2] = v >> 16;
  return 3;
}


x86 assembly (clang, -O0):
<le24put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le24put>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
sar    $0x10,%esi
mov    %esi,0x8(%rdi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @le24put(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*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
ret i32 3
}

LLVM IR (-O2):
define i32 @le24put(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = ashr i32 %1, 16
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret i32 3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void to_bytes(uint64_t from, uint8_t to[8]) {
  for (int i = 0; i < 8; i++) {
    to[7 - i] = (from >> (i * 8)) & 0xff;
  }
}


x86 assembly (clang, -O0):
<to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114d <to_bytes+0x4d>
mov    -0x4(%rbp),%edx
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%edx
and    $0xff,%edx
mov    -0x10(%rbp),%rax
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <to_bytes+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_bytes>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,0x1c(%rsi)
movzbl %ah,%ecx
mov    %ecx,0x18(%rsi)
mov    %edi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x14(%rsi)
shr    $0x18,%eax
mov    %eax,0x10(%rsi)
ret

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

LLVM IR (-O2):
define void @to_bytes(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
%4 = getelementptr inbounds i32, i32* %1, i64 7
store i32 %3, i32* %4
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %1, i64 6
store i32 %6, i32* %7
%8 = lshr i32 %0, 16
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %9, i32* %10
%11 = lshr i32 %0, 24
%12 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %11, i32* %12
ret void
}
void modbus_ext_set_state(const struct modbus_ext_status *status) {}


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

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

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

LLVM IR (-O2):
%struct.modbus_ext_status = type opaque
define void @modbus_ext_set_state(%struct.modbus_ext_status* nocapture %0) {
ret void
}
int test_imm_8Cint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x8c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Cint64_highword_mem>:
testb  $0x8c,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Cint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 140
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_8Cint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 601295421440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void sigsys_handler(int signo) {
  errx(1, "System V Message Queue support is not present in the kernel");
}


x86 assembly (clang, -O0):
<sigsys_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsys_handler>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"System V Message Queue support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @errx(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"System V Message Queue support is not present in the kernel\00"
define void @sigsys_handler(i32 %0) {
%2 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
void cornerperm_unpack(cperm, array_out) int cperm, array_out[8];
{
  perm_n_unpack(8, cperm, array_out);
  return;
}


x86 assembly (clang, -O0):
<cornerperm_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x8,%edi
mov    $0x0,%al
call   1030 <perm_n_unpack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cornerperm_unpack>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x8,%edi
xor    %eax,%eax
jmp    1030 <perm_n_unpack@plt>

LLVM IR (-O0):
define void @cornerperm_unpack(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @perm_n_unpack to i32 (i32, i32, i32*, ...)*)(i32 8, i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @cornerperm_unpack(i32 %0, i32* %1) {
%3 = tail call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @perm_n_unpack to i32 (i32, i32, i32*, ...)*)(i32 8, i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trace(char *);
int bar(void) {
  trace("libbar");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"libbar\00"
define i32 @bar() {
%1 = tail call i32 @trace(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int TableSize(int m, int bw) {
  return (((bw / 2) * ((bw / 2) + 1)) - ((m / 2) * ((m / 2) + 1)) -
          ((bw / 2) * (m % 2)));
}


x86 assembly (clang, -O0):
<TableSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x10(%rbp),%eax
add    $0x1,%edx
imul   %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TableSize>:
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
mov    %eax,%edx
sar    %edx
mov    %edx,%esi
not    %esi
imul   %edx,%esi
and    $0xfffffffe,%eax
sub    %edi,%eax
add    %ecx,%eax
add    $0x1,%eax
imul   %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @TableSize(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 = sdiv i32 %5, 2
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %6, %9
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 2
%15 = add nsw i32 %14, 1
%16 = mul nsw i32 %12, %15
%17 = sub nsw i32 %10, %16
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 2
%20 = load i32, i32* %3
%21 = srem i32 %20, 2
%22 = mul nsw i32 %19, %21
%23 = sub nsw i32 %17, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @TableSize(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %0, 2
%6 = xor i32 %5, -1
%7 = mul i32 %5, %6
%8 = srem i32 %0, 2
%9 = sub nsw i32 %4, %8
%10 = mul i32 %9, %3
%11 = add i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int SEEK_SET;
int ws_get_SEEK_SET() { return SEEK_SET; }


x86 assembly (clang, -O0):
<ws_get_SEEK_SET>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_get_SEEK_SET>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @ws_get_SEEK_SET() {
%1 = load i32, i32* @SEEK_SET
ret i32 %1
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @ws_get_SEEK_SET() {
%1 = load i32, i32* @SEEK_SET
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double deg, rad;
  printf("Podaj kat w stopniach : ");
  scanf("%lf", &deg);
  rad = 2 * 3.14159265358979323846 * deg / 360;
  printf("%.4f deg = %.4f rad\n", deg, rad);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeba(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xeb1(%rip),%xmm1
lea    0xecf(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double 0x401921FB54442D18, %5
%7 = fdiv double %6, 3.600000e+02
store double %7, double* %2
%8 = load double, double* %1
%9 = load double, double* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %8, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Podaj kat w stopniach : \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c"%.4f deg = %.4f rad\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, 0x401921FB54442D18
%7 = fdiv double %6, 3.600000e+02
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %5, double %7)
ret i32 0
}
/* Variables and functions */
int GetDataWidth(int);
int GetDataNBlock(int w) { return GetDataWidth(w) / 64; }


x86 assembly (clang, -O0):
<GetDataNBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetDataWidth@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDataNBlock>:
push   %rax
call   1030 <GetDataWidth@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GetDataNBlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @GetDataWidth(i32 %3)
%5 = sdiv i32 %4, 64
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetDataNBlock(i32 %0) {
%2 = tail call i32 @GetDataWidth(i32 %0)
%3 = sdiv i32 %2, 64
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle27() { kprintf("ISR %d.\n", 27); }


x86 assembly (clang, -O0):
<isrHandle27>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle27>:
lea    0xee9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle27() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle27() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
void vifm_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @vifm_restart() {
ret void
}
/* Type definitions */
struct oop_readable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oop_free(struct oop_readable *);
void delete_kill(struct oop_readable *ra) { oop_free(ra); }


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

x86 assembly (clang, -O2):
<delete_kill>:
jmp    1030 <oop_free@plt>

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

LLVM IR (-O2):
%struct.oop_readable = type { i32 }
define void @delete_kill(%struct.oop_readable* %0) {
%2 = tail call i32 @oop_free(%struct.oop_readable* %0)
ret void
}
int main() {
  int ret = 0;
  int i = 2;
  ret = i++;
  ret = ++i;
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_csharp_comments() {
  test_parser_verify_parse(test_parser_sourcefile("csharp", " //comment"),
                           "csharp", "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_csharp_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csharp_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"csharp\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_csharp_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"csharp\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_csharp_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
unsigned char svg_it_rgb(double x) {
  x *= 256;
  if (x > 255)
    x = 255;
  if (x < 0)
    x = 0;
  return x;
}


x86 assembly (clang, -O0):
<svg_it_rgb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113f <svg_it_rgb+0x3f>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1155 <svg_it_rgb+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svg_it_rgb>:
mulsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i8 @svg_it_rgb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.560000e+02
store double %4, double* %2
%5 = load double, double* %2
%6 = fcmp ogt double %5, 2.550000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store double 2.550000e+02, double* %2
br label %8
8: ; preds = %7, %1
%9 = load double, double* %2
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double 0.000000e+00, double* %2
br label %12
12: ; preds = %11, %8
%13 = load double, double* %2
%14 = fptoui double %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @svg_it_rgb(double %0) {
%2 = fmul double %0, 2.560000e+02
%3 = fcmp ogt double %2, 2.550000e+02
%4 = select i1 %3, double 2.550000e+02, double %2
%5 = fcmp olt double %4, 0.000000e+00
%6 = select i1 %5, double 0.000000e+00, double %4
%7 = fptoui double %6 to i8
ret i8 %7
}
void tegra_tsc_suspend(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_tsc_suspend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
void clearscreen() { clrscr(); }


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

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

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

LLVM IR (-O2):
define void @clearscreen() {
%1 = tail call i32 (...) @clrscr()
ret void
}
int d_ne_mr2(double *a1, double a2) { return !(((*a1) != (a2))); }


x86 assembly (clang, -O0):
<d_ne_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ne_mr2>:
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_ne_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp une double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ne_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp oeq double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
void xl(void) {
  static int j3;
  for (j3 = 0; j3 < 1; ++j3) {
    static int f2;
    static int w7;
    short int b5;
    int ok;
    f2 = (b5 += ok) ? (w7 = 0) : (w7 ? 0 : (f2 = ok));
  }
}


x86 assembly (clang, -O0):
<xl>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,0x2f16(%rip)
cmpl   $0x1,0x2f0f(%rip)
jge    118c <xl+0x8c>
mov    -0x8(%rbp),%ecx
movswl -0x2(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
cwtl
cmp    $0x0,%eax
je     1146 <xl+0x46>
movl   $0x0,0x2ef0(%rip)
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    116f <xl+0x6f>
cmpl   $0x0,0x2edf(%rip)
je     115d <xl+0x5d>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <xl+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,0x2ec2(%rip)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,0x2eb0(%rip)
mov    0x2ea6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e9d(%rip)
jmp    110e <xl+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
@xl.j3 = internal global i32 0
@xl.f2 = internal global i32 0
@xl.w7 = internal global i32 0
define void @xl() {
%1 = alloca i16
%2 = alloca i32
store i32 0, i32* @xl.j3
br label %3
3: ; preds = %25, %0
%4 = load i32, i32* @xl.j3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %28
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i16, i16* %1
%9 = sext i16 %8 to i32
%10 = add nsw i32 %9, %7
%11 = trunc i32 %10 to i16
store i16 %11, i16* %1
%12 = sext i16 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %6
store i32 0, i32* @xl.w7
br label %23
15: ; preds = %6
%16 = load i32, i32* @xl.w7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
br label %21
19: ; preds = %15
%20 = load i32, i32* %2
store i32 %20, i32* @xl.f2
br label %21
21: ; preds = %19, %18
%22 = phi i32 [ 0, %18 ], [ %20, %19 ]
br label %23
23: ; preds = %21, %14
%24 = phi i32 [ 0, %14 ], [ %22, %21 ]
store i32 %24, i32* @xl.f2
br label %25
25: ; preds = %23
%26 = load i32, i32* @xl.j3
%27 = add nsw i32 %26, 1
store i32 %27, i32* @xl.j3
br label %3
28: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @xl() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ const *, int);
__attribute__((visibility("default"))) int
osal_is_directory(const wchar_t *_name) {
  char name[260 + 1];
  wcstombs(name, _name, 260);
  DIR *dir;
  dir = opendir(name);
  if (dir != NULL) {
    closedir(dir);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<osal_is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x104,%edx
call   1050 <wcstombs@plt>
lea    -0x120(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     118d <osal_is_directory+0x5d>
mov    -0x128(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1194 <osal_is_directory+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osal_is_directory>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x104,%edx
call   1050 <wcstombs@plt>
mov    %rbx,%rdi
call   1030 <opendir@plt>
test   %rax,%rax
je     1167 <osal_is_directory+0x37>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
jmp    1169 <osal_is_directory+0x39>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @osal_is_directory(i32* %0) {
%2 = alloca [261 x i8]
%3 = getelementptr inbounds [261 x i8], [261 x i8]* %2, i64 0, i64 0
%4 = call i32 @wcstombs(i8* %3, i32* %0, i32 260)
%5 = call i32* @opendir(i8* %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @closedir(i32* %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 1, %7 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyVec2f_init(void) {
  _hmt_register_covercase("HMM_MultiplyVec2f", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_MultiplyVec2f_init>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"HMM_MultiplyVec2f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec2f_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HMM_MultiplyVec2f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec2f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor4f(double, double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(double, double, double);
void alpha_drawLeftTriangle(void) {
  glBegin(GL_TRIANGLES);
  glColor4f(1.0, 1.0, 0.0, 0.75);
  glVertex3f(0.1, 0.9, 0.0);
  glVertex3f(0.1, 0.1, 0.0);
  glVertex3f(0.7, 0.5, 0.0);
  glEnd();
}


x86 assembly (clang, -O0):
<alpha_drawLeftTriangle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xec6(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  0xec3(%rip),%xmm3
movaps %xmm1,%xmm0
call   1030 <glColor4f@plt>
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
movsd  0xe83(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
call   1040 <glVertex3f@plt>
movsd  0xe60(%rip),%xmm0
movsd  0xe60(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
mov    $0x0,%al
call   1050 <glEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_drawLeftTriangle>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
movsd  0xea9(%rip),%xmm0
movsd  0xea9(%rip),%xmm3
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
call   1030 <glColor4f@plt>
movsd  0xe9e(%rip),%xmm0
movsd  0xe9e(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xorps  %xmm2,%xmm2
movsd  0xe83(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <glVertex3f@plt>
movsd  0xe83(%rip),%xmm0
movsd  0xe83(%rip),%xmm1
xorps  %xmm2,%xmm2
call   1040 <glVertex3f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLES = global i32 0
define void @alpha_drawLeftTriangle() {
%1 = load i32, i32* @GL_TRIANGLES
%2 = call i32 @glBegin(i32 %1)
%3 = call i32 @glColor4f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 7.500000e-01)
%4 = call i32 @glVertex3f(double 1.000000e-01, double 9.000000e-01, double 0.000000e+00)
%5 = call i32 @glVertex3f(double 1.000000e-01, double 1.000000e-01, double 0.000000e+00)
%6 = call i32 @glVertex3f(double 0x3FE6666666666666, double 5.000000e-01, double 0.000000e+00)
%7 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_TRIANGLES = global i32 0
define void @alpha_drawLeftTriangle() {
%1 = load i32, i32* @GL_TRIANGLES
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glColor4f(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 7.500000e-01)
%4 = tail call i32 @glVertex3f(double 1.000000e-01, double 9.000000e-01, double 0.000000e+00)
%5 = tail call i32 @glVertex3f(double 1.000000e-01, double 1.000000e-01, double 0.000000e+00)
%6 = tail call i32 @glVertex3f(double 0x3FE6666666666666, double 5.000000e-01, double 0.000000e+00)
%7 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
int nrf_drv_usbd_errata_type_52840_proto1();
bool nrf_drv_usbd_errata_154(void) {
  return nrf_drv_usbd_errata_type_52840_proto1();
}


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

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

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

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_154() {
%1 = tail call i32 (...) @nrf_drv_usbd_errata_type_52840_proto1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ region_write(int, int, int, int);
void nf_clear_rb(void) { region_write((0xB0E00000 + 0x28), 0x1, 4, 1); }


x86 assembly (clang, -O0):
<nf_clear_rb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0e00028,%edi
mov    $0x1,%ecx
mov    $0x4,%edx
mov    %ecx,%esi
call   1030 <region_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_clear_rb>:
mov    $0xb0e00028,%edi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <region_write@plt>

LLVM IR (-O0):
define void @nf_clear_rb() {
%1 = call i32 @region_write(i32 -1327497176, i32 1, i32 4, i32 1)
ret void
}

LLVM IR (-O2):
define void @nf_clear_rb() {
%1 = tail call i32 @region_write(i32 -1327497176, i32 1, i32 4, i32 1)
ret void
}
void ble_rsp_connection_raw_tx(
    const struct ble_msg_connection_raw_tx_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_connection_raw_tx_rsp_t = type opaque
define void @ble_rsp_connection_raw_tx(%struct.ble_msg_connection_raw_tx_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x87() {
  Assert_real((isxdigit(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              680, ("isxdigit should be 0 for 0x87"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x87>:
push   %rbp
mov    %rsp,%rbp
mov    $0x87,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a8,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x87>:
push   %rax
mov    $0x87,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2a8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x87\00"
define void @t_isxdigit_0x87() {
%1 = call i64 @isxdigit(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x87\00"
define void @t_isxdigit_0x87() {
%1 = tail call i64 @isxdigit(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char is_operand(char c) {
  if (c == '+' || c == '-' || c == '*' || c == '/') {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<is_operand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x2b,%eax
je     113e <is_operand+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x2d,%eax
je     113e <is_operand+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x2a,%eax
je     113e <is_operand+0x3e>
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    1147 <is_operand+0x47>
movb   $0x1,-0x1(%rbp)
jmp    114b <is_operand+0x4b>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operand>:
add    $0xd6,%dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%ecx
movabs $0x10001000101,%rax
shr    %cl,%rax
xor    %ecx,%ecx
cmp    $0x6,%dl
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @is_operand(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
%4 = zext i8 %2 to i48
%5 = shl nuw nsw i48 %4, 3
%6 = lshr i48 1099528405249, %5
%7 = trunc i48 %6 to i8
%8 = select i1 %3, i8 %7, i8 0
ret i8 %8
}
int hw_comp(const int fd_dev, const char *pattern, const int start_blk,
            const int blks) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @hw_comp(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @hw_comp(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
int dsp_mmu_itack(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dsp_mmu_itack() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  thr1(0);
__CPROVER_ASYNC_1:
  thr2(0);
__CPROVER_ASYNC_2:
  thr3(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <main+0x9>
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1040 <thr2@plt>
xor    %edi,%edi
call   1050 <thr3@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1040 <thr2@plt>
xor    %edi,%edi
call   1050 <thr3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 @thr1(i32 0)
br label %3
3: ; preds = %1
%4 = call i32 @thr2(i32 0)
br label %5
5: ; preds = %3
%6 = call i32 @thr3(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr1(i32 0)
%2 = tail call i32 @thr2(i32 0)
%3 = tail call i32 @thr3(i32 0)
ret i32 0
}