xunge/DecIR huggingface dataset:
void baz(__complex__ long double x) {
  if (__real__ x != 5.0L || __imag__ x != 6.0L)
    abort();
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
fldt   (%rax)
flds   0xed8(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1163 <baz+0x53>
jp     1163 <baz+0x53>
jmp    113f <baz+0x2f>
mov    -0x8(%rbp),%rax
fldt   0x10(%rax)
flds   0xeb8(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1163 <baz+0x53>
jp     1163 <baz+0x53>
jmp    1168 <baz+0x58>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rax
fldt   0x10(%rsp)
flds   0xee5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
fldt   0x20(%rsp)
jne    113f <baz+0x2f>
jp     113f <baz+0x2f>
flds   0xed5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
fldz
jne    113f <baz+0x2f>
jp     113f <baz+0x2f>
fstp   %st(0)
pop    %rax
ret
fstp   %st(0)
call   1030 <abort@plt>

LLVM IR (-O0):
define void @baz({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp une x86_fp80 %3, 0xK4001A000000000000000
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp une x86_fp80 %7, 0xK4001C000000000000000
br i1 %8, label %9, label %10
9: ; preds = %5, %1
unreachable
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @baz({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp une x86_fp80 %3, 0xK4001A000000000000000
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fcmp une x86_fp80 %6, 0xK4001C000000000000000
%8 = select i1 %4, i1 true, i1 %7
br i1 %8, label %9, label %10
9: ; preds = %1
tail call void @abort()
unreachable
10: ; preds = %1
ret void
}
/* Type definitions */
struct cec_msg {
  int *msg;
};
typedef int __u8;

/* Variables and functions */
void cec_ops_report_audio_status(const struct cec_msg *msg,
                                 __u8 *aud_mute_status, __u8 *aud_vol_status) {
  *aud_mute_status = msg->msg[2] >> 7;
  *aud_vol_status = msg->msg[2] & 0x7f;
}


x86 assembly (clang, -O0):
<cec_ops_report_audio_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
sar    $0x7,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
and    $0x7f,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_report_audio_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%ecx
sar    $0x7,%ecx
mov    %ecx,(%rsi)
mov    0x8(%rax),%eax
and    $0x7f,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_report_audio_status(%struct.cec_msg* %0, i32* %1, i32* %2) {
%4 = alloca %struct.cec_msg*
%5 = alloca i32*
%6 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.cec_msg*, %struct.cec_msg** %4
%8 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %7, i32 0, i32 0
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = ashr i32 %11, 7
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load %struct.cec_msg*, %struct.cec_msg** %4
%15 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %14, i32 0, i32 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = and i32 %18, 127
%20 = load i32*, i32** %6
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_report_audio_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = ashr i32 %7, 7
store i32 %8, i32* %1
%9 = load i32, i32* %6
%10 = and i32 %9, 127
store i32 %10, i32* %2
ret void
}
/* Type definitions */
struct iio_device {
  int dummy;
};

/* Variables and functions */
int add_attr_or_channel_helper(struct iio_device *, char const *, int);
int add_scan_element(void *d, const char *path) {
  return add_attr_or_channel_helper((struct iio_device *)d, path, true);
}


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

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

LLVM IR (-O0):
%struct.iio_device = type { i32 }
define i32 @add_scan_element(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 = bitcast i8* %5 to %struct.iio_device*
%7 = load i8*, i8** %4
%8 = call i32 @add_attr_or_channel_helper(%struct.iio_device* %6, i8* %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
%struct.iio_device = type { i32 }
define i32 @add_scan_element(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.iio_device*
%4 = tail call i32 @add_attr_or_channel_helper(%struct.iio_device* %3, i8* %1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cons_set_raw(int);
int /*<<< orphan*/ read(int /*<<< orphan*/, int *, int);
int read_key() {
  int key = 0;
  cons_set_raw(1);
  read(0, &key, 1);
  cons_set_raw(0);
  return key;
}


x86 assembly (clang, -O0):
<read_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <cons_set_raw@plt>
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
xor    %edi,%edi
call   1040 <cons_set_raw@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_key>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x1,%edi
call   1040 <cons_set_raw@plt>
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
xor    %edi,%edi
call   1040 <cons_set_raw@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_key() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @cons_set_raw(i32 1)
%3 = call i32 @read(i32 0, i32* %1, i32 1)
%4 = call i32 @cons_set_raw(i32 0)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @read_key() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @cons_set_raw(i32 1)
%4 = call i32 @read(i32 0, i32* %1, i32 1)
%5 = tail call i32 @cons_set_raw(i32 0)
%6 = load i32, i32* %1
ret i32 %6
}
double *getLikelihoodArray(int number, int mxtips, double **xVector) {
  return (xVector[number - mxtips - 1]);
}


x86 assembly (clang, -O0):
<getLikelihoodArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLikelihoodArray>:
not    %esi
add    %edi,%esi
movslq %esi,%rax
mov    (%rdx,%rax,8),%rax
ret

LLVM IR (-O0):
define double* @getLikelihoodArray(i32 %0, i32 %1, double** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double**
store i32 %0, i32* %4
store i32 %1, i32* %5
store double** %2, double*** %6
%7 = load double**, double*** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double*, double** %7, i64 %12
%14 = load double*, double** %13
ret double* %14
}

LLVM IR (-O2):
define double* @getLikelihoodArray(i32 %0, i32 %1, double** nocapture %2) {
%4 = xor i32 %1, -1
%5 = add i32 %4, %0
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds double*, double** %2, i64 %6
%8 = load double*, double** %7
ret double* %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void karplus_cleanup(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @karplus_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int nm_generic_ipv6_use_tempaddr();
int nm_backend_ipv6_use_tempaddr(void) {
  return nm_generic_ipv6_use_tempaddr();
}


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

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

LLVM IR (-O0):
define i32 @nm_backend_ipv6_use_tempaddr() {
%1 = call i32 (...) @nm_generic_ipv6_use_tempaddr()
ret i32 %1
}

LLVM IR (-O2):
define i32 @nm_backend_ipv6_use_tempaddr() {
%1 = tail call i32 (...) @nm_generic_ipv6_use_tempaddr()
ret i32 %1
}
void roda_viva(str) char *str;
{
  short i;
  for (i = 0; str[i] != '\0'; i++) {
    str[i] += 1;
  }
}


x86 assembly (clang, -O0):
<roda_viva>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1148 <roda_viva+0x48>
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    110e <roda_viva+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roda_viva>:
mov    (%rdi),%al
test   %al,%al
je     1127 <roda_viva+0x27>
mov    $0x1,%cx
mov    %rdi,%rdx
nopl   (%rax)
add    $0x1,%al
mov    %al,(%rdx)
movswq %cx,%rax
lea    (%rdi,%rax,1),%rdx
movzbl (%rdi,%rax,1),%eax
add    $0x1,%ecx
test   %al,%al
jne    1110 <roda_viva+0x10>
ret

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

LLVM IR (-O2):
define void @roda_viva(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i16 [ %9, %4 ], [ 0, %1 ]
%8 = add i8 %5, 1
store i8 %8, i8* %6
%9 = add i16 %7, 1
%10 = sext i16 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
void zero(int N, double *A) {
  int i;
  for (i = 0; i < N; i++)
    A[i] = 0.;
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <zero+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %edi,%edi
jle    1129 <zero+0x19>
push   %rax
mov    %edi,%edx
shl    $0x3,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %1 to i8*
%6 = zext i32 %0 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void display_version(void) { printf("rnn-learn version %s\n", "VERSION"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"rnn-learn version %s\0A\00"
@.str.1 = [8 x i8] c"VERSION\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"rnn-learn version %s\0A\00"
@.str.1 = [8 x i8] c"VERSION\00"
define void @display_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *strstr(char *, char *);
int main(void) {
  char buf[] = "hello hi there";
  char *pch;
  pch = strstr(buf, "hi");
  puts(pch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x65726568742069,%rax
mov    %rax,0xf(%rsp)
movabs $0x6968206f6c6c6568,%rax
20 68 69
mov    %rax,0x8(%rsp)
lea    0xec6(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1040 <strstr@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.buf = [15 x i8] c"hello hi there\00"
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [15 x i8] c"hello hi there\00"
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
void mdp4_overlay_dsi_video_set_perf(struct msm_fb_data_type *mfd) {}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_overlay_dsi_video_set_perf(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
void PlayerPreThink() {}


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

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

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

LLVM IR (-O2):
define void @PlayerPreThink() {
ret void
}
int mul(int a, int b) { return (a * b) != 0; }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
imul   %esi,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int rand();
int FetchRand(int min, int max) { return (rand() % (max - min + 1)) + min; }


x86 assembly (clang, -O0):
<FetchRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FetchRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @FetchRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @FetchRand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, int, struct epoll_event *);
int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) {
  return syscall(251, fd, op, fd2, ev);
}


x86 assembly (clang, -O0):
<epoll_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0xfb,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_ctl>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xfb,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.epoll_event*, %struct.epoll_event** %8
%13 = call i32 @syscall(i32 251, i32 %9, i32 %10, i32 %11, %struct.epoll_event* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = tail call i32 @syscall(i32 251, i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char const *);
__attribute__((unused)) int help(const char *argv0, const char *helpstr) {
  printf("Usage: %s ", argv0);
  puts(helpstr);
  return 0;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Usage: %s \00"
define i32 @help(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 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Usage: %s \00"
define i32 @help(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ list_release(void *);
void _list_release(void *aList) { list_release(aList); }


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

x86 assembly (clang, -O2):
<_list_release>:
jmp    1030 <list_release@plt>

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

LLVM IR (-O2):
define void @_list_release(i8* %0) {
%2 = tail call i32 @list_release(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void flockfile(FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @flockfile(i32* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ COND_PL();
int /*<<< orphan*/ EA_AL_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_spl_8_al(void) { m68ki_write_8(EA_AL_8(), COND_PL() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_spl_8_al>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AL_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_PL@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_spl_8_al>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AL_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_PL@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_spl_8_al() {
%1 = call i32 (...) @EA_AL_8()
%2 = call i64 (...) @COND_PL()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_spl_8_al() {
%1 = tail call i32 (...) @EA_AL_8()
%2 = tail call i64 (...) @COND_PL()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ towers(int, char, char, char);
int main() {
  int n;
  n = (int)getchar();
  printf("Number of disks : %d\n", n);
  printf("The Tower of Hanoi involves the moves :\n");
  towers(n, 'A', 'C', 'B');
  printf("Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1050 <towers@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1060 <towers@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Number of disks : %d\0A\00"
@.str.1 = [41 x i8] c"The Tower of Hanoi involves the moves :\0A\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @getchar()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 @towers(i32 %8, i8 signext 65, i8 signext 67, i8 signext 66)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Number of disks : %d\0A\00"
@str = [40 x i8] c"The Tower of Hanoi involves the moves :\00"
@str.3 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = trunc i64 %1 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @towers(i32 %2, i8 signext 65, i8 signext 67, i8 signext 66)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ndb_unix_getFileMode(char *, int /*<<< orphan*/);
int ndb_osdep_getFileMode(char *name) { return ndb_unix_getFileMode(name, 0); }


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

x86 assembly (clang, -O2):
<ndb_osdep_getFileMode>:
xor    %esi,%esi
jmp    1030 <ndb_unix_getFileMode@plt>

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

LLVM IR (-O2):
define i32 @ndb_osdep_getFileMode(i8* %0) {
%2 = tail call i32 @ndb_unix_getFileMode(i8* %0, i32 0)
ret i32 %2
}
void g_main_loop_ref() {}


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

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

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

LLVM IR (-O2):
define void @g_main_loop_ref() {
ret void
}
int f11() {
  int x = 4;
  return x++;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f11() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @f11() {
ret i32 4
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Lex_comment_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_comment(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_Lex_comment_rec(lexbuf, 6); });
}


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

x86 assembly (clang, -O2):
<Cyc_Lex_comment>:
mov    $0x6,%esi
jmp    1030 <Cyc_Lex_comment_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_comment_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 6)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_comment(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_comment_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 6)
ret i32 %2
}
/* Variables and functions */
scalar_t__ strtold(char const *, char **);
float strtof(const char *str, char **endptr) {
  return (float)strtold(str, endptr);
}


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

x86 assembly (clang, -O2):
<strtof>:
push   %rax
call   1030 <strtold@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @strtof(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call i64 @strtold(i8* %5, i8** %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @strtof(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtold(i8* %0, i8** %1)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Directory scan of /home:\n");
  printdir("/home", 0);
  printf("done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <printdir@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %esi,%esi
call   1040 <printdir@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Directory scan of /home:\0A\00"
@.str.1 = [6 x i8] c"/home\00"
@.str.2 = [7 x i8] c"done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"/home\00"
@str = [25 x i8] c"Directory scan of /home:\00"
@str.3 = [6 x i8] c"done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f() {
  static int i = 0;
  printf("i = %d\n", i);
  i += 2;
  printf("agn i = %d\n", i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2f00(%rip),%eax
add    $0x2,%eax
mov    %eax,0x2ef7(%rip)
mov    0x2ef1(%rip),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2f03(%rip),%esi
add    $0x2,%esi
mov    %esi,0x2efa(%rip)
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@f.i = internal global i32 0
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [12 x i8] c"agn i = %d\0A\00"
define void @f() {
%1 = load i32, i32* @f.i
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @f.i
%4 = add nsw i32 %3, 2
store i32 %4, i32* @f.i
%5 = load i32, i32* @f.i
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@f.i = internal unnamed_addr global i32 0
@.str = [8 x i8] c"i = %d\0A\00"
@.str.1 = [12 x i8] c"agn i = %d\0A\00"
define void @f() {
%1 = load i32, i32* @f.i
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @f.i
%4 = add nsw i32 %3, 2
store i32 %4, i32* @f.i
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
int getPerfectScore(int level) { return 50 * level; }


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

x86 assembly (clang, -O2):
<getPerfectScore>:
imul   $0x32,%edi,%eax
ret

LLVM IR (-O0):
define i32 @getPerfectScore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 50, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @getPerfectScore(i32 %0) {
%2 = mul nsw i32 %0, 50
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int assemble(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  uint8_t a = 1;
  uint8_t b = 2;
  printf("%d\n", assemble(a, b));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @assemble(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct CHIPEMU {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct CHIPEMU *);
void chipemu_destroy(struct CHIPEMU *instance) { free(instance); }


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

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

LLVM IR (-O0):
%struct.CHIPEMU = type { i32 }
define void @chipemu_destroy(%struct.CHIPEMU* %0) {
%2 = alloca %struct.CHIPEMU*
store %struct.CHIPEMU* %0, %struct.CHIPEMU** %2
%3 = load %struct.CHIPEMU*, %struct.CHIPEMU** %2
%4 = call i32 @free(%struct.CHIPEMU* %3)
ret void
}

LLVM IR (-O2):
%struct.CHIPEMU = type { i32 }
define void @chipemu_destroy(%struct.CHIPEMU* nocapture %0) {
%2 = tail call i32 @free(%struct.CHIPEMU* %0)
ret void
}
void main() { __asm__("pxor %xmm12,%xmm6"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
pxor   %xmm12,%xmm6
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
pxor   %xmm12,%xmm6
ret

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

LLVM IR (-O2):
define void @main() {
tail call void asm sideeffect "pxor %xmm12,%xmm6", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int foo1();
int main(void) { return foo1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo1()
ret i32 %1
}
void MUSIC_RerouteMidiChannel(int channel,
                              int function(int event, int c1, int c2)) {}


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

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

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

LLVM IR (-O2):
define void @MUSIC_RerouteMidiChannel(i32 %0, i32 (i32, i32, i32)* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sincosf(float, float *, float *);
float sincosf_cosf(float x) {
  float s, c;
  sincosf(x, &s, &c);
  return c;
}


x86 assembly (clang, -O0):
<sincosf_cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <sincosf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincosf_cosf>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sincosf@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sincosf_cosf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = call i32 @sincosf(float %5, float* %3, float* %4)
%7 = load float, float* %4
ret float %7
}

LLVM IR (-O2):
define float @sincosf_cosf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @sincosf(float %0, float* %2, float* %3)
%7 = load float, float* %3
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void enable_reuse_socket(int socket_desc) {
  int reuse = 1;
  setsockopt(socket_desc, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(int));
}


x86 assembly (clang, -O0):
<enable_reuse_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_reuse_socket>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @enable_reuse_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @enable_reuse_socket(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_set_drain_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_set_drain_callback"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_pdispatch_set_drain_callback\00"
define i32 @pa_pdispatch_set_drain_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int check_double() { return sizeof(double); }


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

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

LLVM IR (-O0):
define i32 @check_double() {
ret i32 8
}

LLVM IR (-O2):
define i32 @check_double() {
ret i32 8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_mov_to_DPTR(char *str, uint8_t data16_high, uint8_t data16_low) {
  sprintf(str,
          "MOV   DPTR, #"
          "0x%04X"
          "             ",
          (data16_high << 8) + data16_low);
}


x86 assembly (clang, -O0):
<sprint_mov_to_DPTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
shl    $0x8,%edx
add    -0x10(%rbp),%edx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_mov_to_DPTR>:
shl    $0x8,%esi
add    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"MOV DPTR,x%04X \00"
define void @sprint_mov_to_DPTR(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 i8*, i8** %4
%8 = load i32, i32* %5
%9 = shl i32 %8, 8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOV DPTR,x%04X \00"
define void @sprint_mov_to_DPTR(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 8
%5 = add nsw i32 %4, %2
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
XSetIconSizes() {}


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

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

LLVM IR (-O0):
define i32 @XSetIconSizes() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetIconSizes() {
ret i32 undef
}
int yskiplist_last_cmp(struct yskiplist_head *a, void *key) {
  return a ? -1 : 1;
}


x86 assembly (clang, -O0):
<yskiplist_last_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yskiplist_last_cmp>:
neg    %rdi
sbb    %eax,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
%struct.yskiplist_head = type opaque
define i32 @yskiplist_last_cmp(%struct.yskiplist_head* %0, i8* %1) {
%3 = alloca %struct.yskiplist_head*
%4 = alloca i8*
store %struct.yskiplist_head* %0, %struct.yskiplist_head** %3
store i8* %1, i8** %4
%5 = load %struct.yskiplist_head*, %struct.yskiplist_head** %3
%6 = icmp ne %struct.yskiplist_head* %5, null
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -1, i32 1
ret i32 %8
}

LLVM IR (-O2):
%struct.yskiplist_head = type opaque
define i32 @yskiplist_last_cmp(%struct.yskiplist_head* readnone %0, i8* nocapture readnone %1) {
%3 = icmp eq %struct.yskiplist_head* %0, null
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
/* Variables and functions */
scalar_t__ check_pipe(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int check_ls(char *input) {
  if (strstr(input, "ls") != NULL) {
    if (check_pipe(input) == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_ls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     116a <check_ls+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <check_pipe@plt>
cmp    $0x0,%rax
jne    1165 <check_ls+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1171 <check_ls+0x51>
jmp    116a <check_ls+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ls>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1142 <check_ls+0x22>
mov    %rbx,%rdi
call   1030 <check_pipe@plt>
test   %rax,%rax
je     1146 <check_ls+0x26>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
define i32 @check_ls(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @check_pipe(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}