xunge/DecIR huggingface dataset:
/* Type definitions */
struct cog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getDepth(struct cog *, struct cog *);
struct cog *splayDepth(struct cog *, struct cog *, int /*<<< orphan*/);
struct cog *splay(struct cog *root, struct cog *node) {
  return splayDepth(root, node, getDepth(root, node));
}


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

x86 assembly (clang, -O2):
<splay>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getDepth@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <splayDepth@plt>

LLVM IR (-O0):
%struct.cog = type { i32 }
define %struct.cog* @splay(%struct.cog* %0, %struct.cog* %1) {
%3 = alloca %struct.cog*
%4 = alloca %struct.cog*
store %struct.cog* %0, %struct.cog** %3
store %struct.cog* %1, %struct.cog** %4
%5 = load %struct.cog*, %struct.cog** %3
%6 = load %struct.cog*, %struct.cog** %4
%7 = load %struct.cog*, %struct.cog** %3
%8 = load %struct.cog*, %struct.cog** %4
%9 = call i32 @getDepth(%struct.cog* %7, %struct.cog* %8)
%10 = call %struct.cog* @splayDepth(%struct.cog* %5, %struct.cog* %6, i32 %9)
ret %struct.cog* %10
}

LLVM IR (-O2):
%struct.cog = type { i32 }
define %struct.cog* @splay(%struct.cog* %0, %struct.cog* %1) {
%3 = tail call i32 @getDepth(%struct.cog* %0, %struct.cog* %1)
%4 = tail call %struct.cog* @splayDepth(%struct.cog* %0, %struct.cog* %1, i32 %3)
ret %struct.cog* %4
}
unsigned char get_zone_config(unsigned char io_mem, unsigned char io_enc,
                              unsigned char io_cnt) {
  unsigned char config = 0;
  config = io_mem | io_enc | io_cnt;
  return config;
}


x86 assembly (clang, -O0):
<get_zone_config>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movb   $0x0,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_zone_config>:
mov    %edi,%eax
or     %esi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @get_zone_config(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %1, %0
%5 = or i8 %4, %2
ret i8 %5
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
off_t __libc_lseek(int fd, off_t offset, int whence) {
  __set_errno(EBADF);
  return -1;
}


x86 assembly (clang, -O0):
<__libc_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_lseek>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EBADF = global i32 0
define i32 @__libc_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EBADF
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
define i32 @__libc_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EBADF
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
unsigned int zipmapDecodeLength(unsigned char *);
unsigned int zipmapEncodeLength(int /*<<< orphan*/ *, unsigned int);
unsigned int zipmapRawValueLength(unsigned char *p) {
  unsigned int l = zipmapDecodeLength(p);
  unsigned int used;
  used = zipmapEncodeLength(NULL, l);
  used += p[used] + 1 + l;
  return used;
}


x86 assembly (clang, -O0):
<zipmapRawValueLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <zipmapDecodeLength@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <zipmapEncodeLength@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
add    $0x1,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipmapRawValueLength>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <zipmapDecodeLength@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    %eax,%esi
call   1040 <zipmapEncodeLength@plt>
mov    %eax,%ecx
movzbl (%r14,%rcx,1),%ecx
add    %eax,%ebx
lea    (%rcx,%rbx,1),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @zipmapRawValueLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @zipmapDecodeLength(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @zipmapEncodeLength(i32* null, i32 %7)
store i32 %8, i32* %4
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %3
%17 = add i32 %15, %16
%18 = load i32, i32* %4
%19 = add i32 %18, %17
store i32 %19, i32* %4
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @zipmapRawValueLength(i8* %0) {
%2 = tail call i32 @zipmapDecodeLength(i8* %0)
%3 = tail call i32 @zipmapEncodeLength(i32* null, i32 %2)
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add i32 %2, 1
%9 = add i32 %8, %3
%10 = add i32 %9, %7
ret i32 %10
}
void foo172() {}


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

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

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

LLVM IR (-O2):
define void @foo172() {
ret void
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_give_deck_status(const struct cec_msg *msg, __u8 *status_req) {
  *status_req = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_give_deck_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_give_deck_status(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_give_deck_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
int f0(int dw) { return (32 * ((dw)&0x1) + dw) >> 1; }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
add    -0x4(%rbp),%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    %edi,%eax
shl    $0x5,%eax
and    $0x20,%eax
add    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @f0(i32 %0) {
%2 = shl i32 %0, 5
%3 = and i32 %2, 32
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __p3dfft_MOD_p3dfft_btran_c2r(double *, double *);
void p3dfft_btran_c2r(double *A, double *B) {
  __p3dfft_MOD_p3dfft_btran_c2r(A, B);
}


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

x86 assembly (clang, -O2):
<p3dfft_btran_c2r>:
jmp    1030 <__p3dfft_MOD_p3dfft_btran_c2r@plt>

LLVM IR (-O0):
define void @p3dfft_btran_c2r(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 = call i32 @__p3dfft_MOD_p3dfft_btran_c2r(double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @p3dfft_btran_c2r(double* %0, double* %1) {
%3 = tail call i32 @__p3dfft_MOD_p3dfft_btran_c2r(double* %0, double* %1)
ret void
}
/* Variables and functions */
int bma220_set_sc_filt_config(char);
int bma220_set_bandwidth(char bw) { return bma220_set_sc_filt_config(bw); }


x86 assembly (clang, -O0):
<bma220_set_bandwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <bma220_set_sc_filt_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma220_set_bandwidth>:
jmp    1030 <bma220_set_sc_filt_config@plt>

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

LLVM IR (-O2):
define i32 @bma220_set_bandwidth(i8 signext %0) {
%2 = tail call i32 @bma220_set_sc_filt_config(i8 signext %0)
ret i32 %2
}
void connect_to_player(struct player_id *p) {}


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

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

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

LLVM IR (-O2):
%struct.player_id = type opaque
define void @connect_to_player(%struct.player_id* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char a[5];
  int *b;
  a[0] = 'h';
  a[1] = 'i';
  a[2] = '\0';
  printf("%s", a);
  *b = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x68,-0x5(%rbp)
movb   $0x69,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0x5(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6968,0x3(%rsp)
movb   $0x0,0x5(%rsp)
lea    0xedc(%rip),%rdi
lea    0x3(%rsp),%rsi
call   1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8 104, i8* %2
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
store i8 105, i8* %3
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
unreachable
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int serial_read_byte(int pi, unsigned handle) {
  return pigpio_command(pi, 78, handle, 0, 1);
}


x86 assembly (clang, -O0):
<serial_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x4e,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_read_byte>:
mov    %esi,%edx
mov    $0x4e,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @serial_read_byte(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 78, i32 %1, i32 0, i32 1)
ret i32 %3
}
int media_read(unsigned long sector, unsigned char *buffer) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @media_read(i64 %0, i8* nocapture readnone %1) {
ret i32 1
}
int dijkstra_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dijkstra_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scsp_reset();
void ScspReset(void) { scsp_reset(); }


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

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

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

LLVM IR (-O2):
define void @ScspReset() {
%1 = tail call i32 (...) @scsp_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setupConnection();
int main(int argc, char *argv[]) { setupConnection(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @setupConnection()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setupConnection()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ skip_space(char const **);
long get_ascii(const char **s) {
  long v = 0;
  v = **s;
  (*s)++;
  skip_space(s);
  return v;
}


x86 assembly (clang, -O0):
<get_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbq (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <skip_space@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ascii>:
push   %rbx
mov    (%rdi),%rax
movsbq (%rax),%rbx
add    $0x1,%rax
mov    %rax,(%rdi)
call   1030 <skip_space@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @get_ascii(i8** %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %5, i8** %0
%6 = tail call i32 @skip_space(i8** %0)
ret i64 %4
}
/* Variables and functions */
scalar_t__ UP3D_GetParameter(int);
float UP3D_GetChangeNozzleTime() {
  return ((float)UP3D_GetParameter(0x2A)) / 1000;
}


x86 assembly (clang, -O0):
<UP3D_GetChangeNozzleTime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <UP3D_GetParameter@plt>
cvtsi2ss %rax,%xmm0
movss  0xed5(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetChangeNozzleTime>:
push   %rax
mov    $0x2a,%edi
call   1030 <UP3D_GetParameter@plt>
cvtsi2ss %rax,%xmm0
divss  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @UP3D_GetChangeNozzleTime() {
%1 = call i64 @UP3D_GetParameter(i32 42)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 1.000000e+03
ret float %3
}

LLVM IR (-O2):
define float @UP3D_GetChangeNozzleTime() {
%1 = tail call i64 @UP3D_GetParameter(i32 42)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 1.000000e+03
ret float %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ sysbail(char *, unsigned long);
void *bmalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (p == NULL)
    sysbail("failed to malloc %lu", (unsigned long)size);
  return p;
}


x86 assembly (clang, -O0):
<bmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <bmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <sysbail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <bmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <sysbail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"failed to malloc %lu\00"
define i8* @bmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @sysbail(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [21 x i8] c"failed to malloc %lu\00"
define noalias i8* @bmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sysbail(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if ((num % i == 0) || (num == 1))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <check_prime+0x53>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1134 <check_prime+0x34>
cmpl   $0x1,-0x8(%rbp)
jne    1140 <check_prime+0x40>
movl   $0x0,-0x4(%rbp)
jmp    115a <check_prime+0x5a>
jmp    1145 <check_prime+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check_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 = %19, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14, %9
store i32 0, i32* %2
br label %23
18: ; preds = %14
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
store i32 1, i32* %2
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ia_unsetbit64(uint64_t word, int i) {
  return word & ~((uint64_t)1 << i);
}


x86 assembly (clang, -O0):
<ia_unsetbit64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ia_unsetbit64(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ia_unsetbit64(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HI2110_init();
void mbed_sdk_init(void) { HI2110_init(); }


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

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

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

LLVM IR (-O2):
define void @mbed_sdk_init() {
%1 = tail call i32 (...) @HI2110_init()
ret void
}
/* Variables and functions */
void *yac_allocator_alloc_algo2(unsigned long, int);
void *yac_allocator_raw_alloc(unsigned long real_size, int hash) {
  return yac_allocator_alloc_algo2(real_size, hash);
}


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

x86 assembly (clang, -O2):
<yac_allocator_raw_alloc>:
jmp    1030 <yac_allocator_alloc_algo2@plt>

LLVM IR (-O0):
define i8* @yac_allocator_raw_alloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i8* @yac_allocator_alloc_algo2(i64 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @yac_allocator_raw_alloc(i64 %0, i32 %1) {
%3 = tail call i8* @yac_allocator_alloc_algo2(i64 %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longlong_put(long long *dest, const long long *src,
                               size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longlong_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longlong_put(i64* nocapture readnone %0, i64* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OPENSSL_config(int /*<<< orphan*/ *);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int get_method(char *, char *);
int crypto_init(char *password, char *method) {
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  OPENSSL_config(NULL);
  if (get_method(password, method) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<crypto_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1060 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <OPENSSL_config@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_method@plt>
cmp    $0xffffffff,%eax
jne    1189 <crypto_init+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <crypto_init+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %edi,%edi
call   1030 <OPENSSL_config@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <get_method@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @crypto_init(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = call i32 (...) @ERR_load_crypto_strings()
%7 = call i32 (...) @OpenSSL_add_all_algorithms()
%8 = call i32 @OPENSSL_config(i32* null)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @get_method(i8* %9, i8* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @crypto_init(i8* %0, i8* %1) {
%3 = tail call i32 (...) @ERR_load_crypto_strings()
%4 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%5 = tail call i32 @OPENSSL_config(i32* null)
%6 = tail call i32 @get_method(i8* %0, i8* %1)
%7 = icmp eq i32 %6, -1
%8 = sext i1 %7 to i32
ret i32 %8
}
int do_019() { return 19; }


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

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

LLVM IR (-O0):
define i32 @do_019() {
ret i32 19
}

LLVM IR (-O2):
define i32 @do_019() {
ret i32 19
}
void RTTcpRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpRead() {
ret void
}
/* Variables and functions */
int ksft_exit_pass();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ ksft_set_plan(int);
int /*<<< orphan*/ test_clone3_clear_sighand();
int /*<<< orphan*/ test_clone3_supported();
int main(int argc, char **argv) {
  ksft_print_header();
  ksft_set_plan(1);
  test_clone3_supported();
  test_clone3_clear_sighand();
  return ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <ksft_print_header@plt>
mov    $0x1,%edi
call   1040 <ksft_set_plan@plt>
mov    $0x0,%al
call   1030 <test_clone3_supported@plt>
mov    $0x0,%al
call   1060 <test_clone3_clear_sighand@plt>
mov    $0x0,%al
call   1050 <ksft_exit_pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <ksft_print_header@plt>
mov    $0x1,%edi
call   1040 <ksft_set_plan@plt>
xor    %eax,%eax
call   1030 <test_clone3_supported@plt>
xor    %eax,%eax
call   1060 <test_clone3_clear_sighand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ksft_exit_pass@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ksft_print_header()
%7 = call i32 @ksft_set_plan(i32 1)
%8 = call i32 (...) @test_clone3_supported()
%9 = call i32 (...) @test_clone3_clear_sighand()
%10 = call i32 (...) @ksft_exit_pass()
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 @ksft_set_plan(i32 1)
%5 = tail call i32 (...) @test_clone3_supported()
%6 = tail call i32 (...) @test_clone3_clear_sighand()
%7 = tail call i32 (...) @ksft_exit_pass()
ret i32 %7
}
/* Variables and functions */
char const *fixture_path(int /*<<< orphan*/, char const *);
const char *fixture(const char *fixture_name) {
  return fixture_path(0, fixture_name);
}


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

x86 assembly (clang, -O2):
<fixture>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <fixture_path@plt>

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

LLVM IR (-O2):
define i8* @fixture(i8* %0) {
%2 = tail call i8* @fixture_path(i32 0, i8* %0)
ret i8* %2
}
int f2() { return 2; }


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

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

LLVM IR (-O0):
define i32 @f2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ GPSVelocitySensorHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GPSVelocitySensorRequestUpdate() {
  UAVObjRequestUpdate(GPSVelocitySensorHandle());
}


x86 assembly (clang, -O0):
<GPSVelocitySensorRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSVelocitySensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSVelocitySensorRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GPSVelocitySensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GPSVelocitySensorRequestUpdate() {
%1 = call i32 (...) @GPSVelocitySensorHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSVelocitySensorRequestUpdate() {
%1 = tail call i32 (...) @GPSVelocitySensorHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int goodfunction() {
  printf("Welcome to the goodfunction, but i said the Hackedfunction..\n");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<goodfunction>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<goodfunction>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"Welcome to the goodfunction, but i said the Hackedfunction..\0A\00"
@stdout = global i32 0
define i32 @goodfunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [61 x i8] c"Welcome to the goodfunction, but i said the Hackedfunction..\00"
define i32 @goodfunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
__attribute__((no, noclone)) long long bar(long long x) {
  asm("");
  return 8LL - x;
}


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x8,%eax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bar(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 8, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @bar(i64 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%2 = sub nsw i64 8, %0
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Sequence(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int x;
  printf("Your first num:");
  scanf("%d", &x);
  Sequence(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <Sequence@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <Sequence@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Your first num:\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @Sequence(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Your first num:\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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* %1)
%5 = load i32, i32* %1
%6 = call i32 @Sequence(i32 %5)
ret void
}
int b2(int index) { return ((int *)00400000)[index]; }


x86 assembly (clang, -O0):
<b2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x20000,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b2>:
movslq %edi,%rax
mov    0x20000(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @b2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* inttoptr (i64 131072 to i32*), i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @b2(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds i32, i32* inttoptr (i64 131072 to i32*), i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int);
char *to_string(char *dest, size_t len, uint32_t val) {
  snprintf(dest, len, "%d", val);
  return dest;
}


x86 assembly (clang, -O0):
<to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_string>:
push   %rbx
mov    %edx,%ecx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @to_string(i8* returned %0, i64 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* %0
}
const char *result(int r) {
  static const char *results[] = {"OK", "MEMERROR", "IOERROR", "TIMEOUT"};
  return results[r & 3];
}


x86 assembly (clang, -O0):
<result>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2f19(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<result>:
and    $0x3,%edi
lea    0xef6(%rip),%rcx
movslq (%rcx,%rdi,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@result.results = internal global [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0)]
@.str = [3 x i8] c"OK\00"
@.str.1 = [9 x i8] c"MEMERROR\00"
@.str.2 = [8 x i8] c"IOERROR\00"
@.str.3 = [8 x i8] c"TIMEOUT\00"
define i8* @result(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* @result.results, i64 0, i64 %5
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
@reltable.result = internal unnamed_addr constant [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.result to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.result to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.result to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.result to i64)) to i32)]
@.str = [3 x i8] c"OK\00"
@.str.1 = [9 x i8] c"MEMERROR\00"
@.str.2 = [8 x i8] c"IOERROR\00"
@.str.3 = [8 x i8] c"TIMEOUT\00"
define i8* @result(i32 %0) {
%2 = and i32 %0, 3
%3 = zext i32 %2 to i64
%4 = shl i64 %3, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.result to i8*), i64 %4)
ret i8* %5
}
int test_imm_DDuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xDD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DDuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14483456
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long long int
unsignedlonglongint_ignoring_signedint(unsigned long long int x, signed int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_signedint(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int run_all_tests();
int main(int argc, char **argv) { return run_all_tests(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @run_all_tests()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run_all_tests()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Aligned_Free(void *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<Aligned_Free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Aligned_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trial_division(int);
void td() { trial_division(44895587973889); }


x86 assembly (clang, -O0):
<td>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1192bb01,%edi
call   1030 <trial_division@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<td>:
mov    $0x1192bb01,%edi
jmp    1030 <trial_division@plt>

LLVM IR (-O0):
define void @td() {
%1 = call i32 @trial_division(i32 294828801)
ret void
}

LLVM IR (-O2):
define void @td() {
%1 = tail call i32 @trial_division(i32 294828801)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_70() {
  Assert_real((isqrt(70) == 8),
              "/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/stdlib/isqrt.c",
              355, ("Integer square root of 70 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_70>:
push   %rbp
mov    %rsp,%rbp
mov    $0x46,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x163,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_70>:
push   %rax
mov    $0x46,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x163,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 70 should be 8\00"
define void @t_sqrt_70() {
%1 = call i32 @isqrt(i32 70)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 70 should be 8\00"
define void @t_sqrt_70() {
%1 = tail call i32 @isqrt(i32 70)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 355, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fun910() { return 910; }


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

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

LLVM IR (-O0):
define i32 @fun910() {
ret i32 910
}

LLVM IR (-O2):
define i32 @fun910() {
ret i32 910
}