xunge/DecIR huggingface dataset:
int chilies(int w, int h, char done[h][w], int stack[w * h], int tail) {
  int x = stack[tail] % w;
  int y = (stack[tail] - x) / w % h;
  return done[y][x];
}


x86 assembly (clang, -O0):
<chilies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
sub    -0x20(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
mov    -0x30(%rbp),%rdx
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %rdx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chilies>:
mov    %rdx,%r9
mov    %edi,%r10d
movslq %r8d,%rax
mov    (%rcx,%rax,4),%eax
cltd
idiv   %edi
mov    %edx,%ecx
cltd
idiv   %esi
movslq %edx,%rax
imul   %r10,%rax
add    %r9,%rax
movslq %ecx,%rcx
movsbl (%rcx,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @chilies(i32 %0, i32 %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%13 = load i32, i32* %7
%14 = zext i32 %13 to i64
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = zext i32 %19 to i64
%21 = load i32*, i32** %9
%22 = load i32, i32* %10
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %6
%27 = srem i32 %25, %26
store i32 %27, i32* %11
%28 = load i32*, i32** %9
%29 = load i32, i32* %10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %11
%34 = sub nsw i32 %32, %33
%35 = load i32, i32* %6
%36 = sdiv i32 %34, %35
%37 = load i32, i32* %7
%38 = srem i32 %36, %37
store i32 %38, i32* %12
%39 = load i8*, i8** %8
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = mul nsw i64 %41, %16
%43 = getelementptr inbounds i8, i8* %39, i64 %42
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
ret i32 %48
}

LLVM IR (-O2):
define i32 @chilies(i32 %0, i32 %1, i8* nocapture %2, i32* nocapture %3, i32 %4) {
%6 = zext i32 %0 to i64
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %3, i64 %7
%9 = load i32, i32* %8
%10 = srem i32 %9, %0
%11 = sdiv i32 %9, %0
%12 = srem i32 %11, %1
%13 = sext i32 %12 to i64
%14 = mul nsw i64 %13, %6
%15 = getelementptr inbounds i8, i8* %2, i64 %14
%16 = sext i32 %10 to i64
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
ret i32 %19
}
cnull(c) int c;
{
  c = ulcase(c);
  null(c);
}


x86 assembly (clang, -O0):
<cnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <ulcase@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <null@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnull>:
push   %rax
xor    %eax,%eax
call   1030 <ulcase@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <null@plt>

LLVM IR (-O0):
define i32 @cnull(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @ulcase to i32 (i32, ...)*)(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @null to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @cnull(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ulcase to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @null to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Variables and functions */
double funcAngCor_p0_2plus_12minus_14926_L1(double *, double *);
double sin(double);
double fitAngDist_p0_2plus_12minus_14926_L1(double *x, double *par) {
  double result;
  result =
      funcAngCor_p0_2plus_12minus_14926_L1(x, &par[0]) * sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_p0_2plus_12minus_14926_L1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <funcAngCor_p0_2plus_12minus_14926_L1@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_p0_2plus_12minus_14926_L1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <funcAngCor_p0_2plus_12minus_14926_L1@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_p0_2plus_12minus_14926_L1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_p0_2plus_12minus_14926_L1(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_p0_2plus_12minus_14926_L1(double* %0, double* %1) {
%3 = tail call double @funcAngCor_p0_2plus_12minus_14926_L1(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int valid_user_group_name_or_id_full(char const *, int);
bool valid_user_group_name_or_id_compat(const char *u) {
  return valid_user_group_name_or_id_full(u, false);
}


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

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

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

LLVM IR (-O2):
define i32 @valid_user_group_name_or_id_compat(i8* %0) {
%2 = tail call i32 @valid_user_group_name_or_id_full(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void ajMemSetZero(void *ptr, size_t count, size_t nbytes) {
  if (ptr == NULL)
    return;
  if (!nbytes)
    return;
  if (!count)
    return;
  memset(ptr, 0, count * nbytes);
  return;
}


x86 assembly (clang, -O0):
<ajMemSetZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <ajMemSetZero+0x24>
jmp    1168 <ajMemSetZero+0x58>
cmpq   $0x0,-0x18(%rbp)
jne    1144 <ajMemSetZero+0x34>
jmp    1168 <ajMemSetZero+0x58>
cmpq   $0x0,-0x10(%rbp)
jne    1154 <ajMemSetZero+0x44>
jmp    1168 <ajMemSetZero+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajMemSetZero>:
test   %rsi,%rsi
je     112a <ajMemSetZero+0x1a>
test   %rdi,%rdi
je     112a <ajMemSetZero+0x1a>
test   %rdx,%rdx
je     112a <ajMemSetZero+0x1a>
imul   %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>
ret

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

LLVM IR (-O2):
define void @ajMemSetZero(i8* %0, i64 %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i64 %2, 0
%6 = and i1 %4, %5
%7 = icmp ne i64 %1, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = mul i64 %2, %1
%11 = tail call i32 @memset(i8* %0, i32 0, i64 %10)
br label %12
12: ; preds = %3, %9
ret void
}
void ff_hevc_put_hevc_uni_qpel_h24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h24_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void print_repl(int mode) {
  assert(mode == 4 || mode == 8);
  switch (mode) {
  case 4:
    printf("move> ");
    break;
  case 8:
    printf("WAIT.\n");
    break;
  }
}


x86 assembly (clang, -O0):
<print_repl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <print_repl+0x24>
cmpl   $0x8,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
movzbl %al,%edi
and    $0x1,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     1177 <print_repl+0x57>
jmp    1166 <print_repl+0x46>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     1188 <print_repl+0x68>
jmp    1194 <print_repl+0x74>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <print_repl+0x74>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_repl>:
push   %rbx
mov    %edi,%ebx
cmp    $0x4,%edi
sete   %al
cmp    $0x8,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1050 <assert@plt>
cmp    $0x8,%ebx
je     1160 <print_repl+0x30>
cmp    $0x4,%ebx
jne    116d <print_repl+0x3d>
lea    0xea6(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>
lea    0xea0(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"move> \00"
@.str.1 = [7 x i8] c"WAIT.\0A\00"
define void @print_repl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 8
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
switch i32 %12, label %17 [
i32 4, label %13
i32 8, label %15
]
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %8, %15, %13
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"move> \00"
@str = [6 x i8] c"WAIT.\00"
define void @print_repl(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = icmp eq i32 %0, 8
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
switch i32 %0, label %11 [
i32 4, label %7
i32 8, label %9
]
7: ; preds = %1
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9, %7
ret void
}
void api_tcp_listener_on_error(struct api_tcp_listener_t *listener, int code) {}


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

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

LLVM IR (-O0):
%struct.api_tcp_listener_t = type opaque
define void @api_tcp_listener_on_error(%struct.api_tcp_listener_t* %0, i32 %1) {
%3 = alloca %struct.api_tcp_listener_t*
%4 = alloca i32
store %struct.api_tcp_listener_t* %0, %struct.api_tcp_listener_t** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.api_tcp_listener_t = type opaque
define void @api_tcp_listener_on_error(%struct.api_tcp_listener_t* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void FreeBufferFile(void *in, int size) { munmap(in, size); }


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

x86 assembly (clang, -O2):
<FreeBufferFile>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @FreeBufferFile(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 @munmap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @FreeBufferFile(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret void
}
void label_scan() {}


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

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

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

LLVM IR (-O2):
define void @label_scan() {
ret void
}
void ff_hevc_put_hevc_epel_v64_8_sse4() {}


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

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

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

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

/* Variables and functions */
struct option *get_opt(char const *, char const *);
char *opt_longstr(struct option *);
char *getopt_str(const char *sect_name, const char *key) {
  struct option *o = get_opt(sect_name, key);
  if (o)
    return opt_longstr(o);
  return NULL;
}


x86 assembly (clang, -O0):
<getopt_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_opt@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115e <getopt_str+0x3e>
mov    -0x20(%rbp),%rdi
call   1030 <opt_longstr@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <getopt_str+0x46>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_str>:
push   %rax
call   1040 <get_opt@plt>
test   %rax,%rax
je     1134 <getopt_str+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <opt_longstr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.option = type { i32 }
define i8* @getopt_str(i8* %0, i8* %1) {
%3 = tail call %struct.option* @get_opt(i8* %0, i8* %1)
%4 = icmp eq %struct.option* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @opt_longstr(%struct.option* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
int ends_in_3(num) {
  int digit = num % 10;
  if (digit == 3)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ends_in_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jne    112b <ends_in_3+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <ends_in_3+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_in_3>:
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ends_in_3(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gclrline();
int /*<<< orphan*/ gmove(int, int);
int /*<<< orphan*/ gputs(char *);
void saystat(char *msg) {
  gmove(20, 1);
  gputs(msg);
  gclrline();
}


x86 assembly (clang, -O0):
<saystat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
mov    $0x1,%esi
call   1050 <gmove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <gputs@plt>
mov    $0x0,%al
call   1040 <gclrline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saystat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x14,%edi
mov    $0x1,%esi
call   1050 <gmove@plt>
mov    %rbx,%rdi
call   1030 <gputs@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <gclrline@plt>

LLVM IR (-O0):
define void @saystat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @gmove(i32 20, i32 1)
%4 = load i8*, i8** %2
%5 = call i32 @gputs(i8* %4)
%6 = call i32 (...) @gclrline()
ret void
}

LLVM IR (-O2):
define void @saystat(i8* %0) {
%2 = tail call i32 @gmove(i32 20, i32 1)
%3 = tail call i32 @gputs(i8* %0)
%4 = tail call i32 (...) @gclrline()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int write_flash_page(int, int const *);
int dbg_writepage(uint8_t page, const uint8_t *buf) {
  uint32_t addr = page * 1024;
  return write_flash_page(addr, buf);
}


x86 assembly (clang, -O0):
<dbg_writepage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <write_flash_page@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_writepage>:
shl    $0xa,%edi
jmp    1030 <write_flash_page@plt>

LLVM IR (-O0):
define i32 @dbg_writepage(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1024
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = call i32 @write_flash_page(i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @dbg_writepage(i32 %0, i32* %1) {
%3 = shl nsw i32 %0, 10
%4 = tail call i32 @write_flash_page(i32 %3, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cmdparser(char const *);
void cmd_order(const char *text) { cmdparser(text); }


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

x86 assembly (clang, -O2):
<cmd_order>:
jmp    1030 <cmdparser@plt>

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

LLVM IR (-O2):
define void @cmd_order(i8* %0) {
%2 = tail call i32 @cmdparser(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void t7() {
  int n = 0;
#pragma acc parallel copy(n) num_gangs(1) num_workers(1) vector_length(32)
  { n++; }
  assert(n == 1);
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @t7() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @t7() {
%1 = tail call i32 @assert(i32 1)
ret void
}
int hash(void *elt) {
  return (((char *)elt)[0] - 'a') * 676 + (((char *)elt)[1] - 'a') * 26 +
         (((char *)elt)[2] - 'a');
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
imul   $0x2a4,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x61,%ecx
imul   $0x1a,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x61,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movsbl (%rdi),%eax
imul   $0x2a4,%eax,%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
add    %eax,%edx
movsbl 0x2(%rdi),%eax
add    %edx,%eax
add    $0xfffef5a1,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = mul nsw i32 %7, 676
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = mul nsw i32 %13, 26
%15 = add nsw i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %15, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 676
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %7, 26
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %4, -68191
%13 = add nsw i32 %12, %8
%14 = add nsw i32 %13, %11
ret i32 %14
}
int fibo(int n) {
  if (n <= 1)
    return n;
  else {
    return fibo(n - 1) + fibo(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fibo+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibo+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibo+0x10>
mov    %ebx,%ecx
jmp    1144 <fibo+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibo+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int any_match(char **, char **, char, char);
int lt_match(char **buffer, char **speech) {
  return any_match(buffer, speech, '<', '>');
}


x86 assembly (clang, -O0):
<lt_match>:
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    $0x3c,%edx
mov    $0x3e,%ecx
call   1030 <any_match@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_match>:
mov    $0x3c,%edx
mov    $0x3e,%ecx
jmp    1030 <any_match@plt>

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

LLVM IR (-O2):
define i32 @lt_match(i8** %0, i8** %1) {
%3 = tail call i32 @any_match(i8** %0, i8** %1, i8 signext 60, i8 signext 62)
ret i32 %3
}
unsigned int explicit_signed_int_to_unsigned_int(signed int src) {
  return (unsigned int)src;
}


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

x86 assembly (clang, -O2):
<explicit_signed_int_to_unsigned_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @explicit_signed_int_to_unsigned_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ asin(float);
float sdASin(float s) { return (float)asin(s) * (180.0 / 3.1415926535f); }


x86 assembly (clang, -O0):
<sdASin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asin@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdASin>:
push   %rax
call   1030 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sdASin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @asin(float %3)
%5 = sitofp i64 %4 to float
%6 = fpext float %5 to double
%7 = fmul double %6, 0x404CA5DC0D03CF26
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sdASin(float %0) {
%2 = tail call i64 @asin(float %0)
%3 = sitofp i64 %2 to float
%4 = fpext float %3 to double
%5 = fmul double %4, 0x404CA5DC0D03CF26
%6 = fptrunc double %5 to float
ret float %6
}
void mismatched(int x) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char const *);
void write_file(const char *path, const char *data, int len) {
  FILE *ofp = fopen(path, "wb");
  fwrite(data, 1, len, ofp);
  fclose(ofp);
  printf("Written %s\n", path);
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe82(%rip),%rdi
mov    %rbp,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
@.str.1 = [12 x i8] c"Written %s\0A\00"
define void @write_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 1, i32 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
%16 = load i8*, i8** %4
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
@.str.1 = [12 x i8] c"Written %s\0A\00"
define void @write_file(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ con_error(char *);
int /*<<< orphan*/ drop_neighbour(int);
int sscanf(char const *, char *, int *);
void cmd_drop(const char *args) {
  int node;
  if (sscanf(args, "%d", &node) != 1) {
    con_error("usage: drop <node>\n");
    return;
  }
  drop_neighbour(node);
}


x86 assembly (clang, -O0):
<cmd_drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     116a <cmd_drop+0x3a>
lea    0xea3(%rip),%rdi
call   1030 <con_error@plt>
jmp    1172 <cmd_drop+0x42>
mov    -0xc(%rbp),%edi
call   1050 <drop_neighbour@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_drop>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1152 <cmd_drop+0x22>
mov    0x4(%rsp),%edi
call   1050 <drop_neighbour@plt>
pop    %rax
ret
lea    0xeaa(%rip),%rdi
call   1030 <con_error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"usage: drop <node>\0A\00"
define void @cmd_drop(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @con_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @drop_neighbour(i32 %10)
br label %12
12: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"usage: drop <node>\0A\00"
define void @cmd_drop(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @con_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @drop_neighbour(i32 %9)
br label %11
11: ; preds = %8, %6
ret void
}
void OCSP_RESPID_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPID_free() {
ret void
}
unsigned long __attribute__((regparm(2))) Def_READL(unsigned long adr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @Def_READL(i64 %0) {
ret i64 0
}
int test_17(unsigned char x, int y, int z) { return ((x >> 2) & 16) != 0; }


x86 assembly (clang, -O0):
<test_17>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_17>:
shr    $0x6,%dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @test_17(i8 zeroext %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 = zext i8 %7 to i32
%9 = ashr i32 %8, 2
%10 = and i32 %9, 16
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_17(i8 zeroext %0, i32 %1, i32 %2) {
%4 = lshr i8 %0, 6
%5 = and i8 %4, 1
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Arg_print();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void errorNoName(char *s) {
  printf("unknown switch: %s\n", s);
  Arg_print();
  exit(0);
}


x86 assembly (clang, -O0):
<errorNoName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Arg_print@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<errorNoName>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <Arg_print@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"unknown switch: %s\0A\00"
define void @errorNoName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @Arg_print()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"unknown switch: %s\0A\00"
define void @errorNoName(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @Arg_print()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void reverse(int *nums, int i, int j) {
  int temp;
  while (i < j) {
    temp = nums[i];
    nums[i] = nums[j];
    nums[j] = temp;
    i++;
    j--;
  }
  return;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverse+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    112e <reverse+0x2e>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
mov    -0x4(%rdi,%rax,4),%edx
mov    (%rdi,%rcx,4),%esi
mov    %esi,-0x4(%rdi,%rax,4)
mov    %edx,(%rdi,%rcx,4)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %9
%14 = load i32, i32* %13
store i32 %14, i32* %11
store i32 %12, i32* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Type definitions */
typedef char *gid_t;

/* Variables and functions */
gid_t getegid(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(50));
  do {
    return (gid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<getegid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getegid>:
mov    $0x32,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @getegid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 50)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @getegid() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 50)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
int endian_test() {
  if ((*(unsigned short *)("#S") >> 8) == '#') {
    return !(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<endian_test>:
push   %rbp
mov    %rsp,%rbp
movzwl 0xef5(%rip),%eax
sar    $0x8,%eax
cmp    $0x23,%eax
jne    1123 <endian_test+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <endian_test+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"#S\00"
define i32 @endian_test() {
%1 = alloca i32
%2 = load i16, i16* bitcast ([3 x i8]* @.str to i16*)
%3 = zext i16 %2 to i32
%4 = ashr i32 %3, 8
%5 = icmp eq i32 %4, 35
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian_test() {
ret i32 0
}
/* Variables and functions */
long lgcd(long, long);
long llcm(long a, long b) {
  return ((a * b) < 0 ? -(a * b) : (a * b)) / lgcd(a, b);
}


x86 assembly (clang, -O0):
<llcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
cmp    $0x0,%rax
jge    114a <llcm+0x3a>
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1157 <llcm+0x47>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lgcd@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llcm>:
push   %rbx
mov    %rsi,%rax
imul   %rdi,%rax
mov    %rax,%rbx
neg    %rbx
cmovs  %rax,%rbx
call   1030 <lgcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     113d <llcm+0x2d>
mov    %rbx,%rax
cqto
idiv   %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @llcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = mul nsw i64 %10, %11
%13 = sub nsw i64 0, %12
br label %18
14: ; preds = %2
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = mul nsw i64 %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i64 [ %13, %9 ], [ %17, %14 ]
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = call i64 @lgcd(i64 %20, i64 %21)
%23 = sdiv i64 %19, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @llcm(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @llvm.abs.i64(i64 %3, i1 true)
%5 = tail call i64 @lgcd(i64 %0, i64 %1)
%6 = sdiv i64 %4, %5
ret i64 %6
}
void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info) {}


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

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

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

LLVM IR (-O2):
%struct.btrfs_fs_info = type opaque
define void @btrfs_init_ref_verify(%struct.btrfs_fs_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
void cleanup(void) {
  curs_set(1);
  endwin();
}


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

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
mov    $0x1,%edi
call   1040 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 (...) @endwin()
ret void
}
void test() {
  struct {
    int bit : 1;
  } a;
  a.bit = 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%al
and    $0xfe,%al
or     $0x1,%al
mov    %al,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
define void @test() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = load i8, i8* %2
%4 = and i8 %3, -2
%5 = or i8 %4, 1
store i8 %5, i8* %2
ret void
}

LLVM IR (-O2):
define void @test() {
ret void
}
int luaO_fb2int(int x) {
  int e = (x >> 3) & 31;
  if (e == 0)
    return x;
  else
    return ((x & 7) + 8) << (e - 1);
}


x86 assembly (clang, -O0):
<luaO_fb2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1128 <luaO_fb2int+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <luaO_fb2int+0x3c>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
add    $0x8,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaO_fb2int>:
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1f,%edx
lea    -0x1(%rdx),%ecx
mov    %edi,%eax
and    $0x7,%eax
or     $0x8,%eax
shl    %cl,%eax
cmp    $0x1,%edx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @luaO_fb2int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 3
%7 = and i32 %6, 31
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %19
12: ; preds = %1
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = add nsw i32 %14, 8
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = shl i32 %15, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @luaO_fb2int(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 31
%4 = icmp eq i32 %3, 0
%5 = and i32 %0, 7
%6 = or i32 %5, 8
%7 = add nsw i32 %3, -1
%8 = shl i32 %6, %7
%9 = select i1 %4, i32 %0, i32 %8
ret i32 %9
}