xunge/DecIR huggingface dataset:
/* Variables and functions */
double log10(int);
extern double log2(double x) {
  if (x == 2.0)
    return 1.0;
  else
    return log10(x) / log10(2);
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114c <log2+0x3c>
jp     114c <log2+0x3c>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <log2+0x66>
cvttsd2si -0x10(%rbp),%edi
call   1030 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jne    1127 <log2+0x17>
jp     1127 <log2+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log10@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 2.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fptosi double %8 to i32
%10 = call double @log10(i32 %9)
%11 = call double @log10(i32 2)
%12 = fdiv double %10, %11
store double %12, double* %2
br label %13
13: ; preds = %7, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @log2(double %0) {
%2 = fcmp oeq double %0, 2.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = fptosi double %0 to i32
%5 = tail call double @log10(i32 %4)
%6 = tail call double @log10(i32 2)
%7 = fdiv double %5, %6
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
ret double %9
}
void strip_cr(char *str) {
  while (*str)
    ++str;
  --str;
  if (*str == '\r')
    *str = *(str + 1);
}


x86 assembly (clang, -O0):
<strip_cr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1126 <strip_cr+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strip_cr+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    114f <strip_cr+0x4f>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_cr>:
add    $0xfffffffffffffffe,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x2(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strip_cr+0x10>
cmpb   $0xd,(%rdi)
jne    1122 <strip_cr+0x22>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strip_cr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 13
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 0, i8* %8
br label %12
12: ; preds = %11, %7
ret void
}
/* Variables and functions */
int japi_getkeycode(int);
int j_getkeycode(int arg0) { return (japi_getkeycode(arg0)); }


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

x86 assembly (clang, -O2):
<j_getkeycode>:
jmp    1030 <japi_getkeycode@plt>

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

LLVM IR (-O2):
define i32 @j_getkeycode(i32 %0) {
%2 = tail call i32 @japi_getkeycode(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int m, n;
  scanf("%d %d", &m, &n);
  printf("%d\n", m - n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct encoder_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
obs_encoder_packet_create_instance(struct encoder_packet *,
                                   struct encoder_packet const *);
void obs_duplicate_encoder_packet(struct encoder_packet *dst,
                                  const struct encoder_packet *src) {
  obs_encoder_packet_create_instance(dst, src);
}


x86 assembly (clang, -O0):
<obs_duplicate_encoder_packet>:
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 <obs_encoder_packet_create_instance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obs_duplicate_encoder_packet>:
jmp    1030 <obs_encoder_packet_create_instance@plt>

LLVM IR (-O0):
%struct.encoder_packet = type { i32 }
define void @obs_duplicate_encoder_packet(%struct.encoder_packet* %0, %struct.encoder_packet* %1) {
%3 = alloca %struct.encoder_packet*
%4 = alloca %struct.encoder_packet*
store %struct.encoder_packet* %0, %struct.encoder_packet** %3
store %struct.encoder_packet* %1, %struct.encoder_packet** %4
%5 = load %struct.encoder_packet*, %struct.encoder_packet** %3
%6 = load %struct.encoder_packet*, %struct.encoder_packet** %4
%7 = call i32 @obs_encoder_packet_create_instance(%struct.encoder_packet* %5, %struct.encoder_packet* %6)
ret void
}

LLVM IR (-O2):
%struct.encoder_packet = type { i32 }
define void @obs_duplicate_encoder_packet(%struct.encoder_packet* %0, %struct.encoder_packet* %1) {
%3 = tail call i32 @obs_encoder_packet_create_instance(%struct.encoder_packet* %0, %struct.encoder_packet* %1)
ret void
}
int ispunct(int ch) {
  return (((ch >= 33) && (ch <= 47)) || ((ch >= 58) && (ch <= 64)) ||
          ((ch >= 91) && (ch <= 96)) || ((ch >= 123) && (ch <= 126)));
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     116b <ispunct+0x6b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sdsapxsum(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sdsapxsum(N, 5.0f, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1030 <stdlib_strided_sdsapxsum@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_sdsapxsum@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sdsapxsum(i32 %6, float 5.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sdsapxsum(i32 4, float 5.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
void functionWithUnusedParameter(void *PUNUSED_unlessParamater
                                 __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @functionWithUnusedParameter(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_function();
int main(int argc, char *argv[]) { my_function(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @my_function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @my_function()
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
size_t strlen(char *);
void trim_end(char *str) {
  size_t len = strlen(str);
  size_t i = len - 1;
  while (isspace(str[i]))
    i--;
  i++;
  str[i] = '\0';
}


x86 assembly (clang, -O0):
<trim_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1171 <trim_end+0x51>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <trim_end+0x25>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_end>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
movsbl -0x2(%rbx),%edi
call   1040 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1130 <trim_end+0x10>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim_end(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %2, %1 ], [ %5, %3 ]
%5 = add i64 %4, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i64 @isspace(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %11
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_russianmode(char *opt) {
  if (strcmp(opt, "-r") == 0)
    return 1;
  if (strcmp(opt, "--russian") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_russianmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_russianmode+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_russianmode+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_russianmode+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_russianmode+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_russianmode>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_russianmode+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
@.str.1 = [10 x i8] c"--russian\00"
define i32 @opt_russianmode(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
unsigned inthash(void *i, int M) { return *(int *)i % M; }


x86 assembly (clang, -O0):
<inthash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthash>:
mov    (%rdi),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @inthash(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = srem i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @inthash(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = srem i32 %4, %1
ret i32 %5
}
void sstriping_init_req(void *vrt_req) {}


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

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

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

LLVM IR (-O2):
define void @sstriping_init_req(i8* nocapture %0) {
ret void
}
int pci_enable_pcie_error_reporting(struct pci_dev *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_enable_pcie_error_reporting(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
void cpu_get(int *cpuinfo, int info) {}


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

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

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

LLVM IR (-O2):
define void @cpu_get(i32* nocapture %0, i32 %1) {
ret void
}
int is_numeric(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_numeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_numeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void EC_POINT_hex2point(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_hex2point() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ z;
typedef int /*<<< orphan*/ y;
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int x[4];
  int *y[4];
  int(*z)[4];
  int *****p;
  if (sizeof(x) != (4 * sizeof(int)))
    abort();
  if (sizeof(y) != (4 * sizeof(void *)))
    abort();
  if (sizeof(z) != (sizeof(void *)))
    abort();
  if (sizeof(p) != (sizeof(void *)))
    abort();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32*]
%3 = alloca [4 x i32]*
%4 = alloca i32*****
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t test_untagged_nonint_bitmask(uint8_t val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @test_untagged_nonint_bitmask(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct PMASK {
  int dummy;
};

/* Variables and functions */
int _check_pmask_collision(struct PMASK const *, struct PMASK const *, int,
                           int);
int check_pmask_collision(const struct PMASK *mask1, const struct PMASK *mask2,
                          int x1, int y1, int x2, int y2) {
  return _check_pmask_collision(mask1, mask2, x2 - x1, y2 - y1);
}


x86 assembly (clang, -O0):
<check_pmask_collision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    -0x14(%rbp),%edx
mov    -0x20(%rbp),%ecx
sub    -0x18(%rbp),%ecx
call   1030 <_check_pmask_collision@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pmask_collision>:
sub    %edx,%r8d
sub    %ecx,%r9d
mov    %r8d,%edx
mov    %r9d,%ecx
jmp    1030 <_check_pmask_collision@plt>

LLVM IR (-O0):
%struct.PMASK = type { i32 }
define i32 @check_pmask_collision(%struct.PMASK* %0, %struct.PMASK* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.PMASK*
%8 = alloca %struct.PMASK*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.PMASK* %0, %struct.PMASK** %7
store %struct.PMASK* %1, %struct.PMASK** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.PMASK*, %struct.PMASK** %7
%14 = load %struct.PMASK*, %struct.PMASK** %8
%15 = load i32, i32* %11
%16 = load i32, i32* %9
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %12
%19 = load i32, i32* %10
%20 = sub nsw i32 %18, %19
%21 = call i32 @_check_pmask_collision(%struct.PMASK* %13, %struct.PMASK* %14, i32 %17, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.PMASK = type { i32 }
define i32 @check_pmask_collision(%struct.PMASK* %0, %struct.PMASK* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sub nsw i32 %4, %2
%8 = sub nsw i32 %5, %3
%9 = tail call i32 @_check_pmask_collision(%struct.PMASK* %0, %struct.PMASK* %1, i32 %7, i32 %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int pipe_open(char const *, char const *, int, int /*<<< orphan*/ *);
int pipe_input_command(const char *command, const char *input_filename,
                       pid_t *child_pid) {
  return pipe_open(command, input_filename, 1, child_pid);
}


x86 assembly (clang, -O0):
<pipe_input_command>:
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),%rcx
mov    $0x1,%edx
call   1030 <pipe_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_input_command>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <pipe_open@plt>

LLVM IR (-O0):
define i32 @pipe_input_command(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 = load i32*, i32** %6
%10 = call i32 @pipe_open(i8* %7, i8* %8, i32 1, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pipe_input_command(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @pipe_open(i8* %0, i8* %1, i32 1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int foo4(int);
__attribute__((no)) int bar4(int x) { return foo4(x + 6); }


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

x86 assembly (clang, -O2):
<bar4>:
add    $0x6,%edi
jmp    1030 <foo4@plt>

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

LLVM IR (-O2):
define i32 @bar4(i32 %0) {
%2 = add nsw i32 %0, 6
%3 = tail call i32 @foo4(i32 %2)
ret i32 %3
}
void SCB_CleanDCache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_CleanDCache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_point(int, int /*<<< orphan*/);
int /*<<< orphan*/ turn_player(int /*<<< orphan*/);
int turn_right() {
  turn_player(to_point(1, 0));
  return 1;
}


x86 assembly (clang, -O0):
<turn_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn_player@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_right>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn_player@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @turn_right() {
%1 = call i32 @to_point(i32 1, i32 0)
%2 = call i32 @turn_player(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @turn_right() {
%1 = tail call i32 @to_point(i32 1, i32 0)
%2 = tail call i32 @turn_player(i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAKE;
int futex(void volatile *, int /*<<< orphan*/, int, int /*<<< orphan*/ *,
          int /*<<< orphan*/ *, int /*<<< orphan*/);
int __futex_wake(volatile void *ftx, int count) {
  return futex(ftx, FUTEX_WAKE, count, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<__futex_wake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wake>:
mov    %esi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex@plt>

LLVM IR (-O0):
@FUTEX_WAKE = global i32 0
define i32 @__futex_wake(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* @FUTEX_WAKE
%7 = load i32, i32* %4
%8 = call i32 @futex(i8* %5, i32 %6, i32 %7, i32* null, i32* null, i32 0)
ret i32 %8
}

LLVM IR (-O2):
@FUTEX_WAKE = global i32 0
define i32 @__futex_wake(i8* %0, i32 %1) {
%3 = load i32, i32* @FUTEX_WAKE
%4 = tail call i32 @futex(i8* %0, i32 %3, i32 %1, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int am_big_endian(void) {
  uint32_t one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<am_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpb   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @am_big_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @am_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[64];
  strcpy(buf, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %6, i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
ret i32 0
}
int add_two(int x, int y) { return x + 2; }


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

x86 assembly (clang, -O2):
<add_two>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @add_two(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
ret i32 %3
}
/* Type definitions */
struct timer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timer *);
int /*<<< orphan*/ t_del(struct timer *);
struct timer *t_find(void (*)(void *), void const *);
void libt_remove_timeout(void (*fn)(void *), const void *dat) {
  struct timer *t;
  t = t_find(fn, dat);
  if (t) {
    t_del(t);
    free(t);
  }
}


x86 assembly (clang, -O0):
<libt_remove_timeout>:
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   1050 <t_find@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116e <libt_remove_timeout+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <t_del@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libt_remove_timeout>:
push   %rbx
call   1050 <t_find@plt>
test   %rax,%rax
je     114f <libt_remove_timeout+0x1f>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <t_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timer = type { i32 }
define void @libt_remove_timeout(void (i8*)* %0, i8* %1) {
%3 = tail call %struct.timer* @t_find(void (i8*)* %0, i8* %1)
%4 = icmp eq %struct.timer* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @t_del(%struct.timer* %3)
%7 = tail call i32 @free(%struct.timer* %3)
br label %8
8: ; preds = %5, %2
ret void
}
void gtk_paint_box() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ selcall_init(struct demod_state *);
void eea_init(struct demod_state *s) { selcall_init(s); }


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

x86 assembly (clang, -O2):
<eea_init>:
jmp    1030 <selcall_init@plt>

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

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @eea_init(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_init(%struct.demod_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main() {
  int n;
  initialise_board();
  start_trigger();
  for (n = 0; n < (4096 >> 10); ++n) {
    benchmark();
  }
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1183 <main+0x43>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1050 <benchmark@plt>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialise_board()
%4 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @benchmark()
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
%14 = call i32 (...) @stop_trigger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
%3 = tail call i32 (...) @benchmark()
%4 = tail call i32 (...) @benchmark()
%5 = tail call i32 (...) @benchmark()
%6 = tail call i32 (...) @benchmark()
%7 = tail call i32 (...) @stop_trigger()
ret i32 0
}
void soru_1(int a, int *p) {
  int a_deger = a;
  int *a_adres = &a;
  int *p_deger = p;
  int **p_adres = *p;
  int p_gosterdigi_deger = *p;
  _test_1(a_deger, a_adres, p_deger, p_adres, p_gosterdigi_deger);
}


x86 assembly (clang, -O0):
<soru_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x34(%rbp),%r8d
mov    $0x0,%al
call   1030 <_test_1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_1>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
mov    (%rsi),%eax
movslq %eax,%rcx
lea    0x4(%rsp),%rsi
mov    %ecx,%r8d
xor    %eax,%eax
call   1030 <_test_1@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @soru_1(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32**
%9 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%10 = load i32, i32* %3
store i32 %10, i32* %5
store i32* %3, i32** %6
%11 = load i32*, i32** %4
store i32* %11, i32** %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32**
store i32** %15, i32*** %8
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
store i32 %17, i32* %9
%18 = load i32, i32* %5
%19 = load i32*, i32** %6
%20 = load i32*, i32** %7
%21 = load i32**, i32*** %8
%22 = load i32, i32* %9
%23 = call i32 (i32, i32*, i32*, i32**, i32, ...) bitcast (i32 (...)* @_test_1 to i32 (i32, i32*, i32*, i32**, i32, ...)*)(i32 %18, i32* %19, i32* %20, i32** %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @soru_1(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32**
%7 = call i32 (i32, i32*, i32*, i32**, i32, ...) bitcast (i32 (...)* @_test_1 to i32 (i32, i32*, i32*, i32**, i32, ...)*)(i32 %0, i32* %3, i32* %1, i32** %6, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void Gosched(void) { sched_yield(); }


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

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

LLVM IR (-O0):
define void @Gosched() {
%1 = call i32 (...) @sched_yield()
ret void
}

LLVM IR (-O2):
define void @Gosched() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x2e() {
  Assert_real((isprint(46)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              235, ("isprint should be 1 for ."));
}


x86 assembly (clang, -O0):
<t_isprint_0x2e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xeb,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x2e>:
push   %rax
mov    $0x2e,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xeb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for .\00"
define void @t_isprint_0x2e() {
%1 = call i32 @isprint(i32 46)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for .\00"
define void @t_isprint_0x2e() {
%1 = tail call i32 @isprint(i32 46)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_69int16_reg(short val) {
  return ((val) & (-0x69 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_69int16_reg>:
test   $0xff97,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69int16_reg(i16 signext %0) {
%2 = and i16 %0, -105
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct list_cmdline_parser_params {
  int dummy;
};
struct list_args_info {
  int dummy;
};

/* Variables and functions */
int list_cmdline_parser_internal(int, char **, struct list_args_info *,
                                 struct list_cmdline_parser_params *,
                                 int /*<<< orphan*/);
int list_cmdline_parser_ext(int argc, char **argv,
                            struct list_args_info *args_info,
                            struct list_cmdline_parser_params *params) {
  int result;
  result = list_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<list_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <list_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <list_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.list_args_info = type { i32 }
%struct.list_cmdline_parser_params = type { i32 }
define i32 @list_cmdline_parser_ext(i32 %0, i8** %1, %struct.list_args_info* %2, %struct.list_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.list_args_info*
%8 = alloca %struct.list_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.list_args_info* %2, %struct.list_args_info** %7
store %struct.list_cmdline_parser_params* %3, %struct.list_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.list_args_info*, %struct.list_args_info** %7
%13 = load %struct.list_cmdline_parser_params*, %struct.list_cmdline_parser_params** %8
%14 = call i32 @list_cmdline_parser_internal(i32 %10, i8** %11, %struct.list_args_info* %12, %struct.list_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.list_args_info = type { i32 }
%struct.list_cmdline_parser_params = type { i32 }
define i32 @list_cmdline_parser_ext(i32 %0, i8** %1, %struct.list_args_info* %2, %struct.list_cmdline_parser_params* %3) {
%5 = tail call i32 @list_cmdline_parser_internal(i32 %0, i8** %1, %struct.list_args_info* %2, %struct.list_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_mask_spr(int);
void spr_write_clear(void *opaque, int sprn) { gen_op_mask_spr(sprn); }


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

x86 assembly (clang, -O2):
<spr_write_clear>:
mov    %esi,%edi
jmp    1030 <gen_op_mask_spr@plt>

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

LLVM IR (-O2):
define void @spr_write_clear(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @gen_op_mask_spr(i32 %1)
ret void
}