xunge/DecIR huggingface dataset:
u() { return 1; }


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

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

LLVM IR (-O0):
define i32 @u() {
ret i32 1
}

LLVM IR (-O2):
define i32 @u() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(int c) {
#pragma critTer : 7 : hello.c:
  printf("Hello world.\n");
#pragma critTer : 8 : hello.c:
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define void @foo(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *ft_strdup(char *);
char *ft_getnull(void) { return (ft_strdup("(null)")); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define i8* @ft_getnull() {
%1 = tail call i8* @ft_strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void foo586(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo586(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlnkInvalidateCache(unsigned int, int);
void cma_invalidate_cache(void *buf, unsigned int phys_addr, int size) {
  xlnkInvalidateCache(phys_addr, size);
}


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

x86 assembly (clang, -O2):
<cma_invalidate_cache>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <xlnkInvalidateCache@plt>

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

LLVM IR (-O2):
define void @cma_invalidate_cache(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @xlnkInvalidateCache(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int getSize(int, int, char);
int getsizeBox(int level, char y) { return getSize(level, 1, y); }


x86 assembly (clang, -O0):
<getsizeBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
movsbl -0x5(%rbp),%edx
call   1030 <getSize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsizeBox>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <getSize@plt>

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

LLVM IR (-O2):
define i32 @getsizeBox(i32 %0, i8 signext %1) {
%3 = tail call i32 @getSize(i32 %0, i32 1, i8 signext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fname();
int /*<<< orphan*/ unlink(int /*<<< orphan*/);
int dcd_delpid(void) {
  unlink(fname());
  return 0;
}


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

x86 assembly (clang, -O2):
<dcd_delpid>:
push   %rax
xor    %eax,%eax
call   1040 <fname@plt>
mov    %eax,%edi
call   1030 <unlink@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dcd_delpid() {
%1 = call i32 (...) @fname()
%2 = call i32 @unlink(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @dcd_delpid() {
%1 = tail call i32 (...) @fname()
%2 = tail call i32 @unlink(i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha256;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_sha256_update(EVP_MD_CTX *ctx, const void *data,
                            unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_sha256));
}


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

x86 assembly (clang, -O2):
<jksengine_sha256_update>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

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

LLVM IR (-O2):
@NID_sha256 = global i32 0
define i32 @jksengine_sha256_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_sha256
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(void) {
  short int x = 128;
  x = x << 1;
  printf("after one shift operation: %d\n", x);
  x = x << 3;
  printf("after two shift operation: %d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x80,-0x6(%rbp)
movswl -0x6(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x6(%rbp)
lea    0xec9(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
movswl -0x6(%rbp),%eax
shl    $0x3,%eax
mov    %ax,-0x6(%rbp)
lea    0xecd(%rip),%rdi
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"after one shift operation: %d\0A\00"
@.str.1 = [30 x i8] c"after two shift operation: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 128, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = shl i32 %4, 1
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
%7 = load i16, i16* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 signext %7)
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = shl i32 %10, 3
%12 = trunc i32 %11 to i16
store i16 %12, i16* %2
%13 = load i16, i16* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i16 signext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"after one shift operation: %d\0A\00"
@.str.1 = [30 x i8] c"after two shift operation: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i16 signext 256)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i16 signext 2048)
ret i32 0
}
/* Type definitions */
struct libgamma_crtc_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libgamma_crtc_state *);
int /*<<< orphan*/ libgamma_crtc_destroy(struct libgamma_crtc_state *);
__attribute__((__nonnull__)) void
libgamma_crtc_free(struct libgamma_crtc_state *restrict this__) {
  libgamma_crtc_destroy(this__);
  free(this__);
}


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

x86 assembly (clang, -O2):
<libgamma_crtc_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <libgamma_crtc_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libgamma_crtc_state = type { i32 }
define void @libgamma_crtc_free(%struct.libgamma_crtc_state* noalias %0) {
%2 = alloca %struct.libgamma_crtc_state*
store %struct.libgamma_crtc_state* %0, %struct.libgamma_crtc_state** %2
%3 = load %struct.libgamma_crtc_state*, %struct.libgamma_crtc_state** %2
%4 = call i32 @libgamma_crtc_destroy(%struct.libgamma_crtc_state* %3)
%5 = load %struct.libgamma_crtc_state*, %struct.libgamma_crtc_state** %2
%6 = call i32 @free(%struct.libgamma_crtc_state* %5)
ret void
}

LLVM IR (-O2):
%struct.libgamma_crtc_state = type { i32 }
define void @libgamma_crtc_free(%struct.libgamma_crtc_state* noalias %0) {
%2 = tail call i32 @libgamma_crtc_destroy(%struct.libgamma_crtc_state* %0)
%3 = tail call i32 @free(%struct.libgamma_crtc_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] s\n", name);
  fprintf(stderr, "       %s [-n/-p/-r]\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedd(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xee1(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] s\0A\00"
@.str.1 = [22 x i8] c" %s [-n/-p/-r]\0A\00"
@.str.2 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [options] s\0A\00"
@.str.1 = [22 x i8] c" %s [-n/-p/-r]\0A\00"
@.str.2 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
void bfqg_stats_set_start_idle_time(struct bfq_group *bfqg) {}


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

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

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

LLVM IR (-O2):
%struct.bfq_group = type opaque
define void @bfqg_stats_set_start_idle_time(%struct.bfq_group* nocapture %0) {
ret void
}
float ftoc(float fahr) { return (5.0 / 9.0) * (fahr - 32); }


x86 assembly (clang, -O0):
<ftoc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoc>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ftoc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fpext float %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @ftoc(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
void inicia_engine() {
  if (initscr() == NULL) {
    printf("ERROR na inicia_engine()\n");
    exit(0);
  }
  raw();
  keypad(stdscr, TRUE);
  noecho();
}


x86 assembly (clang, -O0):
<inicia_engine>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
cmp    $0x0,%rax
jne    1188 <inicia_engine+0x28>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
mov    $0x0,%al
call   1060 <raw@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicia_engine>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
test   %rax,%rax
je     1193 <inicia_engine+0x33>
xor    %eax,%eax
call   1060 <raw@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <noecho@plt>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"ERROR na inicia_engine()\0A\00"
@stdscr = global i32 0
@TRUE = global i32 0
define void @inicia_engine() {
%1 = call i32* (...) @initscr()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 (...) @raw()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
%11 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@str = [25 x i8] c"ERROR na inicia_engine()\00"
define void @inicia_engine() {
%1 = tail call i32* (...) @initscr()
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 (...) @raw()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
%11 = tail call i32 (...) @noecho()
ret void
}
/* Variables and functions */
int exp(double const);
double gaussian_gradient(const double x) { return -2 * x * exp(-x * x); }


x86 assembly (clang, -O0):
<gaussian_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian_gradient>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd 0xee6(%rip),%xmm1
xorpd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gaussian_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -2.000000e+00, %3
%5 = load double, double* %2
%6 = fneg double %5
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call i32 @exp(double %8)
%10 = sitofp i32 %9 to double
%11 = fmul double %4, %10
ret double %11
}

LLVM IR (-O2):
define double @gaussian_gradient(double %0) {
%2 = fmul double %0, -2.000000e+00
%3 = fneg double %0
%4 = fmul double %3, %0
%5 = tail call i32 @exp(double %4)
%6 = sitofp i32 %5 to double
%7 = fmul double %2, %6
ret double %7
}
/* Variables and functions */
double *malloc(int);
int /*<<< orphan*/ my_task(double *, double *);
void two_pointers_unregistered_before_call(void) {
  double *p, *q;
  p = malloc(12 * sizeof *p);
  q = malloc(23 * sizeof *q);
  my_task(p, q);
#pragma starpu register p 12
#pragma starpu register q 23
}


x86 assembly (clang, -O0):
<two_pointers_unregistered_before_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x60,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0xb8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <my_task@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_pointers_unregistered_before_call>:
push   %rbx
mov    $0x60,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xb8,%edi
call   1040 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <my_task@plt>

LLVM IR (-O0):
define void @two_pointers_unregistered_before_call() {
%1 = alloca double*
%2 = alloca double*
%3 = call double* @malloc(i32 96)
store double* %3, double** %1
%4 = call double* @malloc(i32 184)
store double* %4, double** %2
%5 = load double*, double** %1
%6 = load double*, double** %2
%7 = call i32 @my_task(double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @two_pointers_unregistered_before_call() {
%1 = tail call double* @malloc(i32 96)
%2 = tail call double* @malloc(i32 184)
%3 = tail call i32 @my_task(double* %1, double* %2)
ret void
}
/* Type definitions */
struct mavl {
  int dummy;
};

/* Variables and functions */
char const *mavl_add(struct mavl *, char *);
char *strdup(char const *);
const char *stravltree_add(struct mavl *t, const char *str) {
  char *s = strdup(str);
  if (!s)
    return 0;
  return mavl_add(t, s);
}


x86 assembly (clang, -O0):
<stravltree_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <stravltree_add+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1166 <stravltree_add+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <mavl_add@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stravltree_add>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strdup@plt>
test   %rax,%rax
je     113d <stravltree_add+0x1d>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <mavl_add@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mavl = type { i32 }
define i8* @stravltree_add(%struct.mavl* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.mavl*
%5 = alloca i8*
%6 = alloca i8*
store %struct.mavl* %0, %struct.mavl** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i8* null, i8** %3
br label %16
12: ; preds = %2
%13 = load %struct.mavl*, %struct.mavl** %4
%14 = load i8*, i8** %6
%15 = call i8* @mavl_add(%struct.mavl* %13, i8* %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %12, %11
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
%struct.mavl = type { i32 }
define i8* @stravltree_add(%struct.mavl* %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @mavl_add(%struct.mavl* %0, i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
void INT_Excep_SCI2_TXI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI2_TXI2() {
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t get_two_digit_number(const char *tptr) {
  int16_t rval = (int16_t)(tptr[1] - '0');
  if (tptr[0] != ' ')
    rval = (int16_t)((tptr[0] - '0') * 10 + rval);
  return (rval);
}


x86 assembly (clang, -O0):
<get_two_digit_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x30,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1140 <get_two_digit_number+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_two_digit_number>:
movsbq 0x1(%rdi),%rax
movsbq (%rdi),%rcx
xor    %edx,%edx
cmp    $0x20,%rcx
lea    (%rcx,%rcx,4),%rcx
lea    -0x1e0(%rcx,%rcx,1),%rcx
ff
cmovne %rcx,%rdx
add    %rdx,%rax
add    $0xffffffffffffffd0,%rax
ret

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

LLVM IR (-O2):
define i64 @get_two_digit_number(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
%5 = add nsw i64 %4, -48
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 32
%8 = sext i8 %6 to i64
%9 = mul nsw i64 %8, 10
%10 = add nsw i64 %9, -480
%11 = select i1 %7, i64 0, i64 %10
%12 = add nsw i64 %5, %11
ret i64 %12
}
int g3(int (*p)[], int (*q)[3]) { return q > p; }


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

x86 assembly (clang, -O2):
<g3>:
xor    %eax,%eax
cmp    %rsi,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @g3([0 x i32]* %0, [3 x i32]* %1) {
%3 = alloca [0 x i32]*
%4 = alloca [3 x i32]*
store [0 x i32]* %0, [0 x i32]** %3
store [3 x i32]* %1, [3 x i32]** %4
%5 = load [3 x i32]*, [3 x i32]** %4
%6 = load [0 x i32]*, [0 x i32]** %3
%7 = bitcast [0 x i32]* %6 to [3 x i32]*
%8 = icmp ugt [3 x i32]* %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @g3([0 x i32]* readnone %0, [3 x i32]* readnone %1) {
%3 = bitcast [0 x i32]* %0 to [3 x i32]*
%4 = icmp ult [3 x i32]* %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vgaentry(const char c, const uint8_t colour) {
  uint16_t c16 = c;
  uint16_t colour16 = colour;
  return c16 | colour16 << 8;
}


x86 assembly (clang, -O0):
<make_vgaentry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vgaentry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vgaentry(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @make_vgaentry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ endswap32(int /*<<< orphan*/);
scalar_t__ is_little_endian();
uint32_t be32_to_cpu(uint32_t x) {
  uint32_t ret = x;
  if (is_little_endian()) {
    ret = endswap32(x);
  }
  return ret;
}


x86 assembly (clang, -O0):
<be32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114d <be32_to_cpu+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <endswap32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32_to_cpu>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <be32_to_cpu+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <endswap32@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @be32_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = call i64 (...) @is_little_endian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @endswap32(i32 %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @endswap32(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void seeders_and_leechers(const char *infohash, int *seeders, int *leechers) {}


x86 assembly (clang, -O0):
<seeders_and_leechers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @seeders_and_leechers(i8* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void f(int v, int i) {
  assert(v == 2);
  assert(i * i == 9);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
imul   %ebx,%ebx
xor    %edi,%edi
cmp    $0x9,%ebx
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @f(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 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = icmp eq i32 %11, 9
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = mul nsw i32 %1, %1
%7 = icmp eq i32 %6, 9
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
unsigned long long combine_balanced(unsigned long long a,
                                    unsigned long long b) {
  return (a & 0xffffffff00000000ll) | (b & 0x00000000ffffffffll);
}


x86 assembly (clang, -O0):
<combine_balanced>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xffffffff00000000,%rax
ff ff ff
and    -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    -0x10(%rbp),%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<combine_balanced>:
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rdi,%rcx
mov    %esi,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @combine_balanced(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, -4294967296
%7 = load i64, i64* %4
%8 = and i64 %7, 4294967295
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @combine_balanced(i64 %0, i64 %1) {
%3 = and i64 %0, -4294967296
%4 = and i64 %1, 4294967295
%5 = or i64 %4, %3
ret i64 %5
}
/* Type definitions */
struct ns_mgr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ns_mgr *);
int /*<<< orphan*/ ns_mgr_free(struct ns_mgr *);
int /*<<< orphan*/ ns_mgr_poll(struct ns_mgr *, int);
void ssl_wrapper_serve(void *param, volatile int *quit) {
  struct ns_mgr *mgr = (struct ns_mgr *)param;
  while (*quit == 0) {
    ns_mgr_poll(mgr, 1000);
  }
  ns_mgr_free(mgr);
  free(mgr);
}


x86 assembly (clang, -O0):
<ssl_wrapper_serve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
jne    116a <ssl_wrapper_serve+0x3a>
mov    -0x18(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <ns_mgr_poll@plt>
jmp    1148 <ssl_wrapper_serve+0x18>
mov    -0x18(%rbp),%rdi
call   1050 <ns_mgr_free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_wrapper_serve>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpl   $0x0,(%rsi)
jne    1152 <ssl_wrapper_serve+0x22>
mov    %rsi,%rbx
nop
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1040 <ns_mgr_poll@plt>
cmpl   $0x0,(%rbx)
je     1140 <ssl_wrapper_serve+0x10>
mov    %r14,%rdi
call   1050 <ns_mgr_free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ns_mgr = type { i32 }
define void @ssl_wrapper_serve(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.ns_mgr*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.ns_mgr*
store %struct.ns_mgr* %7, %struct.ns_mgr** %5
br label %8
8: ; preds = %12, %2
%9 = load i32*, i32** %4
%10 = load volatile i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load %struct.ns_mgr*, %struct.ns_mgr** %5
%14 = call i32 @ns_mgr_poll(%struct.ns_mgr* %13, i32 1000)
br label %8
15: ; preds = %8
%16 = load %struct.ns_mgr*, %struct.ns_mgr** %5
%17 = call i32 @ns_mgr_free(%struct.ns_mgr* %16)
%18 = load %struct.ns_mgr*, %struct.ns_mgr** %5
%19 = call i32 @free(%struct.ns_mgr* %18)
ret void
}

LLVM IR (-O2):
%struct.ns_mgr = type { i32 }
define void @ssl_wrapper_serve(i8* %0, i32* %1) {
%3 = bitcast i8* %0 to %struct.ns_mgr*
%4 = load volatile i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2, %6
%7 = tail call i32 @ns_mgr_poll(%struct.ns_mgr* %3, i32 1000)
%8 = load volatile i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %2
%11 = tail call i32 @ns_mgr_free(%struct.ns_mgr* %3)
%12 = tail call i32 @free(%struct.ns_mgr* %3)
ret void
}
void avpriv_codec_get_cap_skip_frame_fill_param() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_codec_get_cap_skip_frame_fill_param() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void my_close(int sd) { close(sd); }


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

x86 assembly (clang, -O2):
<my_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @my_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void RTSymlinkExists(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSymlinkExists() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ libadjust_error_print(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void log_error_and_exit(char *origin) {
  fprintf(stderr, "Failure in %s.  Error backtrace:\n", origin);
  libadjust_error_print(stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<log_error_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <libadjust_error_print@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<log_error_and_exit>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <libadjust_error_print@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Failure in %s. Error backtrace:\0A\00"
@EXIT_FAILURE = global i32 0
define void @log_error_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @libadjust_error_print(i32 %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Failure in %s. Error backtrace:\0A\00"
@EXIT_FAILURE = global i32 0
define void @log_error_and_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @libadjust_error_print(i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t get_port(char *string) {
  uint16_t port = 0;
  for (int i = 0; string[i] != '\0'; i++)
    port = port * 10 + string[i] - '0';
  return port;
}


x86 assembly (clang, -O0):
<get_port>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <get_port+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <get_port+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_port>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <get_port+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <get_port+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_port(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 10
%16 = load i8*, i8** %2
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %15, %21
%23 = sub nsw i32 %22, 48
store i32 %23, i32* %3
br label %24
24: ; preds = %13
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_port(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_create1();
int /*<<< orphan*/ pthread_create2();
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, void **);
int /*<<< orphan*/ pthread_self();
int main(int argc, char *argv[]) {
  printf("main pid %d thread_id %lx\n", getpid(), pthread_self());
  pthread_create1();
  pthread_t p2 = pthread_create2();
  void *rev2;
  pthread_join(p2, &rev2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <pthread_create1@plt>
mov    $0x0,%al
call   1050 <pthread_create2@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1080 <pthread_join@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xe84(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <pthread_create1@plt>
xor    %eax,%eax
call   1050 <pthread_create2@plt>
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1080 <pthread_join@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"main pid %d thread_id %lx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @getpid()
%9 = call i32 (...) @pthread_self()
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 (...) @pthread_create1()
%12 = call i32 (...) @pthread_create2()
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @pthread_join(i32 %13, i8** %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"main pid %d thread_id %lx\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = tail call i32 (...) @pthread_create1()
%8 = tail call i32 (...) @pthread_create2()
%9 = bitcast i8** %3 to i8*
%10 = call i32 @pthread_join(i32 %8, i8** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_nl();
int /*<<< orphan*/ print_str(char *);
void print_str_str_nl(char *s, char *str) {
  print_str(s);
  print_str(str);
  print_nl();
}


x86 assembly (clang, -O0):
<print_str_str_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <print_str@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_str@plt>
mov    $0x0,%al
call   1030 <print_nl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str_str_nl>:
push   %rbx
mov    %rsi,%rbx
call   1040 <print_str@plt>
mov    %rbx,%rdi
call   1040 <print_str@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <print_nl@plt>

LLVM IR (-O0):
define void @print_str_str_nl(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 = call i32 @print_str(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @print_str(i8* %7)
%9 = call i32 (...) @print_nl()
ret void
}

LLVM IR (-O2):
define void @print_str_str_nl(i8* %0, i8* %1) {
%3 = tail call i32 @print_str(i8* %0)
%4 = tail call i32 @print_str(i8* %1)
%5 = tail call i32 (...) @print_nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  union {
    struct {
      int st_first;
      int st_second;
    } st;
  } x;
  x.st.st_first = 5;
  if (*(int *)((char *)&x.st.st_second - sizeof(int)) != 5)
    abort();
  if (5 != (*(int *)((char *)&x.st.st_second - sizeof(int))))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
je     1137 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x5,%eax
cmp    -0x10(%rbp),%eax
je     114c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to %struct.anon*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i32 5, i32* %4
%5 = bitcast %union.anon* %2 to %struct.anon*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 1
%7 = bitcast i32* %6 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 -4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 5
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %0
%15 = bitcast %union.anon* %2 to %struct.anon*
%16 = getelementptr inbounds %struct.anon, %struct.anon* %15, i32 0, i32 1
%17 = bitcast i32* %16 to i8*
%18 = getelementptr inbounds i8, i8* %17, i64 -4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp ne i32 5, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int no_uint(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @no_uint() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MacSound_SubTick(int);
void SubTickNotify(int SubTick) { MacSound_SubTick(SubTick); }


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

x86 assembly (clang, -O2):
<SubTickNotify>:
jmp    1030 <MacSound_SubTick@plt>

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

LLVM IR (-O2):
define void @SubTickNotify(i32 %0) {
%2 = tail call i32 @MacSound_SubTick(i32 %0)
ret void
}
__attribute__((always_)) void *linkRegister() {
  return __builtin_return_address(0);
}


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

x86 assembly (clang, -O2):
<linkRegister>:
mov    (%rsp),%rax
ret

LLVM IR (-O0):
define i8* @linkRegister() {
%1 = call i8* @llvm.returnaddress(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @linkRegister() {
%1 = tail call i8* @llvm.returnaddress(i32 0)
ret i8* %1
}
int is_line_end(char c) { return (int)(c == 0 || c == '\r' || c == '\n'); }


x86 assembly (clang, -O0):
<is_line_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_line_end+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_line_end+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_line_end>:
mov    $0x1,%eax
test   %dil,%dil
je     1110 <is_line_end+0x10>
cmp    $0xd,%dil
jne    1111 <is_line_end+0x11>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_line_end(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_line_end(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}