xunge/DecIR huggingface dataset:
/* Variables and functions */
int f322(int *);
int f323(int *p) { return f322(p); }


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

x86 assembly (clang, -O2):
<f323>:
jmp    1030 <f322@plt>

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

LLVM IR (-O2):
define i32 @f323(i32* %0) {
%2 = tail call i32 @f322(i32* %0)
ret i32 %2
}
/* Type definitions */
struct shl_pty {
  int dummy;
};

/* Variables and functions */
int pty_read(struct shl_pty *);
int /*<<< orphan*/ pty_write(struct shl_pty *);
int shl_pty_dispatch(struct shl_pty *pty) {
  int r;
  r = pty_read(pty);
  pty_write(pty);
  return r;
}


x86 assembly (clang, -O0):
<shl_pty_dispatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pty_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pty_write@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_pty_dispatch>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <pty_read@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <pty_write@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.shl_pty = type { i32 }
define i32 @shl_pty_dispatch(%struct.shl_pty* %0) {
%2 = alloca %struct.shl_pty*
%3 = alloca i32
store %struct.shl_pty* %0, %struct.shl_pty** %2
%4 = load %struct.shl_pty*, %struct.shl_pty** %2
%5 = call i32 @pty_read(%struct.shl_pty* %4)
store i32 %5, i32* %3
%6 = load %struct.shl_pty*, %struct.shl_pty** %2
%7 = call i32 @pty_write(%struct.shl_pty* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.shl_pty = type { i32 }
define i32 @shl_pty_dispatch(%struct.shl_pty* %0) {
%2 = tail call i32 @pty_read(%struct.shl_pty* %0)
%3 = tail call i32 @pty_write(%struct.shl_pty* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_fortran_comment_entities();
void all_fortran_tests() { test_fortran_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_fortran_tests() {
%1 = tail call i32 (...) @test_fortran_comment_entities()
ret void
}
/* Variables and functions */
int errno;
char **malloc(int);
int spt_clearenv(void) {
  extern char **environ;
  static char **tmp;
  if (!(tmp = malloc(sizeof *tmp)))
    return errno;
  tmp[0] = NULL;
  environ = tmp;
  return 0;
}


x86 assembly (clang, -O0):
<spt_clearenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x2f07(%rip)
cmp    $0x0,%rax
jne    1144 <spt_clearenv+0x34>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <spt_clearenv+0x5a>
mov    0x2ee5(%rip),%rax
movq   $0x0,(%rax)
mov    0x2ed7(%rip),%rcx
mov    0x2e88(%rip),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spt_clearenv>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x2f0e(%rip)
test   %rax,%rax
je     113c <spt_clearenv+0x2c>
movq   $0x0,(%rax)
mov    0x2eb3(%rip),%rcx
mov    %rax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@spt_clearenv.tmp = internal global i8** null
@errno = global i32 0
@environ = external global i8**
define i32 @spt_clearenv() {
%1 = alloca i32
%2 = call i8** @malloc(i32 8)
store i8** %2, i8*** @spt_clearenv.tmp
%3 = icmp ne i8** %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = load i32, i32* @errno
store i32 %5, i32* %1
br label %10
6: ; preds = %0
%7 = load i8**, i8*** @spt_clearenv.tmp
%8 = getelementptr inbounds i8*, i8** %7, i64 0
store i8* null, i8** %8
%9 = load i8**, i8*** @spt_clearenv.tmp
store i8** %9, i8*** @environ
store i32 0, i32* %1
br label %10
10: ; preds = %6, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@spt_clearenv.tmp = internal unnamed_addr global i8** null
@errno = global i32 0
@environ = external global i8**
define i32 @spt_clearenv() {
%1 = tail call i8** @malloc(i32 8)
store i8** %1, i8*** @spt_clearenv.tmp
%2 = icmp eq i8** %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i32, i32* @errno
br label %6
5: ; preds = %0
store i8* null, i8** %1
store i8** %1, i8*** @environ
br label %6
6: ; preds = %5, %3
%7 = phi i32 [ 0, %5 ], [ %4, %3 ]
ret i32 %7
}
int Stack_Empty(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Stack_Empty() {
ret i32 0
}
int find_first(void *key, void *value, void *user_data) {
  int *v = value;
  int *test = user_data;
  return (*v == *test);
}


x86 assembly (clang, -O0):
<find_first>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first>:
mov    (%rsi),%ecx
xor    %eax,%eax
cmp    (%rdx),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @find_first(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %7
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @find_first(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8* %2 to i32*
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, char *, size_t, int /*<<< orphan*/);
ssize_t unix_fd_read_cb(char *buffer, size_t size, void *data) {
  int fd = *(int *)data;
  return recv(fd, buffer, size, 0);
}


x86 assembly (clang, -O0):
<unix_fd_read_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_fd_read_cb>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    (%rdx),%edi
mov    %rax,%rdx
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @unix_fd_read_cb(i8* %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @recv(i32 %5, i8* %0, i64 %1, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_copy() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_copy"
         "\n");
}


x86 assembly (clang, -O0):
<pa_proplist_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_proplist_copy\0A\00"
define i32 @pa_proplist_copy() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_proplist_copy\00"
define i32 @pa_proplist_copy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(int *);
void OsCloseEvent(long evt) {
  close(((int *)evt)[0]);
  close(((int *)evt)[1]);
  free(((int *)evt));
}


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

x86 assembly (clang, -O2):
<OsCloseEvent>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <close@plt>
mov    0x4(%rbx),%edi
call   1040 <close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @OsCloseEvent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = call i32 @close(i32 %6)
%8 = load i64, i64* %2
%9 = inttoptr i64 %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 @close(i32 %11)
%13 = load i64, i64* %2
%14 = inttoptr i64 %13 to i32*
%15 = call i32 @free(i32* %14)
ret void
}

LLVM IR (-O2):
define void @OsCloseEvent(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @close(i32 %6)
%8 = tail call i32 @free(i32* %2)
ret void
}
void rop3_223_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_223_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_223_0_0>:
and    (%rdi),%dl
not    %dl
or     %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_223_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_223_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = xor i8 %5, -1
%7 = or i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ uart_rx_is_empty(int /*<<< orphan*/ *);
void uart_receive(uint32_t *uart, uint8_t *data) {
  while (uart_rx_is_empty(uart))
    ;
  *data = uart[0];
}


x86 assembly (clang, -O0):
<uart_receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <uart_rx_is_empty@plt>
cmp    $0x0,%rax
je     1138 <uart_receive+0x28>
jmp    1120 <uart_receive+0x10>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_receive>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <uart_rx_is_empty@plt>
test   %rax,%rax
jne    1120 <uart_receive+0x10>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @uart_receive(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %9, %2
%6 = load i32*, i32** %3
%7 = call i64 @uart_rx_is_empty(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @uart_receive(i32* %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @uart_rx_is_empty(i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = load i32, i32* %0
store i32 %7, i32* %1
ret void
}
/* Type definitions */
typedef int size;

/* Variables and functions */
size_t size_less_null(size_t size) { return ((!!(size)) * ((size)-1)); }


x86 assembly (clang, -O0):
<size_less_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_less_null>:
xor    %eax,%eax
sub    $0x1,%rdi
cmovae %rdi,%rax
ret

LLVM IR (-O0):
define i64 @size_less_null(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
%9 = load i64, i64* %2
%10 = sub i64 %9, 1
%11 = mul i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @size_less_null(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = add i64 %0, -1
%4 = select i1 %2, i64 0, i64 %3
ret i64 %4
}
void NV12ToRGB24Row_SSSE3() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @CG_CheckAmmo() {
ret void
}
int t_size(int n) { return n; }


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

x86 assembly (clang, -O2):
<t_size>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @t_size(i32 returned %0) {
ret i32 %0
}
void gl_core_destruct() {}


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

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

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

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

/* Variables and functions */
int rc_i2c_send_bytes(int, int, int /*<<< orphan*/ *);
int rc_i2c_send_byte(int bus, uint8_t data) {
  return rc_i2c_send_bytes(bus, 1, &data);
}


x86 assembly (clang, -O0):
<rc_i2c_send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
lea    -0x8(%rbp),%rdx
call   1030 <rc_i2c_send_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_i2c_send_byte>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1,%esi
call   1030 <rc_i2c_send_bytes@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rc_i2c_send_byte(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 = call i32 @rc_i2c_send_bytes(i32 %5, i32 1, i32* %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @rc_i2c_send_byte(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @rc_i2c_send_bytes(i32 %0, i32 1, i32* %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ log(double);
float logf(float x) { return ((float)log((double)x)); }


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

x86 assembly (clang, -O2):
<logf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @log(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @logf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @log(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error(void) {
  printf("please enter pid number as arg1 and optionally tid number as arg2\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"please enter pid number as arg1 and optionally tid number as arg2\0A\00"
define void @error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [66 x i8] c"please enter pid number as arg1 and optionally tid number as arg2\00"
define void @error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int getUserInput(int in) {
  printf("What is your number? ");
  int read = scanf("%d", &in);
  if (read == 1) {
    printf("\n");
    return (int)in;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<getUserInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1179 <getUserInput+0x49>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<getUserInput>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1177 <getUserInput+0x37>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"What is your number? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @getUserInput(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
11: ; preds = %1
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"What is your number? \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getUserInput(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @putchar(i32 10)
%8 = load i32, i32* %2
ret i32 %8
9: ; preds = %1
%10 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          unsigned int, unsigned int);
main() {
  unsigned int a, b, c, d, e, f;
  a = b = c = d = e = f = 32;
  a <<= 2;
  b >>= 2;
  c ^= 2;
  d |= 2;
  e &= 2;
  printf("%d %d %d %d %d ", a, b, c, d, e);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x20,-0x18(%rbp)
movl   $0x20,-0x14(%rbp)
movl   $0x20,-0x10(%rbp)
movl   $0x20,-0xc(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
xor    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x80,%esi
mov    $0x8,%edx
mov    $0x22,%ecx
mov    $0x22,%r8d
xor    %r9d,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 32, i32* %6
store i32 32, i32* %5
store i32 32, i32* %4
store i32 32, i32* %3
store i32 32, i32* %2
store i32 32, i32* %1
%7 = load i32, i32* %1
%8 = shl i32 %7, 2
store i32 %8, i32* %1
%9 = load i32, i32* %2
%10 = lshr i32 %9, 2
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = xor i32 %11, 2
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = or i32 %13, 2
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = and i32 %15, 2
store i32 %16, i32* %5
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 128, i32 8, i32 34, i32 34, i32 0)
ret i32 0
}
void yy_1_ValidXmlAttribute(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValidXmlAttribute(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ivector(int *v, long nl, long nh) { free((char *)(v + nl - 0)); }


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

x86 assembly (clang, -O2):
<free_ivector>:
lea    (%rdi,%rsi,4),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
struct timex {
  int freq;
  scalar_t__ modes;
};

/* Variables and functions */
scalar_t__ adjtimex(struct timex *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int get_current_freq(void) {
  struct timex txc;
  txc.modes = 0;
  if (adjtimex(&txc) < 0) {
    perror("adjtimex");
    exit(1);
  }
  return txc.freq;
}


x86 assembly (clang, -O0):
<get_current_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <adjtimex@plt>
cmp    $0x0,%rax
jge    1169 <get_current_freq+0x39>
lea    0xea6(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_freq>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <adjtimex@plt>
test   %rax,%rax
js     1155 <get_current_freq+0x25>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = call i64 @adjtimex(%struct.timex* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timex, %struct.timex* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timex = type { i32, i64 }
@.str = [9 x i8] c"adjtimex\00"
define i32 @get_current_freq() {
%1 = alloca %struct.timex
%2 = bitcast %struct.timex* %1 to i8*
%3 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = call i64 @adjtimex(%struct.timex* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.timex, %struct.timex* %1, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int copy(void *dst, void *src, ssize_t nmemb, ssize_t size, ssize_t d,
         ssize_t s) {
  void *ap;
  void *bp;
  (void)nmemb;
  ap = ((char *)dst) + (d * size);
  bp = ((char *)src) + (s * size);
  memcpy(ap, bp, size);
  return 0;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   -0x18(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
imul   -0x18(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rax
imul   %ecx,%r8d
movslq %r8d,%rax
add    %rax,%rdi
imul   %ecx,%r9d
movslq %r9d,%rax
add    %rax,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copy(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load i32, i32* %9
%16 = load i8*, i8** %7
%17 = load i32, i32* %11
%18 = load i32, i32* %10
%19 = mul nsw i32 %17, %18
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8* %21, i8** %13
%22 = load i8*, i8** %8
%23 = load i32, i32* %12
%24 = load i32, i32* %10
%25 = mul nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
store i8* %27, i8** %14
%28 = load i8*, i8** %13
%29 = load i8*, i8** %14
%30 = load i32, i32* %10
%31 = call i32 @memcpy(i8* %28, i8* %29, i32 %30)
ret i32 0
}

LLVM IR (-O2):
define i32 @copy(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %4, %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = mul nsw i32 %5, %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = tail call i32 @memcpy(i8* %9, i8* %12, i32 %3)
ret i32 0
}
/* Variables and functions */
int collatz(int);
void numberOfSteps(int numbersToTest[], int numberOfElements, int *buffer) {
  for (int i = 0; i < numberOfElements; i++) {
    buffer[i] = collatz(numbersToTest[i]);
  }
}


x86 assembly (clang, -O0):
<numberOfSteps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <numberOfSteps+0x51>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <collatz@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <numberOfSteps+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfSteps>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <numberOfSteps+0x36>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <collatz@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <numberOfSteps+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @numberOfSteps(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
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @collatz(i32 %17)
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
store i32 %18, i32* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @numberOfSteps(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %14, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @collatz(i32 %11)
%13 = getelementptr inbounds i32, i32* %2, i64 %9
store i32 %12, i32* %13
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %7, label %8
}
int is_prime(int number) {
  int mod = 2;
  while (mod > 1 && mod < number)
    if (number % mod == 0) {
      return 0;
    } else {
      return 1;
    }
  mod++;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1129 <is_prime+0x29>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1139 <is_prime+0x39>
jmp    1161 <is_prime+0x61>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1155 <is_prime+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %1
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %2
br label %24
20: ; preds = %14
store i32 1, i32* %2
br label %24
21: ; preds = %12
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %21, %20, %19
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkread(void *, unsigned short, unsigned char, unsigned char *, int);
int fc8150_spib_wordread(void *hDevice, unsigned short addr,
                         unsigned short *data) {
  int res;
  unsigned char command = 0x40 | 0x80;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkread(hDevice, addr, command, (unsigned char *)data, 2);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8150_spib_wordread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0xc0,-0x1d(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x1d(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x2,%r8d
movzwl %dx,%esi
movzbl %al,%edx
call   1040 <spi_bulkread@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_spib_wordread>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xc0,%edx
mov    %r14,%rcx
mov    $0x2,%r8d
call   1040 <spi_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8150_spib_wordread(i8* %0, i16 zeroext %1, i16* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i16* %2, i16** %6
store i8 -64, i8* %8
%9 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = load i8, i8* %8
%13 = load i16*, i16** %6
%14 = bitcast i16* %13 to i8*
%15 = call i32 @spi_bulkread(i8* %10, i16 zeroext %11, i8 zeroext %12, i8* %14, i32 2)
store i32 %15, i32* %7
%16 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @fc8150_spib_wordread(i8* %0, i16 zeroext %1, i16* %2) {
%4 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%5 = bitcast i16* %2 to i8*
%6 = tail call i32 @spi_bulkread(i8* %0, i16 zeroext %1, i8 zeroext -64, i8* %5, i32 2)
%7 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %6
}
/* Variables and functions */
int aes_enc(char *, char *, char *);
int encrypt_aes(char *infile, char *outfile, char *enckey) {
  return aes_enc(infile, outfile, enckey);
}


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

x86 assembly (clang, -O2):
<encrypt_aes>:
jmp    1030 <aes_enc@plt>

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

LLVM IR (-O2):
define i32 @encrypt_aes(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @aes_enc(i8* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
long random();
void create_random_array(long array[], int lenght) {
  int i;
  for (i = 0; i < lenght; i++) {
    array[i] = random();
  }
}


x86 assembly (clang, -O0):
<create_random_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <create_random_array+0x46>
mov    $0x0,%al
call   1030 <random@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <create_random_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_random_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <create_random_array+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <create_random_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @create_random_array(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i64 (...) @random()
%9 = getelementptr inbounds i64, i64* %0, i64 %7
store i64 %8, i64* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void ShowCurrentMove(short pnt, short f, short t) {}


x86 assembly (clang, -O0):
<ShowCurrentMove>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ShowCurrentMove(i16 signext %0, i16 signext %1, i16 signext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xe0() {
  Assert_real((isalnum(224) == 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_isalnum.c",
              1125, ("isalnum should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x465,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe0\00"
define void @t_isalnum_0xe0() {
%1 = call i64 @isalnum(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe0\00"
define void @t_isalnum_0xe0() {
%1 = tail call i64 @isalnum(i32 224)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_unlinkat;
int syscall(int /*<<< orphan*/, int, char const *);
__attribute__((always_)) int _syscall_unlinkat(int dirfd, const char *pathname,
                                               int flags) {
  return syscall(__NR_unlinkat, dirfd, pathname);
}


x86 assembly (clang, -O0):
<_syscall_unlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_unlinkat>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_unlinkat = global i32 0
define i32 @_syscall_unlinkat(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @__NR_unlinkat
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void writeBigInt(FILE *file, uint32_t value) {
  putc((value >> 24), file);
  putc((value >> 16), file);
  putc((value >> 8), file);
  putc((value), file);
}


x86 assembly (clang, -O0):
<writeBigInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBigInt>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
sar    $0x18,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x10,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x8,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @writeBigInt(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 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = call i32 @putc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = call i32 @putc(i32 %10, i32* %11)
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = call i32 @putc(i32 %14, i32* %15)
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = call i32 @putc(i32 %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @writeBigInt(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = tail call i32 @putc(i32 %3, i32* %0)
%5 = ashr i32 %1, 16
%6 = tail call i32 @putc(i32 %5, i32* %0)
%7 = ashr i32 %1, 8
%8 = tail call i32 @putc(i32 %7, i32* %0)
%9 = tail call i32 @putc(i32 %1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("15减去37的结果是%d\n", 15 - 37);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"15\E5\87\8F\E5\8E\BB37\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 -22)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"15\E5\87\8F\E5\8E\BB37\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 -22)
ret i32 0
}
_Bool mem_chunk_test_mimic(void) { return (0 == 0); }


x86 assembly (clang, -O0):
<mem_chunk_test_mimic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @mem_chunk_test_mimic() {
ret i1 true
}

LLVM IR (-O2):
define zeroext i1 @mem_chunk_test_mimic() {
ret i1 true
}