xunge/DecIR huggingface dataset:
/* Variables and functions */
void *realloc(void *, int);
void *mymemset(void *s, int c, int n) {
  void *ret = s;
  int i = 0;
  for (i = 0; i < n; i++) {
    *((char *)ret + i) = c;
  }
  return realloc(ret, n);
}


x86 assembly (clang, -O0):
<mymemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1162 <mymemset+0x52>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1138 <mymemset+0x28>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymemset>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
test   %edx,%edx
jle    1137 <mymemset+0x17>
mov    %ebx,%edx
mov    %r14,%rdi
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <realloc@plt>

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

LLVM IR (-O2):
define i8* @mymemset(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
%9 = tail call i8* @realloc(i8* %0, i32 %2)
ret i8* %9
}
__typeof__(fscanf(1, (void *)1)) test_fscanf_221(void) {
  return fscanf(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_fscanf_221>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <fscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fscanf_221>:
mov    $0x1,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
define i32 @test_fscanf_221() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_fscanf_221() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int);
void check_signum(int sig) {
  if (sig < 1 || sig >= 32) {
    die("BUG: signal out of range: %d", sig);
  }
}


x86 assembly (clang, -O0):
<check_signum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     112f <check_signum+0x1f>
cmpl   $0x20,-0x4(%rbp)
jl     113e <check_signum+0x2e>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_signum>:
mov    %edi,%esi
lea    -0x20(%rsi),%eax
cmp    $0xffffffe0,%eax
ja     1126 <check_signum+0x16>
lea    0xedf(%rip),%rdi
jmp    1030 <die@plt>
ret

LLVM IR (-O0):
@.str = [29 x i8] c"BUG: signal out of range: %d\00"
define void @check_signum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"BUG: signal out of range: %d\00"
define void @check_signum(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, -31
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_requestblob_callback(void *user_data) {
  printf("requestblob_callback\n");
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"requestblob_callback\00"
define void @mumble_requestblob_callback(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inflate_entry();
int inflate() {
  int status;
  status = inflate_entry();
  return status;
}


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

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

LLVM IR (-O0):
define i32 @inflate() {
%1 = alloca i32
%2 = call i32 (...) @inflate_entry()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @inflate() {
%1 = tail call i32 (...) @inflate_entry()
ret i32 %1
}
void XkbFreeClientMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeClientMap() {
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ single_thread_different_keys(struct __test_metadata *);
void wrapper_single_thread_different_keys(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  single_thread_different_keys(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_single_thread_different_keys>:
jmp    1030 <single_thread_different_keys@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_single_thread_different_keys(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @single_thread_different_keys(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_single_thread_different_keys(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @single_thread_different_keys(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
long double asinl(long double);
long double asind(long double x) {
  return asinl(x) / 3.141592653589793238462643383279502884L * 180.0L;
}


x86 assembly (clang, -O0):
<asind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <asinl@plt>
fldt   0xecf(%rip)
fdivrp %st,%st(1)
flds   0xed7(%rip)
fmulp  %st,%st(1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asind>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <asinl@plt>
fldt   0xeda(%rip)
fdivrp %st,%st(1)
fmuls  0xee2(%rip)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @asind(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @asinl(x86_fp80 %3)
%5 = fdiv x86_fp80 %4, 0xK4000C90FDAA22168C235
%6 = fmul x86_fp80 %5, 0xK4006B400000000000000
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @asind(x86_fp80 %0) {
%2 = tail call x86_fp80 @asinl(x86_fp80 %0)
%3 = fdiv x86_fp80 %2, 0xK4000C90FDAA22168C235
%4 = fmul x86_fp80 %3, 0xK4006B400000000000000
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, int *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void ResumeUpdate(int *savePtr) {
  if (!CheckRunningInMainThread("ResumeUpdate"))
    return;
  CallBack1(30, savePtr);
}


x86 assembly (clang, -O0):
<ResumeUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1146 <ResumeUpdate+0x26>
jmp    1154 <ResumeUpdate+0x34>
mov    -0x8(%rbp),%rsi
mov    $0x1e,%edi
call   1030 <CallBack1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResumeUpdate>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1142 <ResumeUpdate+0x22>
mov    $0x1e,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <CallBack1@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"ResumeUpdate\00"
define void @ResumeUpdate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @CallBack1(i32 30, i32* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ResumeUpdate\00"
define void @ResumeUpdate(i32* %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @CallBack1(i32 30, i32* %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t pcg_rotr_64(uint64_t value, unsigned int rot) {
  return (value >> rot) | (value << ((-rot) & 63));
}


x86 assembly (clang, -O0):
<pcg_rotr_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_rotr_64>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @pcg_rotr_64(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = and i32 %10, 63
%12 = shl i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @pcg_rotr_64(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 63
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
int ieee80211_dsss_chan_to_freq(int channel) {
  if ((channel > 0) && (channel < 14))
    return 2407 + (channel * 5);
  else if (channel == 14)
    return 2484;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ieee80211_dsss_chan_to_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112c <ieee80211_dsss_chan_to_freq+0x2c>
cmpl   $0xe,-0x8(%rbp)
jge    112c <ieee80211_dsss_chan_to_freq+0x2c>
imul   $0x5,-0x8(%rbp),%eax
add    $0x967,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <ieee80211_dsss_chan_to_freq+0x49>
cmpl   $0xe,-0x8(%rbp)
jne    1142 <ieee80211_dsss_chan_to_freq+0x42>
movl   $0x9b4,-0x4(%rbp)
jmp    1149 <ieee80211_dsss_chan_to_freq+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_dsss_chan_to_freq>:
lea    -0x1(%rdi),%eax
cmp    $0xe,%edi
mov    $0x9b4,%ecx
mov    $0xffffffff,%edx
cmove  %ecx,%edx
cmp    $0xd,%eax
lea    0x967(%rdi,%rdi,4),%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @ieee80211_dsss_chan_to_freq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 14
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 5
%12 = add nsw i32 2407, %11
store i32 %12, i32* %2
br label %18
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 14
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2484, i32* %2
br label %18
17: ; preds = %13
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ieee80211_dsss_chan_to_freq(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 13
%4 = mul nsw i32 %0, 5
%5 = add nsw i32 %4, 2407
%6 = icmp eq i32 %0, 14
%7 = select i1 %6, i32 2484, i32 -1
%8 = select i1 %3, i32 %5, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xaa() {
  Assert_real((isxdigit(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              855, ("isxdigit should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x357,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xaa\00"
define void @t_isxdigit_0xaa() {
%1 = call i64 @isxdigit(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xaa\00"
define void @t_isxdigit_0xaa() {
%1 = tail call i64 @isxdigit(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float my_sin(float);
float my_cos(float x) { return my_sin(x + (3.141592653589793 / 2)); }


x86 assembly (clang, -O0):
<my_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <my_sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cos>:
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <my_sin@plt>

LLVM IR (-O0):
define float @my_cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 0x3FF921FB54442D18
%6 = fptrunc double %5 to float
%7 = call float @my_sin(float %6)
ret float %7
}

LLVM IR (-O2):
define float @my_cos(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 0x3FF921FB54442D18
%4 = fptrunc double %3 to float
%5 = tail call float @my_sin(float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ andysh_loop();
int /*<<< orphan*/ init();
int main() {
  init();
  andysh_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @andysh_loop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myDummyTestMethod(void) {
  printf("Hello World, this is a test function\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hello World, this is a test function\0A\00"
define void @myDummyTestMethod() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello World, this is a test function\00"
define void @myDummyTestMethod() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
long small_msg_send(long *destination, long *msgpt) {
  long res = 1;
  __asm__ volatile("int $0x80"
                   : "=a"(res)
                   : "0"(res), "b"(*destination), "c"(*msgpt));
  if (res == 1)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<small_msg_send>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rbx
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
int    $0x80
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    1145 <small_msg_send+0x45>
movq   $0x1,-0x10(%rbp)
jmp    114d <small_msg_send+0x4d>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_msg_send>:
push   %rbx
mov    (%rdi),%rbx
mov    (%rsi),%rcx
mov    $0x1,%eax
int    $0x80
xor    %ecx,%ecx
cmp    $0x1,%rax
sete   %cl
lea    (%rcx,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @small_msg_send(i64* %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 1, i64* %6
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %7, i64 %9, i64 %11)
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = icmp eq i64 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %2
store i64 1, i64* %3
br label %17
16: ; preds = %2
store i64 -1, i64* %3
br label %17
17: ; preds = %16, %15
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @small_msg_send(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 1, i64 %3, i64 %4)
%6 = icmp eq i64 %5, 1
%7 = select i1 %6, i64 1, i64 -1
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc9(void) {
  printf("Executing exitfunc9.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc9.\0A\00"
define void @exitfunc9() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc9.\00"
define void @exitfunc9() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int unix_statfcn(const char *path, struct stat *st_buf) {
  int err = stat(path, st_buf);
  return err;
}


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

x86 assembly (clang, -O2):
<unix_statfcn>:
jmp    1030 <stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unix_statfcn(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
long leftShiftLong(long l) { return (l << 3); }


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

x86 assembly (clang, -O2):
<leftShiftLong>:
lea    0x0(,%rdi,8),%rax
ret

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

LLVM IR (-O2):
define i64 @leftShiftLong(i64 %0) {
%2 = shl i64 %0, 3
ret i64 %2
}
void ras_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ras_debugfs_init() {
ret void
}
int NoSoundDrv_CD_IsPlaying(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NoSoundDrv_CD_IsPlaying() {
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int main(void) {
  INT_MAX << 2;
  return 0;
}


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):
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MAX
%3 = shl i32 %2, 2
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void MSG_Error_RequestError(void) { exit(1); }


x86 assembly (clang, -O0):
<MSG_Error_RequestError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<MSG_Error_RequestError>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @MSG_Error_RequestError() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @MSG_Error_RequestError() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char EOF;
char getchar();
char *gets(char *s) {
  char c;
  while (1) {
    c = getchar();
    if (c == EOF || c == '\n') {
      s = '\0';
      break;
    } else
      *s++ = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    0x2eb7(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1149 <gets+0x39>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1156 <gets+0x46>
movq   $0x0,-0x8(%rbp)
jmp    116f <gets+0x5f>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111c <gets+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1146 <gets+0x36>
mov    0x2ebf(%rip),%r14
cmp    (%r14),%al
je     1146 <gets+0x36>
xchg   %ax,%ax
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1146 <gets+0x36>
add    $0x1,%rbx
cmp    (%r14),%al
jne    1130 <gets+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define i8* @gets(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %20
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i8, i8* @EOF
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %11, %4
store i8* null, i8** %2
br label %21
16: ; preds = %11
%17 = load i8, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
store i8 %17, i8* %18
br label %20
20: ; preds = %16
br label %4
21: ; preds = %15
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@EOF = global i8 0
define noalias i8* @gets(i8* nocapture writeonly %0) {
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
%5 = icmp eq i8 %2, 10
%6 = or i1 %5, %4
br i1 %6, label %7, label %8
7: ; preds = %8, %1
ret i8* null
8: ; preds = %1, %8
%9 = phi i8 [ %12, %8 ], [ %2, %1 ]
%10 = phi i8* [ %11, %8 ], [ %0, %1 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %9, i8* %10
%12 = tail call signext i8 (...) @getchar()
%13 = load i8, i8* @EOF
%14 = icmp eq i8 %12, %13
%15 = icmp eq i8 %12, 10
%16 = or i1 %15, %14
br i1 %16, label %7, label %8
}
int checkforodd(int num) {
  if (num % 2 == 0)
    return 3;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkforodd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <checkforodd+0x27>
movl   $0x3,-0x4(%rbp)
jmp    112e <checkforodd+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkforodd>:
xor    %eax,%eax
test   $0x1,%dil
sete   %al
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @checkforodd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 3, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @checkforodd(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 3, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ funcion1(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x = 0;
  printf("Inicio\n");
  funcion1(3);
  x++;
  printf("x = %d\n", x);
  printf("Fin\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <funcion1@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1050 <funcion1@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"x = %d\0A\00"
@str = [7 x i8] c"Inicio\00"
@str.3 = [4 x i8] c"Fin\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @funcion1(i32 3)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void av_opt_get_double() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ raise_irq_pri(int);
uint32_t disable_irq(void) { return raise_irq_pri(15); }


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

x86 assembly (clang, -O2):
<disable_irq>:
mov    $0xf,%edi
jmp    1030 <raise_irq_pri@plt>

LLVM IR (-O0):
define i32 @disable_irq() {
%1 = call i32 @raise_irq_pri(i32 15)
ret i32 %1
}

LLVM IR (-O2):
define i32 @disable_irq() {
%1 = tail call i32 @raise_irq_pri(i32 15)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("execute!"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"execute!\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"execute!\00"
define void @func() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRDB_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRDB_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRDB_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int test_imm_1Bint16_reg(short val) {
  return ((val) & (0x1B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Bint16_reg>:
test   $0x1b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 27
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Bint16_reg(i16 signext %0) {
%2 = and i16 %0, 27
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void post_user() {}


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

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

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

LLVM IR (-O2):
define void @post_user() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *string) {
  size_t len = (strlen(string) + 1) * sizeof(char);
  char *dup = (char *)malloc(len);
  memcpy(dup, string, len);
  return dup;
}


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

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

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
ret i8* %6
}
char *upnp_uuid(void) { return "12345678-1234-1234-1234-123456789013"; }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"12345678-1234-1234-1234-123456789013\00"
define i8* @upnp_uuid() {
ret i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [37 x i8] c"12345678-1234-1234-1234-123456789013\00"
define i8* @upnp_uuid() {
ret i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *);
void showinfo() {
  char uname[33] = "", tty[38] = "/dev/";
  foo(uname, tty);
}


x86 assembly (clang, -O0):
<showinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1030 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x26,%edx
call   1030 <memset@plt>
movb   $0x2f,-0x60(%rbp)
movb   $0x64,-0x5f(%rbp)
movb   $0x65,-0x5e(%rbp)
movb   $0x76,-0x5d(%rbp)
movb   $0x2f,-0x5c(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <foo@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showinfo>:
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movb   $0x0,0x50(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x1e(%rsp)
movl   $0x7665642f,(%rsp)
movb   $0x2f,0x4(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <foo@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @showinfo() {
%1 = alloca [33 x i8]
%2 = alloca [38 x i8]
%3 = bitcast [33 x i8]* %1 to i8*
%4 = bitcast [38 x i8]* %2 to i8*
%5 = bitcast i8* %4 to [38 x i8]*
%6 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i32 0, i32 0
store i8 47, i8* %6
%7 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i32 0, i32 1
store i8 100, i8* %7
%8 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i32 0, i32 2
store i8 101, i8* %8
%9 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i32 0, i32 3
store i8 118, i8* %9
%10 = getelementptr inbounds [38 x i8], [38 x i8]* %5, i32 0, i32 4
store i8 47, i8* %10
%11 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 0
%13 = call i32 @foo(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @showinfo() {
%1 = alloca [33 x i8]
%2 = alloca [38 x i8]
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 0
store i8 47, i8* %4
%5 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 1
store i8 100, i8* %5
%6 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 2
store i8 101, i8* %6
%7 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 3
store i8 118, i8* %7
%8 = getelementptr inbounds [38 x i8], [38 x i8]* %2, i64 0, i64 4
store i8 47, i8* %8
%9 = call i32 @foo(i8* %3, i8* %4)
ret void
}
/* Variables and functions */
void copysign(double x, double y, double *result) {
  *(1 + (int *)&x) =
      (*(1 + (int *)&x) & 0x7fffffff) | (*(1 + (int *)&y) & 0x80000000);
  *result = x;
}


x86 assembly (clang, -O0):
<copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    -0xc(%rbp),%ecx
and    $0x80000000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysign>:
movq   %xmm0,%rax
movmskpd %xmm1,%ecx
shl    $0x3f,%rcx
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
and    %rax,%rdx
or     %rcx,%rdx
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
define void @copysign(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = bitcast double* %4 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = and i32 %9, 2147483647
%11 = bitcast double* %5 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = and i32 %13, -2147483648
%15 = or i32 %10, %14
%16 = bitcast double* %4 to i32*
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load double, double* %4
%19 = load double*, double** %6
store double %18, double* %19
ret void
}

LLVM IR (-O2):
define void @copysign(double %0, double %1, double* nocapture writeonly %2) {
%4 = bitcast double %0 to i64
%5 = bitcast double %1 to i64
%6 = and i64 %5, -9223372036854775808
%7 = and i64 %4, 9223372036854775807
%8 = or i64 %7, %6
%9 = bitcast double* %2 to i64*
store i64 %8, i64* %9
ret void
}
/* Type definitions */
struct avl_tree_node {
  int dummy;
};

/* Variables and functions */
struct avl_tree_node *
avl_tree_lookup(struct avl_tree_node const *, void const *,
                int (*)(void const *, struct avl_tree_node const *));
__attribute__((always_)) struct avl_tree_node *avl_tree_lookup_node(
    const struct avl_tree_node *root, const struct avl_tree_node *node,
    int (*cmp)(const struct avl_tree_node *, const struct avl_tree_node *)) {
  return avl_tree_lookup(
      root, (const void *)node,
      (int (*)(const void *, const struct avl_tree_node *))cmp);
}


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

x86 assembly (clang, -O2):
<avl_tree_lookup_node>:
jmp    1030 <avl_tree_lookup@plt>

LLVM IR (-O0):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_lookup_node(%struct.avl_tree_node* %0, %struct.avl_tree_node* %1, i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)* %2) {
%4 = alloca %struct.avl_tree_node*
%5 = alloca %struct.avl_tree_node*
%6 = alloca i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)*
store %struct.avl_tree_node* %0, %struct.avl_tree_node** %4
store %struct.avl_tree_node* %1, %struct.avl_tree_node** %5
store i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)* %2, i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)** %6
%7 = load %struct.avl_tree_node*, %struct.avl_tree_node** %4
%8 = load %struct.avl_tree_node*, %struct.avl_tree_node** %5
%9 = bitcast %struct.avl_tree_node* %8 to i8*
%10 = load i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)*, i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)** %6
%11 = bitcast i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)* %10 to i32 (i8*, %struct.avl_tree_node*)*
%12 = call %struct.avl_tree_node* @avl_tree_lookup(%struct.avl_tree_node* %7, i8* %9, i32 (i8*, %struct.avl_tree_node*)* %11)
ret %struct.avl_tree_node* %12
}

LLVM IR (-O2):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_lookup_node(%struct.avl_tree_node* %0, %struct.avl_tree_node* %1, i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)* %2) {
%4 = bitcast %struct.avl_tree_node* %1 to i8*
%5 = bitcast i32 (%struct.avl_tree_node*, %struct.avl_tree_node*)* %2 to i32 (i8*, %struct.avl_tree_node*)*
%6 = tail call %struct.avl_tree_node* @avl_tree_lookup(%struct.avl_tree_node* %0, i8* %4, i32 (i8*, %struct.avl_tree_node*)* %5)
ret %struct.avl_tree_node* %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int max_width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_max_width(void *_p, int _v) {
  ((XSizeHints *)_p)->max_width = (int)_v;
}


x86 assembly (clang, -O0):
<set_XSizeHints_max_width>:
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_XSizeHints_max_width>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSizeHints_max_width(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_XSizeHints_max_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void TestB() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TestB+0x9>
jmp    1109 <TestB+0x9>

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

LLVM IR (-O0):
define void @TestB() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @TestB() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *makeDirPath();
int /*<<< orphan*/ strcat(char *, char *);
char *makeFilePath() {
  char *s = makeDirPath();
  strcat(s, "date");
  return s;
}


x86 assembly (clang, -O0):
<makeFilePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <makeDirPath@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeFilePath>:
push   %rbx
xor    %eax,%eax
call   1030 <makeDirPath@plt>
mov    %rax,%rbx
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
define i8* @makeFilePath() {
%1 = alloca i8*
%2 = call i8* (...) @makeDirPath()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
define i8* @makeFilePath() {
%1 = tail call i8* (...) @makeDirPath()
%2 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
long long _mm_extract_epi64(int /*<<< orphan*/, int);
long long __mm_extract_epi64(__m128i A, int const I) {
  return _mm_extract_epi64(A, 1);
}


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

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

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

LLVM IR (-O2):
define i64 @__mm_extract_epi64(i32 %0, i32 %1) {
%3 = tail call i64 @_mm_extract_epi64(i32 %0, i32 1)
ret i64 %3
}
int solveMeFirst(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<solveMeFirst>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @solveMeFirst(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @solveMeFirst(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}