xunge/DecIR huggingface dataset:
IR0IR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*p0) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jg     1136 <IR0IR1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <IR0IR1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int yyparse();
main() { printf("yyparse() = %d\n", yyparse()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void wifi_evt_sme_signal_quality(
    const struct wifi_msg_sme_signal_quality_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_signal_quality_evt_t = type opaque
define void @wifi_evt_sme_signal_quality(%struct.wifi_msg_sme_signal_quality_evt_t* nocapture %0) {
ret void
}
void GET_PROMPT_ITGR(r, s, l, u) int *r, l, u;
char *s;
{
  puts((char *)s);
  GET_ITGR(r, l, u);
}


x86 assembly (clang, -O0):
<GET_PROMPT_ITGR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    $0x0,%al
call   1040 <GET_ITGR@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_ITGR>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <GET_ITGR@plt>

LLVM IR (-O0):
define void @GET_PROMPT_ITGR(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %9)
%11 = load i32*, i32** %5
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @GET_ITGR to i32 (i32*, i32, i32, ...)*)(i32* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @GET_PROMPT_ITGR(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%6 = tail call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @GET_ITGR to i32 (i32*, i32, i32, ...)*)(i32* %0, i32 %2, i32 %3)
ret void
}
void gbphy_runtime_get_noresume(struct gbphy_device *gbphy_dev) {}


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

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

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

LLVM IR (-O2):
%struct.gbphy_device = type opaque
define void @gbphy_runtime_get_noresume(%struct.gbphy_device* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_y(void *_p, int _v) {
  ((XConfigureEvent *)_p)->y = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XConfigureEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
terminate(argc, argv) int argc;
char **argv;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @terminate(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct xhda_node {
  int dummy;
};
struct xhda_codec {
  int dummy;
};

/* Variables and functions */
int set_verb_val(struct xhda_codec *, unsigned int, unsigned int, int);
int set_cached_verb3(struct xhda_codec *codec, struct xhda_node *node,
                     unsigned int cmd) {
  return set_verb_val(codec, ((cmd >> 8) & 0x7ff) - 2, cmd, 2);
}


x86 assembly (clang, -O0):
<set_cached_verb3>:
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    -0x14(%rbp),%esi
shr    $0x8,%esi
and    $0x7ff,%esi
sub    $0x2,%esi
mov    -0x14(%rbp),%edx
mov    $0x2,%ecx
call   1030 <set_verb_val@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cached_verb3>:
mov    %edx,%esi
shr    $0x8,%esi
and    $0x7ff,%esi
add    $0xfffffffe,%esi
mov    $0x2,%ecx
jmp    1030 <set_verb_val@plt>

LLVM IR (-O0):
%struct.xhda_codec = type { i32 }
%struct.xhda_node = type { i32 }
define i32 @set_cached_verb3(%struct.xhda_codec* %0, %struct.xhda_node* %1, i32 %2) {
%4 = alloca %struct.xhda_codec*
%5 = alloca %struct.xhda_node*
%6 = alloca i32
store %struct.xhda_codec* %0, %struct.xhda_codec** %4
store %struct.xhda_node* %1, %struct.xhda_node** %5
store i32 %2, i32* %6
%7 = load %struct.xhda_codec*, %struct.xhda_codec** %4
%8 = load i32, i32* %6
%9 = lshr i32 %8, 8
%10 = and i32 %9, 2047
%11 = sub i32 %10, 2
%12 = load i32, i32* %6
%13 = call i32 @set_verb_val(%struct.xhda_codec* %7, i32 %11, i32 %12, i32 2)
ret i32 %13
}

LLVM IR (-O2):
%struct.xhda_codec = type { i32 }
%struct.xhda_node = type { i32 }
define i32 @set_cached_verb3(%struct.xhda_codec* %0, %struct.xhda_node* nocapture readnone %1, i32 %2) {
%4 = lshr i32 %2, 8
%5 = and i32 %4, 2047
%6 = add nsw i32 %5, -2
%7 = tail call i32 @set_verb_val(%struct.xhda_codec* %0, i32 %6, i32 %2, i32 2)
ret i32 %7
}
void panic(what, where) char *what, *where;
{
  printf("Panic: %s in %s\n", what, where);
  exit(-1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Panic: %s in %s\0A\00"
define void @panic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Panic: %s in %s\0A\00"
define void @panic(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
tail call void @exit(i32 -1)
unreachable
}
_falmbDefaultTextPerCharExtents() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbDefaultTextPerCharExtents() {
ret i32 0
}
int ph_ssl_deinit(void *handler) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ph_ssl_deinit(i8* nocapture readnone %0) {
ret i32 0
}
void _ZTVN5javax8security4sasl4SaslE(void) {}


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

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

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

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

/* Variables and functions */
int _mm_ucomilt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomilt_sd(__m128d A, __m128d B) { return _mm_ucomilt_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomilt_sd>:
jmp    1030 <_mm_ucomilt_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_ucomilt_sd(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 @_mm_ucomilt_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_ucomilt_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomilt_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "version %s, usage: runcron [-a post-action-file] [-c chdir] [-m "
          "mailto] command [arguments]\n",
          "0.9");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xf22(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xf25(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [93 x i8] c"version %s, usage: runcron [-a post-action-file] [-c chdir] [-m mailto] command [arguments]\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [93 x i8] c"version %s, usage: runcron [-a post-action-file] [-c chdir] [-m mailto] command [arguments]\0A\00"
@.str.1 = [4 x i8] c"0.9\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mdfour(unsigned char *, unsigned char *, int);
unsigned int Com_BlockChecksum(const void *buffer, int length) {
  int digest[4];
  unsigned int val;
  mdfour((unsigned char *)digest, (unsigned char *)buffer, length);
  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
  return val;
}


x86 assembly (clang, -O0):
<Com_BlockChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockChecksum>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <mdfour@plt>
movdqa (%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = bitcast i32* %7 to i8*
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @mdfour(i8* %8, i8* %9, i32 %10)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%15 = load i32, i32* %14
%16 = xor i32 %13, %15
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%18 = load i32, i32* %17
%19 = xor i32 %16, %18
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%21 = load i32, i32* %20
%22 = xor i32 %19, %21
store i32 %22, i32* %6
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = call i32 @mdfour(i8* %4, i8* %0, i32 %1)
%6 = load <4 x i32>, <4 x i32>* %3
%7 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *estrdup(const char *s) {
  char *p;
  p = strdup(s);
  if (p == NULL)
    err(1, "strdup failed");
  return (p);
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <estrdup+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <estrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"strdup failed\00"
define noalias i8* @estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int access(char *, int);
int /*<<< orphan*/ free(char *);
char *vfs_translate_path(char const *);
int vfs_access(char const *path, int mode) {
  char *rpath = vfs_translate_path(path);
  if (!rpath) {
    return -1;
  }
  int ret = access(rpath, mode);
  free(rpath);
  return ret;
}


x86 assembly (clang, -O0):
<vfs_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <vfs_translate_path@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <vfs_access+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <vfs_access+0x51>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <access@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfs_access>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1050 <vfs_translate_path@plt>
test   %rax,%rax
je     115a <vfs_access+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <access@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
jmp    115f <vfs_access+0x2f>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vfs_access(i8* %0, i32 %1) {
%3 = tail call i8* @vfs_translate_path(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @access(i8* %3, i32 %1)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
void g_io_channel_set_flags() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_set_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void notNullFileLine(void *ptr, char *file, int line) {
  if (ptr == NULL) {
    fprintf(stderr, "\nERROR null pointer. File: %s line: %d\n", file, line);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<notNullFileLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1164 <notNullFileLine+0x44>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notNullFileLine>:
test   %rdi,%rdi
je     1126 <notNullFileLine+0x6>
ret
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"\0AERROR null pointer. File: %s line: %d\0A\00"
define void @notNullFileLine(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"\0AERROR null pointer. File: %s line: %d\0A\00"
define void @notNullFileLine(i8* readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
char *strcopyof(str)
char *str;
{
  char *temp;
  temp = (char *)bc_malloc(strlen(str) + 1);
  return (strcpy(temp, str));
}


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

x86 assembly (clang, -O2):
<strcopyof>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <bc_malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strcopyof(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @bc_malloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcopyof(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @bc_malloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
char *get_twishort_api_key() { return "key\0"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"key\00\00"
define i8* @get_twishort_api_key() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int O_NONBLOCK;
int O_RDONLY;
int open(char *, int);
int beaglelogic_open_nonblock(void) {
  return open("/dev/beaglelogic", O_RDONLY | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<beaglelogic_open_nonblock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2ec4(%rip),%rax
or     (%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_open_nonblock>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/beaglelogic\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @beaglelogic_open_nonblock() {
%1 = load i32, i32* @O_RDONLY
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %1, %2
%4 = call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/beaglelogic\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @beaglelogic_open_nonblock() {
%1 = load i32, i32* @O_RDONLY
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
void test_random_read_file() {}


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

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

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

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

/* Variables and functions */
__attribute__((always_)) void uvisor_write16(uint16_t volatile *addr,
                                             uint16_t val) {
  *(addr) = val;
}


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

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

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

LLVM IR (-O2):
define void @uvisor_write16(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
int calc_h_end(int id, int height, int number_of_threads) {
  int h_end = ((id + 1) * height / number_of_threads) - 1;
  if (height < number_of_threads) {
    if (id == 0) {
      return height - 1;
    } else {
      return -1;
    }
  } else {
    if (h_end < height) {
      return h_end;
    } else {
      return -1;
    }
  }
}


x86 assembly (clang, -O0):
<calc_h_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1151 <calc_h_end+0x51>
cmpl   $0x0,-0x8(%rbp)
jne    1145 <calc_h_end+0x45>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <calc_h_end+0x6f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <calc_h_end+0x6f>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <calc_h_end+0x68>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <calc_h_end+0x6f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_h_end>:
mov    %edx,%ecx
lea    0x1(%rdi),%eax
imul   %esi,%eax
cltd
idiv   %ecx
cmp    %ecx,%esi
jge    1119 <calc_h_end+0x19>
add    $0xffffffff,%esi
neg    %edi
sbb    %eax,%eax
or     %esi,%eax
ret
lea    -0x1(%rax),%ecx
cmp    %esi,%eax
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calc_h_end(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %7
%14 = sdiv i32 %12, %13
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %3
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %4
br label %33
25: ; preds = %19
store i32 -1, i32* %4
br label %33
26: ; preds = %3
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i32, i32* %8
store i32 %31, i32* %4
br label %33
32: ; preds = %26
store i32 -1, i32* %4
br label %33
33: ; preds = %32, %30, %25, %22
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @calc_h_end(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 1
%5 = mul nsw i32 %4, %1
%6 = sdiv i32 %5, %2
%7 = icmp slt i32 %1, %2
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = icmp eq i32 %0, 0
%10 = add nsw i32 %1, -1
%11 = select i1 %9, i32 %10, i32 -1
br label %16
12: ; preds = %3
%13 = add nsw i32 %6, -1
%14 = icmp sgt i32 %6, %1
%15 = select i1 %14, i32 -1, i32 %13
br label %16
16: ; preds = %8, %12
%17 = phi i32 [ %15, %12 ], [ %11, %8 ]
ret i32 %17
}
void do_sys_exit(int return_code) { return; }


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

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

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

LLVM IR (-O2):
define void @do_sys_exit(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ inBounds(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
int SafeRead(u_int8_t *start, u_int8_t *end, u_int8_t *src, u_int8_t *read) {
  if (!inBounds(start, end, src)) {
    return 0;
    ;
  }
  *read = *start;
  return 1;
}


x86 assembly (clang, -O0):
<SafeRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <inBounds@plt>
cmp    $0x0,%eax
jne    114e <SafeRead+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1161 <SafeRead+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeRead>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
call   1030 <inBounds@plt>
test   %eax,%eax
je     112f <SafeRead+0x1f>
mov    (%rbx),%eax
mov    %eax,(%r14)
mov    $0x1,%eax
jmp    1131 <SafeRead+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @SafeRead(i32* %0, i32* %1, i32* %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @inBounds(i32* %0, i32* %1, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = load i32, i32* %0
store i32 %8, i32* %3
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %10
}
int main() { return ((~(unsigned long long)0) >> 1) == -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double sin(double);
double sinpi(double a) { return sin(3.14159265358979323846 * a); }


x86 assembly (clang, -O0):
<sinpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinpi>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sinpi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x400921FB54442D18, %3
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @sinpi(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void intclean(const int *const i) { printf("intclean: %d\n", *i); }


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

x86 assembly (clang, -O2):
<intclean>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"intclean: %d\0A\00"
define void @intclean(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t be_to_u16(uint8_t *bytes, int start) {
  uint16_t n =
      ((uint16_t)bytes[start + 1] << 0) | ((uint16_t)bytes[start] << 8);
  return n;
}


x86 assembly (clang, -O0):
<be_to_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_to_u16>:
movslq %esi,%rcx
mov    (%rdi,%rcx,8),%eax
shl    $0x8,%eax
or     0x8(%rdi,%rcx,8),%eax
ret

LLVM IR (-O0):
define i32 @be_to_u16(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %6, i64 %9
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 0
%14 = load i64*, i64** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %13, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @be_to_u16(i64* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %12, %7
ret i32 %13
}
/* Variables and functions */
float acos(float);
float get(char *);
int /*<<< orphan*/ printf(char *, float);
void findAcos() {
  float num = get("Enter your number");
  float result = acos(num);
  printf("Result: %f", result);
}


x86 assembly (clang, -O0):
<findAcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <get@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <acos@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAcos>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <get@plt>
call   1040 <acos@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAcos() {
%1 = alloca float
%2 = alloca float
%3 = call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store float %3, float* %1
%4 = load float, float* %1
%5 = call float @acos(float %4)
store float %5, float* %2
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAcos() {
%1 = tail call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call float @acos(float %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  printf("i++ values %d\n", i++);
  i = 0;
  printf("++i values %d\n", ++i);
  i = 0;
  printf("i=i+2 values %d\n", i = i + 2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"i++ values %d\0A\00"
@.str.1 = [15 x i8] c"++i values %d\0A\00"
@.str.2 = [17 x i8] c"i=i+2 values %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 0, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 0, i32* %2
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 2
store i32 %10, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @makeprocs()
ret i32 0
}
__attribute__((no, noclone)) unsigned long foo(unsigned x) {
  unsigned long a, c = x;
  asm volatile("xorl\t%k1, %k1\n\tmovl\t$7, %k0"
               : "=c"(c), "=a"(a)
               : "0"(c), "1"(c)
               : "memory");
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%rax
xor    %eax,%eax
mov    $0x7,%ecx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
mov    %rax,%rcx
xor    %eax,%eax
mov    $0x7,%ecx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = call { i64, i64 } asm sideeffect "xorl\09${1:k}, ${1:k}\0A\09movl\09$$7, ${0:k}", "={cx},={ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %7, i64 %8)
%10 = extractvalue { i64, i64 } %9, 0
%11 = extractvalue { i64, i64 } %9, 1
store i64 %10, i64* %4
store i64 %11, i64* %3
%12 = load i64, i64* %4
ret i64 %12
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call { i64, i64 } asm sideeffect "xorl\09${1:k}, ${1:k}\0A\09movl\09$$7, ${0:k}", "={cx},={ax},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %2, i64 %2)
%4 = extractvalue { i64, i64 } %3, 0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
void inthandler27(int *esp) {
  io_out8(0x0020, 0x67);
  return;
}


x86 assembly (clang, -O0):
<inthandler27>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x20,%edi
mov    $0x67,%esi
call   1030 <io_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthandler27>:
mov    $0x20,%edi
mov    $0x67,%esi
jmp    1030 <io_out8@plt>

LLVM IR (-O0):
define void @inthandler27(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @io_out8(i32 32, i32 103)
ret void
}

LLVM IR (-O2):
define void @inthandler27(i32* nocapture readnone %0) {
%2 = tail call i32 @io_out8(i32 32, i32 103)
ret void
}
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf) {
  return 0;
}


x86 assembly (clang, -O0):
<l2_select_table>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @l2_select_table(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G162_f(char *s) {
  debug("G162_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G162_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G162_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"G162_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G162_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"G162_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G162_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int variable_test_bit(int nr, const volatile void *addr) {
  int oldbit;
  asm volatile("btl %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit)
               : "m"((*(const volatile long *)addr)), "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<variable_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bt     %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variable_test_bit>:
bt     %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @variable_test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i32, i32* %3
%9 = call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @variable_test_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = tail call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0)
ret i32 %4
}