xunge/DecIR huggingface dataset:
unsigned char hotcold_green_transform(unsigned char grayscale) {
  if (grayscale < 64 * 1)
    return grayscale * 4;
  if (grayscale <= 64 * 3)
    return 255;
  return (64 * 4 - grayscale) * 4;
}


x86 assembly (clang, -O0):
<hotcold_green_transform>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x40,%eax
jge    1126 <hotcold_green_transform+0x26>
movzbl -0x2(%rbp),%eax
shl    $0x2,%eax
mov    %al,-0x1(%rbp)
jmp    114f <hotcold_green_transform+0x4f>
movzbl -0x2(%rbp),%eax
cmp    $0xc0,%eax
jg     113e <hotcold_green_transform+0x3e>
movb   $0xff,-0x1(%rbp)
jmp    114f <hotcold_green_transform+0x4f>
movzbl -0x2(%rbp),%ecx
mov    $0x100,%eax
sub    %ecx,%eax
shl    $0x2,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hotcold_green_transform>:
lea    0x0(,%rdi,4),%eax
movzbl %al,%ecx
neg    %al
cmp    $0xc1,%dil
movzbl %al,%edx
mov    $0xff,%eax
cmovae %edx,%eax
cmp    $0x40,%dil
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @hotcold_green_transform(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, 4
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %23
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 192
br i1 %15, label %16, label %17
16: ; preds = %12
store i8 -1, i8* %2
br label %23
17: ; preds = %12
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = sub nsw i32 256, %19
%21 = mul nsw i32 %20, 4
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %23
23: ; preds = %17, %16, %7
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @hotcold_green_transform(i8 zeroext %0) {
%2 = icmp ult i8 %0, 64
%3 = shl i8 %0, 2
%4 = icmp ult i8 %0, -63
%5 = mul i8 %0, -4
%6 = select i1 %4, i8 -1, i8 %5
%7 = select i1 %2, i8 %3, i8 %6
ret i8 %7
}
void gtk_text_buffer_get_tag_table() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @testWeak2() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XColormapEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XColormapEvent_display(void *_p, void *_v) {
  ((XColormapEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XColormapEvent_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XColormapEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ challenge_PI_go_off();
int /*<<< orphan*/ challenge_PI_run();
int main() {
  adainit();
  challenge_PI_run();
  challenge_PI_go_off();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @adainit()
%2 = tail call i32 (...) @challenge_PI_run()
%3 = tail call i32 (...) @challenge_PI_go_off()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ SHA1_Final(unsigned char *, int /*<<< orphan*/ *);
int crypto_sha_final(unsigned char *md, SHA_CTX *ctx) {
  return !SHA1_Final(md, ctx);
}


x86 assembly (clang, -O0):
<crypto_sha_final>:
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 <SHA1_Final@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_sha_final>:
push   %rax
call   1030 <SHA1_Final@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_sha_final(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 @SHA1_Final(i8* %5, i32* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @crypto_sha_final(i8* %0, i32* %1) {
%3 = tail call i32 @SHA1_Final(i8* %0, i32* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
OP(ed, db) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void not_annotated_c_2_3() {}


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

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

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

LLVM IR (-O2):
define void @not_annotated_c_2_3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strlist_tostring() {
  printf("NOT IMPLEMENTED:"
         "pa_strlist_tostring"
         "\n");
}


x86 assembly (clang, -O0):
<pa_strlist_tostring>:
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_strlist_tostring>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_strlist_tostring\00"
define i32 @pa_strlist_tostring() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
bool rrd_temperature_timer_1_cb(int __attribute__((__unused__)) fd,
                                void __attribute__((__unused__)) * data) {
  syslog(LOG_INFO, "RRD FD_TIMER 1");
  return true;
}


x86 assembly (clang, -O0):
<rrd_temperature_timer_1_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrd_temperature_timer_1_cb>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [15 x i8] c"RRD FD_TIMER 1\00"
define i32 @rrd_temperature_timer_1_cb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @LOG_INFO
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [15 x i8] c"RRD FD_TIMER 1\00"
define i32 @rrd_temperature_timer_1_cb(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
float C_Utils_min_float(const float item1, const float item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <C_Utils_min_float+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <C_Utils_min_float+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_float>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @C_Utils_min_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @C_Utils_min_float(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void OICFree(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<OICFree>:
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):
<OICFree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @OICFree(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 @OICFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
yyinit() {}


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

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

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

LLVM IR (-O2):
define i32 @yyinit() {
ret i32 undef
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int dsm_close(int s) {
  int ret;
  if (ret = close(s))
    perror("close error");
  return (ret);
}


x86 assembly (clang, -O0):
<dsm_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114b <dsm_close+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsm_close>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1130 <dsm_close+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <dsm_close+0xc>

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

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define i32 @dsm_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ saverestore_params(int /*<<< orphan*/);
void save_params() { saverestore_params(0); }


x86 assembly (clang, -O0):
<save_params>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <saverestore_params@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_params>:
xor    %edi,%edi
jmp    1030 <saverestore_params@plt>

LLVM IR (-O0):
define void @save_params() {
%1 = call i32 @saverestore_params(i32 0)
ret void
}

LLVM IR (-O2):
define void @save_params() {
%1 = tail call i32 @saverestore_params(i32 0)
ret void
}
void mjd2dt(dj, date, time) double dj;
double *date;
double *time;
{
  double tsec;
  tsec = jd2ts(dj + 2400000.5);
  ts2dt(tsec, date, time);
  return;
}


x86 assembly (clang, -O0):
<mjd2dt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xec3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%al
call   1030 <ts2dt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd2dt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
addsd  0xece(%rip),%xmm0
mov    $0x1,%al
call   1040 <jd2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ts2dt@plt>

LLVM IR (-O0):
define void @mjd2dt(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double, double* %4
%9 = fadd double %8, 0x41424F8040000000
%10 = call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %7
%12 = load double, double* %7
%13 = load double*, double** %5
%14 = load double*, double** %6
%15 = call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %12, double* %13, double* %14)
ret void
}

LLVM IR (-O2):
define void @mjd2dt(double %0, double* %1, double* %2) {
%4 = fadd double %0, 0x41424F8040000000
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2ts to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
%7 = tail call i32 (double, double*, double*, ...) bitcast (i32 (...)* @ts2dt to i32 (double, double*, double*, ...)*)(double %6, double* %1, double* %2)
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n = (++m);
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rnd(uint32_t *seed) {
  *seed = *seed * 1103515245 + 12345;
  return *seed & 0x7fffffff;
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%ecx
add    $0x3039,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @rnd(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1103515245
%6 = add nsw i32 %5, 12345
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = and i32 %9, 2147483647
ret i32 %10
}

LLVM IR (-O2):
define i32 @rnd(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 1103515245
%4 = add nsw i32 %3, 12345
store i32 %4, i32* %0
%5 = and i32 %4, 2147483647
ret i32 %5
}
/* Variables and functions */
void signals_block(void) {}


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

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

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

LLVM IR (-O2):
define void @signals_block() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t ts_to_microseconds(const struct timespec *ts) {
  return 1000000 * (uint64_t)ts->tv_sec + (uint64_t)ts->tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<ts_to_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_microseconds>:
imul   $0xf4240,0x8(%rdi),%ecx
movslq (%rdi),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @ts_to_microseconds(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 1000000, %6
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @ts_to_microseconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ writeString(char *, int);
void writeNspace(unsigned int n) {
  while (n > 0) {
    writeString((char *)" ", 1);
    n -= 1;
  }
}


x86 assembly (clang, -O0):
<writeNspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1144 <writeNspace+0x34>
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
call   1030 <writeString@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <writeNspace+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeNspace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1142 <writeNspace+0x32>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <writeString@plt>
add    $0xffffffff,%ebx
jne    1130 <writeNspace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @writeNspace(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @writeString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = add i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int precedence(char symbol) {
  int retval = 0;
  switch (symbol) {
  case '+':
  case '-':
    retval = 2;
    break;
  case '*':
  case '/':
    retval = 3;
    break;
  case '^':
    retval = 4;
    break;
  case '(':
  case ')':
    retval = 1;
    break;
  default:
    retval = 0;
  }
  return retval;
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x36,%eax
ja     116b <precedence+0x6b>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x8(%rbp)
jmp    1172 <precedence+0x72>
movl   $0x3,-0x8(%rbp)
jmp    1172 <precedence+0x72>
movl   $0x4,-0x8(%rbp)
jmp    1172 <precedence+0x72>
movl   $0x1,-0x8(%rbp)
jmp    1172 <precedence+0x72>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xffffffd8,%edi
cmp    $0x36,%edi
ja     1129 <precedence+0x29>
mov    $0x2,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 43, label %6
i32 45, label %6
i32 42, label %7
i32 47, label %7
i32 94, label %8
i32 40, label %9
i32 41, label %9
]
6: ; preds = %1, %1
store i32 2, i32* %3
br label %11
7: ; preds = %1, %1
store i32 3, i32* %3
br label %11
8: ; preds = %1
store i32 4, i32* %3
br label %11
9: ; preds = %1, %1
store i32 1, i32* %3
br label %11
10: ; preds = %1
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @precedence(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 43, label %7
i32 45, label %7
i32 42, label %3
i32 47, label %3
i32 94, label %4
i32 40, label %5
i32 41, label %5
]
3: ; preds = %1, %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 4, %4 ], [ 3, %3 ], [ 2, %1 ], [ 2, %1 ]
ret i32 %8
}
/* Variables and functions */
int removeElement(int *, int, int);
int main(void) {
  int num[] = {4, 5};
  int a = removeElement(num, 2, 4);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <removeElement@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x500000004,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <removeElement@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.num = [2 x i32] [i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i32 @removeElement(i32* %5, i32 2, i32 4)
store i32 %6, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 21474836484, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @removeElement(i32* %3, i32 2, i32 4)
ret i32 0
}
/* Variables and functions */
int number_mm();
int number_percent(void) {
  int percent;
  while ((percent = number_mm() & (128 - 1)) > 99)
    ;
  return 1 + percent;
}


x86 assembly (clang, -O0):
<number_percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <number_mm@plt>
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x63,%eax
jle    1133 <number_percent+0x23>
jmp    1118 <number_percent+0x8>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_percent>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <number_mm@plt>
and    $0x7f,%eax
cmp    $0x63,%eax
ja     1120 <number_percent+0x10>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @number_percent() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @number_mm()
%4 = and i32 %3, 127
store i32 %4, i32* %1
%5 = icmp sgt i32 %4, 99
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 1, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @number_percent() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @number_mm()
%3 = and i32 %2, 127
%4 = icmp ugt i32 %3, 99
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = add nuw nsw i32 %3, 1
ret i32 %6
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_07(uint64_t x) {
  __asm__("rolq $7, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_07>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_07>:
mov    %rdi,%rax
rol    $0x7,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_07(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$7, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_07(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$7, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int sindex(char ch, char *s) {
  char *cp;
  for (cp = s; *cp; cp++) {
    if (*cp == ch) {
      return (int)(cp - s);
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<sindex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <sindex+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <sindex+0x49>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1166 <sindex+0x66>
jmp    114e <sindex+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <sindex+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sindex>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <sindex+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <sindex+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <sindex+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sindex(i8 signext %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2, %14
%6 = phi i8 [ %16, %14 ], [ %3, %2 ]
%7 = phi i8* [ %15, %14 ], [ %1, %2 ]
%8 = icmp eq i8 %6, %0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = ptrtoint i8* %7 to i64
%11 = ptrtoint i8* %1 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
br label %18
14: ; preds = %5
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %14, %2, %9
%19 = phi i32 [ %13, %9 ], [ -1, %2 ], [ -1, %14 ]
ret i32 %19
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t EPIIntErrorStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x0000021C))));
}


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

x86 assembly (clang, -O2):
<EPIIntErrorStatus>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x21c(%rax),%rax
ret

LLVM IR (-O0):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 540
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 540
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  int tv_nsec;
};
typedef unsigned long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t get_time_us(void) {
  int64_t value;
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  value = (t.tv_sec * 1000000ULL) + t.tv_nsec / 1000;
  return value;
}


x86 assembly (clang, -O0):
<get_time_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_us>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @get_time_us() {
%1 = alloca i64
%2 = alloca %struct.timespec
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add i64 %7, %11
store i64 %12, i64* %1
%13 = load i64, i64* %1
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @get_time_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add i64 %7, %11
ret i64 %12
}
struct hisi_reset_controller *hisi_reset_init(struct platform_device *pdev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hisi_reset_controller = type opaque
%struct.platform_device = type opaque
define %struct.hisi_reset_controller* @hisi_reset_init(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret %struct.hisi_reset_controller* null
}

LLVM IR (-O2):
%struct.hisi_reset_controller = type opaque
%struct.platform_device = type opaque
define noalias %struct.hisi_reset_controller* @hisi_reset_init(%struct.platform_device* nocapture readnone %0) {
ret %struct.hisi_reset_controller* null
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ class_close(struct session *, char *, char *);
int /*<<< orphan*/ class_open(struct session *, char *, char *);
int /*<<< orphan*/ do_read(struct session *, char *);
struct session *class_read(struct session *ses, char *left, char *right) {
  class_open(ses, left, right);
  do_read(ses, right);
  class_close(ses, left, right);
  return ses;
}


x86 assembly (clang, -O0):
<class_read>:
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   1050 <class_open@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <do_read@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <class_close@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_read>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <class_open@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <do_read@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <class_close@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.session = type { i32 }
define %struct.session* @class_read(%struct.session* %0, i8* %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i8*
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @class_open(%struct.session* %7, i8* %8, i8* %9)
%11 = load %struct.session*, %struct.session** %4
%12 = load i8*, i8** %6
%13 = call i32 @do_read(%struct.session* %11, i8* %12)
%14 = load %struct.session*, %struct.session** %4
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @class_close(%struct.session* %14, i8* %15, i8* %16)
%18 = load %struct.session*, %struct.session** %4
ret %struct.session* %18
}

LLVM IR (-O2):
%struct.session = type { i32 }
define %struct.session* @class_read(%struct.session* returned %0, i8* %1, i8* %2) {
%4 = tail call i32 @class_open(%struct.session* %0, i8* %1, i8* %2)
%5 = tail call i32 @do_read(%struct.session* %0, i8* %2)
%6 = tail call i32 @class_close(%struct.session* %0, i8* %1, i8* %2)
ret %struct.session* %0
}
int finitef(float x) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @finitef(float %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) { printf("Usage: %s <pathname>\n", prog); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s <pathname>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float wrnoise_2d_fancy(float, float, int, int /*<<< orphan*/,
                       int /*<<< orphan*/, float *, float *,
                       int /*<<< orphan*/);
float fancy_worley_noise(float x, float y) {
  float dontcare;
  return wrnoise_2d_fancy(x, y, 117, 0, 0, &dontcare, &dontcare, 0);
}


x86 assembly (clang, -O0):
<fancy_worley_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    $0x75,%edi
xor    %r9d,%r9d
lea    -0xc(%rbp),%r8
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r8,%rcx
call   1030 <wrnoise_2d_fancy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancy_worley_noise>:
push   %rax
lea    0x4(%rsp),%rcx
mov    $0x75,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %rcx,%r8
xor    %r9d,%r9d
call   1030 <wrnoise_2d_fancy@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @fancy_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @wrnoise_2d_fancy(float %6, float %7, i32 117, i32 0, i32 0, float* %5, float* %5, i32 0)
ret float %8
}

LLVM IR (-O2):
define float @fancy_worley_noise(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call float @wrnoise_2d_fancy(float %0, float %1, i32 117, i32 0, i32 0, float* %3, float* %3, i32 0)
ret float %5
}
void XtCvtIntToColor() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToColor() {
ret void
}
const char *utf8proc_version(void) {
  return "2"
         "."
         "2"
         "."
         "0"
         "";
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"2.2.0\00"
define i8* @utf8proc_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int strlen(char *);
void print_center(char *msg, int attr) {
  int row, col, len;
  len = strlen(msg);
  getmaxyx(stdscr, row, col);
  attron(attr);
  mvprintw(row / 2, (col - len) / 2, msg);
  attroff(attr);
  refresh();
}


x86 assembly (clang, -O0):
<print_center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1060 <getmaxyx@plt>
mov    -0xc(%rbp),%edi
call   1050 <attron@plt>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
call   1080 <mvprintw@plt>
mov    -0xc(%rbp),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_center>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <getmaxyx@plt>
mov    %ebp,%edi
call   1050 <attron@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1080 <mvprintw@plt>
mov    %ebp,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @print_center(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* @stdscr
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @getmaxyx(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @attron(i32 %14)
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 2
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
%21 = sdiv i32 %20, 2
%22 = load i8*, i8** %3
%23 = call i32 @mvprintw(i32 %17, i32 %21, i8* %22)
%24 = load i32, i32* %4
%25 = call i32 @attroff(i32 %24)
%26 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @print_center(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = load i32, i32* @stdscr
%5 = tail call i32 @getmaxyx(i32 %4, i32 undef, i32 undef)
%6 = tail call i32 @attron(i32 %1)
%7 = tail call i32 @mvprintw(i32 0, i32 0, i8* %0)
%8 = tail call i32 @attroff(i32 %1)
%9 = tail call i32 (...) @refresh()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t unaligned32(const void *v) {
  struct Unaligned {
    uint32_t i;
  } __attribute__((packed));
  return ((const struct Unaligned *)v)->i;
}


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

x86 assembly (clang, -O2):
<unaligned32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.Unaligned = type { i32 }
define i32 @unaligned32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.Unaligned*
%5 = getelementptr inbounds %struct.Unaligned, %struct.Unaligned* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @unaligned32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ val_str2type(char const *);
size_t val_type2size(int /*<<< orphan*/);
size_t val_str2size(const char *str) {
  return val_type2size(val_str2type(str));
}


x86 assembly (clang, -O0):
<val_str2size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <val_str2type@plt>
mov    %eax,%edi
call   1040 <val_type2size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_str2size>:
push   %rax
call   1030 <val_str2type@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <val_type2size@plt>

LLVM IR (-O0):
define i64 @val_str2size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @val_str2type(i8* %3)
%5 = call i64 @val_type2size(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @val_str2size(i8* %0) {
%2 = tail call i32 @val_str2type(i8* %0)
%3 = tail call i64 @val_type2size(i32 %2)
ret i64 %3
}
int iscntrl(int ch) { return ((unsigned int)ch < 32u || ch == 127); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void *memmove(dst, src, n)
char *dst;
char *src;
int n;
{
  if (dst < src)
    copy_low(dst, src, n);
  else if (dst > src)
    copy_high(dst, src, n);
  return dst;
}


x86 assembly (clang, -O0):
<memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <memmove+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <copy_low@plt>
jmp    117d <memmove+0x5d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1178 <memmove+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <copy_high@plt>
jmp    117d <memmove+0x5d>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
jae    1135 <memmove+0x15>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <copy_low@plt>
jmp    1141 <memmove+0x21>
jbe    1141 <memmove+0x21>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <copy_high@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @copy_low to i32 (i8*, i8*, i32, ...)*)(i8* %11, i8* %12, i32 %13)
br label %25
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = icmp ugt i8* %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @copy_high to i32 (i8*, i8*, i32, ...)*)(i8* %20, i8* %21, i32 %22)
br label %24
24: ; preds = %19, %15
br label %25
25: ; preds = %24, %10
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @memmove(i8* returned %0, i8* %1, i32 %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @copy_low to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
br label %11
7: ; preds = %3
%8 = icmp ugt i8* %0, %1
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @copy_high to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
br label %11
11: ; preds = %7, %9, %5
ret i8* %0
}