xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
unsigned long get_XSelectionEvent_time(void *_p) {
  return (unsigned long)((XSelectionEvent *)_p)->time;
}


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

x86 assembly (clang, -O2):
<get_XSelectionEvent_time>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionEvent_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *, int);
int set_nodelay(int fd) {
  int opt = 1;
  return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *)&opt, sizeof(opt));
}


x86 assembly (clang, -O0):
<set_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nodelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nodelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nodelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret i32 %6
}
void rysuj_gwiazdki_1() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void rte_mov32(uint8_t *dst, const uint8_t *src) { memcpy(dst, src, 32); }


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

x86 assembly (clang, -O2):
<rte_mov32>:
mov    $0x20,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @rte_mov32(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 @memcpy(i32* %5, i32* %6, i32 32)
ret void
}

LLVM IR (-O2):
define void @rte_mov32(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 32)
ret void
}
int test_imm_12uint16_reg(unsigned short val) {
  return ((val) & (-0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -18
%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_12uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -18
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int SC68byte_order(void) {
  static int endian = 0;
  if (!endian) {
    char *s;
    int i;
    for (i = 0, s = (char *)&endian; i < sizeof(int); ++i) {
      s[i] = i;
    }
  }
  return endian;
}


x86 assembly (clang, -O0):
<SC68byte_order>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
jne    1154 <SC68byte_order+0x54>
movl   $0x0,-0xc(%rbp)
lea    0x2f05(%rip),%rax
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x4,%rax
jae    114f <SC68byte_order+0x4f>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <SC68byte_order+0x23>
jmp    1154 <SC68byte_order+0x54>
mov    0x2eca(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC68byte_order>:
mov    0x2f1e(%rip),%eax
test   %eax,%eax
je     110b <SC68byte_order+0xb>
ret
movl   $0x3020100,0x2f0f(%rip)
01 02 03
mov    $0x3020100,%eax
ret

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

LLVM IR (-O2):
@SC68byte_order.endian = internal unnamed_addr global i32 0
define i32 @SC68byte_order() {
%1 = load i32, i32* @SC68byte_order.endian
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
store i8 0, i8* bitcast (i32* @SC68byte_order.endian to i8*)
store i8 1, i8* getelementptr inbounds (i8, i8* bitcast (i32* @SC68byte_order.endian to i8*), i64 1)
store i8 2, i8* getelementptr inbounds (i8, i8* bitcast (i32* @SC68byte_order.endian to i8*), i64 2)
store i8 3, i8* getelementptr inbounds (i8, i8* bitcast (i32* @SC68byte_order.endian to i8*), i64 3)
%4 = load i32, i32* @SC68byte_order.endian
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int open(char const *, int, int);
int silc_file_open_mode(const char *filename, int flags, int mode) {
  int fd = open(filename, flags, mode);
  return fd;
}


x86 assembly (clang, -O0):
<silc_file_open_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silc_file_open_mode>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @silc_file_open_mode(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int next_quaddobl_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(508, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<next_quaddobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1fc,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_quaddobl_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1fc,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @next_quaddobl_solution(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 508, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @next_quaddobl_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 508, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
void copy(void) {
  int counter;
  extern char line[], longest[];
  counter = 0;
  while ((longest[counter] = line[counter]) != '\0') {
    ++counter;
  }
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ed2(%rip),%rax
mov    (%rax,%rcx,1),%al
movslq -0x4(%rbp),%rdx
mov    0x2eb4(%rip),%rcx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1141 <copy+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copy+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
mov    0x2edf(%rip),%rsi
mov    0x2ec8(%rip),%rdx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdx,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

LLVM IR (-O0):
@line = external global [0 x i8]
@longest = external global [0 x i8]
define void @copy() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @line, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @longest, i64 0, i64 %8
store i8 %6, i8* %9
%10 = sext i8 %6 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@line = external global [0 x i8]
@longest = external global [0 x i8]
define void @copy() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ %7, %1 ], [ 0, %0 ]
%3 = getelementptr inbounds [0 x i8], [0 x i8]* @line, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = getelementptr inbounds [0 x i8], [0 x i8]* @longest, i64 0, i64 %2
store i8 %4, i8* %5
%6 = icmp eq i8 %4, 0
%7 = add nuw i64 %2, 1
br i1 %6, label %8, label %1
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
start:
  printf("Hello world!\n");
  goto start;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyVec2_init(void) {
  _hmt_register_covercase("HMM_MultiplyVec2", "1");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"HMM_MultiplyVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec2_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 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 = [17 x i8] c"HMM_MultiplyVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([17 x i8], [17 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*/ printf(char *, ...);
int main() {
  int num = 10;
  printf("Value of var is: %d \n ", num);
  printf("Address of var is: %p \n", &num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Value of var is: %d \0A \00"
@.str.1 = [24 x i8] c"Address of var is: %p \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Value of var is: %d \0A \00"
@.str.1 = [24 x i8] c"Address of var is: %p \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
int scsi_complete_async_scans(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scsi_complete_async_scans() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mostra_candidato() {
  printf("Candidato A:%d\n", 42);
  printf("Candidato B:%d\n", 18);
}


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

x86 assembly (clang, -O2):
<mostra_candidato>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x12,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Candidato A:%d\0A\00"
@.str.1 = [16 x i8] c"Candidato B:%d\0A\00"
define void @mostra_candidato() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 42)
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 18)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Candidato A:%d\0A\00"
@.str.1 = [16 x i8] c"Candidato B:%d\0A\00"
define void @mostra_candidato() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 18)
ret void
}
double Bbp2a(double x) {
  return 1.0 - x / 2.0 * (1.0 - x / 6.0 * (1.0 - x * x / 60.0));
}


x86 assembly (clang, -O0):
<Bbp2a>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf02(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee9(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  -0x8(%rbp),%xmm3
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm3
movsd  0xeb7(%rip),%xmm2
subsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe90(%rip),%xmm2
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bbp2a>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xef0(%rip),%xmm1
movsd  0xef0(%rip),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm3
divsd  0xee8(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xee0(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Bbp2a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
%5 = load double, double* %2
%6 = fdiv double %5, 6.000000e+00
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %9, 6.000000e+01
%11 = fsub double 1.000000e+00, %10
%12 = fneg double %6
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fneg double %4
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double 1.000000e+00)
ret double %15
}

LLVM IR (-O2):
define double @Bbp2a(double %0) {
%2 = fmul double %0, %0
%3 = fdiv double %2, 6.000000e+01
%4 = fsub double 1.000000e+00, %3
%5 = fdiv double %0, -6.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fmul double %0, -5.000000e-01
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
ret double %8
}
int main() {
  float a = 4.0;
  return (int)a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -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 float
store i32 0, i32* %1
store float 4.000000e+00, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
char const *caca_get_version(void) { return "0.99.beta18"; }


x86 assembly (clang, -O0):
<caca_get_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<caca_get_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"0.99.beta18\00"
define i8* @caca_get_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"0.99.beta18\00"
define i8* @caca_get_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t clamp2_u32(uint32_t val, uint32_t min, uint32_t max) {
  if (val < min)
    return min;
  else if (val > max)
    return max;
  else
    return val;
}


x86 assembly (clang, -O0):
<clamp2_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <clamp2_u32+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp2_u32+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <clamp2_u32+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp2_u32+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp2_u32>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @clamp2_u32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i64, i64* %6
store i64 %12, i64* %4
br label %21
13: ; preds = %3
%14 = load i64, i64* %5
%15 = load i64, i64* %7
%16 = icmp sgt i64 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i64, i64* %7
store i64 %18, i64* %4
br label %21
19: ; preds = %13
%20 = load i64, i64* %5
store i64 %20, i64* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
define i64 @clamp2_u32(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
void func(a, b) unsigned int *a;
unsigned int b;
{ printf("%ld -1 == %ld\n", a[0], b); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %esi,%edx
mov    (%rdi),%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%ld -1 == %ld\0A\00"
define void @func(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%ld -1 == %ld\0A\00"
define void @func(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
ret void
}
void swap(int vec[], int a, int b) {
  int tmp = vec[a];
  vec[a] = vec[b];
  vec[b] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
float g(double theta) { return 0.5; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @g(double %0) {
%2 = alloca double
store double %0, double* %2
ret float 5.000000e-01
}

LLVM IR (-O2):
define float @g(double %0) {
ret float 5.000000e-01
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int num;
  num = 1;
  printf("I am a simple ");
  printf("computer.\n");
  printf("My favorite number is %d because it is first.\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"I am a simple \00"
@.str.1 = [11 x i8] c"computer.\0A\00"
@.str.2 = [47 x i8] c"My favorite number is %d because it is first.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"I am a simple \00"
@.str.2 = [47 x i8] c"My favorite number is %d because it is first.\0A\00"
@str = [10 x i8] c"computer.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
const char *IDEA_options(void) { return "idea(int)"; }


x86 assembly (clang, -O0):
<IDEA_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDEA_options>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"idea(int)\00"
define i8* @IDEA_options() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"idea(int)\00"
define i8* @IDEA_options() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
const char *EAC_OBJ_nid2sn(int n) { return EAC_OBJ_nid2sn(n); }


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

x86 assembly (clang, -O2):
<EAC_OBJ_nid2sn>:
jmp    1100 <EAC_OBJ_nid2sn>

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

LLVM IR (-O2):
define noalias i8* @EAC_OBJ_nid2sn(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct proto_handler {
  int dummy;
};

/* Variables and functions */
int _detach_handler(struct proto_handler *);
int detach_handler(struct proto_handler *_p) {
  int error = -1;
  ;
  ;
  error = _detach_handler(_p);
  ;
  ;
  return (error);
}


x86 assembly (clang, -O0):
<detach_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_detach_handler@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detach_handler>:
jmp    1030 <_detach_handler@plt>

LLVM IR (-O0):
%struct.proto_handler = type { i32 }
define i32 @detach_handler(%struct.proto_handler* %0) {
%2 = alloca %struct.proto_handler*
%3 = alloca i32
store %struct.proto_handler* %0, %struct.proto_handler** %2
store i32 -1, i32* %3
%4 = load %struct.proto_handler*, %struct.proto_handler** %2
%5 = call i32 @_detach_handler(%struct.proto_handler* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.proto_handler = type { i32 }
define i32 @detach_handler(%struct.proto_handler* %0) {
%2 = tail call i32 @_detach_handler(%struct.proto_handler* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ gpioInitialise();
int gpioRead(int);
main() {
  int j;
  int i;
  if (gpioInitialise() < 0)
    return 1;
  i = 4;
  j = 0;
  for (j = 0; j < 100000000; j++) {
    i = gpioRead(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gpioInitialise@plt>
cmp    $0x0,%rax
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1187 <main+0x67>
movl   $0x4,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1187 <main+0x67>
mov    -0xc(%rbp),%edi
call   1040 <gpioRead@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x41>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <gpioInitialise@plt>
test   %rax,%rax
js     1150 <main+0x30>
mov    $0x4,%eax
mov    $0x5f5e100,%ebx
nopw   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1040 <gpioRead@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 (...) @gpioInitialise()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %17
7: ; preds = %0
store i32 4, i32* %3
store i32 0, i32* %2
store i32 0, i32* %2
br label %8
8: ; preds = %14, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 100000000
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %3
%13 = call i32 @gpioRead(i32 %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %8
17: ; preds = %6, %8
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @gpioInitialise()
%2 = icmp slt i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 4, %0 ]
%5 = phi i32 [ %7, %3 ], [ 0, %0 ]
%6 = tail call i32 @gpioRead(i32 %4)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 100000000
br i1 %8, label %9, label %3
9: ; preds = %3, %0
%10 = phi i32 [ 1, %0 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ tx_bytes(unsigned char *, int);
void set_IR_receive_ports(unsigned char ports) {
  unsigned char d[3];
  d[0] = (4 << 5) + 0x1F;
  d[1] = 0x09;
  d[2] = ports;
  tx_bytes(d, sizeof(d));
}


x86 assembly (clang, -O0):
<set_IR_receive_ports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x9f,-0x4(%rbp)
movb   $0x9,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x3,%esi
call   1030 <tx_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_IR_receive_ports>:
push   %rax
movw   $0x99f,0x5(%rsp)
mov    %dil,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   1030 <tx_bytes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @set_IR_receive_ports(i8 zeroext %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 -97, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 9, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %0, i8* %5
%6 = call i32 @tx_bytes(i8* %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RADIO_VREF_PIN() { set_io_bit(-1, 1); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_VREF_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RADIO_VREF_PIN>:
mov    $0xffffffff,%edi
mov    $0x1,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RADIO_VREF_PIN() {
%1 = call i32 @set_io_bit(i32 -1, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_VREF_PIN() {
%1 = tail call i32 @set_io_bit(i32 -1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _do_log(char *, int, char *, char *);
int /*<<< orphan*/ assert_messages(int, char *);
void t_simple(void *context) {
  _do_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/"
          "2.5-t-log-adapter/test.c",
          38,
          ""
          "test %s",
          "abc");
  assert_messages(1, "test abc");
}


x86 assembly (clang, -O0):
<t_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x26,%esi
lea    0xf53(%rip),%rdx
lea    0xf59(%rip),%rcx
call   1040 <_do_log@plt>
mov    $0x1,%edi
lea    0xf43(%rip),%rsi
call   1030 <assert_messages@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_simple>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf63(%rip),%rdx
lea    0xf69(%rip),%rcx
mov    $0x26,%esi
call   1040 <_do_log@plt>
lea    0xf53(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert_messages@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/2.5-t-log-adapter/test.c\00"
@.str.1 = [8 x i8] c"test %s\00"
@.str.2 = [4 x i8] c"abc\00"
@.str.3 = [9 x i8] c"test abc\00"
define void @t_simple(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @_do_log(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @assert_messages(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/itmm/waelzer/refs/heads/master/2.5-t-log-adapter/test.c\00"
@.str.1 = [8 x i8] c"test %s\00"
@.str.2 = [4 x i8] c"abc\00"
@.str.3 = [9 x i8] c"test abc\00"
define void @t_simple(i8* nocapture readnone %0) {
%2 = tail call i32 @_do_log(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @assert_messages(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void __ieee754_asin(void) {}


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

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

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

LLVM IR (-O2):
define void @__ieee754_asin() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *atoa(const char *input) {
  size_t nbytes = strlen(input) + 1;
  char *ret = (char *)malloc(nbytes);
  memcpy(ret, input, nbytes);
  return ret;
}


x86 assembly (clang, -O0):
<atoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoa>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @atoa(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @atoa(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
ret i8* %6
}
__attribute__((always_)) unsigned short readw(const volatile void *addr) {
  unsigned short ret;
  asm volatile("mov"
               "w"
               " %1,%0"
               : "=r"(ret)
               : "m"(*(volatile unsigned short *)addr)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
mov    (%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i16*
%6 = call i16 asm sideeffect "movw $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = tail call i16 asm sideeffect "movw $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %2)
ret i16 %3
}
/* Variables and functions */
char getkbcode();
char readKey() {
  while (true) {
    char c = getkbcode();
    if ((c >= 'A' && c <= 'Z') || c == '\n' || c == ' ')
      return c;
  }
}


x86 assembly (clang, -O0):
<readKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getkbcode@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     113c <readKey+0x2c>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jle    1156 <readKey+0x46>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1156 <readKey+0x46>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jne    1160 <readKey+0x50>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <readKey+0x8>

x86 assembly (clang, -O2):
<readKey>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getkbcode@plt>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%cl
jb     1147 <readKey+0x37>
mov    %eax,%ecx
cmp    $0xa,%al
je     113b <readKey+0x2b>
cmp    $0x20,%al
je     113b <readKey+0x2b>
mov    %ebx,%ecx
cmp    $0xa,%al
je     1149 <readKey+0x39>
mov    %ecx,%ebx
cmp    $0x20,%al
jne    1120 <readKey+0x10>
jmp    1149 <readKey+0x39>
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @readKey() {
%1 = alloca i8
br label %2
2: ; preds = %0, %21
%3 = call signext i8 (...) @getkbcode()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %19, label %11
11: ; preds = %7, %2
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %21
19: ; preds = %15, %11, %7
%20 = load i8, i8* %1
ret i8 %20
21: ; preds = %15
br label %2
}

LLVM IR (-O2):
define signext i8 @readKey() {
br label %1
1: ; preds = %9, %0
%2 = phi i8 [ undef, %0 ], [ %10, %9 ]
%3 = tail call signext i8 (...) @getkbcode()
%4 = freeze i8 %3
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
br i1 %6, label %11, label %7
7: ; preds = %1
switch i8 %4, label %8 [
i8 32, label %9
i8 10, label %9
]
8: ; preds = %7
br label %9
9: ; preds = %7, %7, %8
%10 = phi i8 [ %4, %7 ], [ %4, %7 ], [ %2, %8 ]
switch i8 %4, label %1 [
i8 32, label %13
i8 10, label %13
]
11: ; preds = %1
%12 = freeze i8 %3
br label %13
13: ; preds = %9, %9, %11
%14 = phi i8 [ %12, %11 ], [ %10, %9 ], [ %10, %9 ]
ret i8 %14
}
int set_sta_default_keyid(int radio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_sta_default_keyid(i32 %0) {
ret i32 0
}
double subtracao(double v1, double v2) { return v1 - v2; }


x86 assembly (clang, -O0):
<subtracao>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtracao>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @subtracao(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* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @subtracao(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int rtp_get_cc(int /*<<< orphan*/ *);
uint8_t *rtp_extension(uint8_t *p_rtp) {
  return p_rtp + 12 + 4 * rtp_get_cc(p_rtp);
}


x86 assembly (clang, -O0):
<rtp_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rtp_get_cc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_extension>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rtp_get_cc@plt>
shl    $0x2,%eax
cltq
lea    (%rbx,%rax,4),%rax
add    $0x30,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @rtp_extension(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32*, i32** %2
%6 = call i32 @rtp_get_cc(i32* %5)
%7 = mul nsw i32 4, %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %4, i64 %8
ret i32* %9
}

LLVM IR (-O2):
define i32* @rtp_extension(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = tail call i32 @rtp_get_cc(i32* %0)
%4 = shl nsw i32 %3, 2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %2, i64 %5
ret i32* %6
}
void ve_rpc_data_get(void) {}


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

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

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

LLVM IR (-O2):
define void @ve_rpc_data_get() {
ret void
}
int test_imm_0Bint32_mem(int *val) {
  return ((*val) & (0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Bint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_0Bint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 11
%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_0Bint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 11
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void zero(float v[], int d) {
  int i;
  for (i = 0; i < d; i++) {
    v[i] = 0.0;
  }
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <zero+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
jle    1126 <zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zero(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
store float 0.000000e+00, float* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @zero(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}