xunge/DecIR huggingface dataset:
/* Type definitions */
struct obstack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void _obstack_newchunk(struct obstack *o, int i) { abort(); }


x86 assembly (clang, -O0):
<_obstack_newchunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_obstack_newchunk>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.obstack = type { i32 }
define void @_obstack_newchunk(%struct.obstack* %0, i32 %1) {
%3 = alloca %struct.obstack*
%4 = alloca i32
store %struct.obstack* %0, %struct.obstack** %3
store i32 %1, i32* %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.obstack = type { i32 }
define void @_obstack_newchunk(%struct.obstack* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _backlight_on();
int /*<<< orphan*/ _backlight_pwm(int);
void _backlight_panic_on(void) {
  _backlight_on();
  _backlight_pwm(1);
}


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

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

LLVM IR (-O0):
define void @_backlight_panic_on() {
%1 = call i32 (...) @_backlight_on()
%2 = call i32 @_backlight_pwm(i32 1)
ret void
}

LLVM IR (-O2):
define void @_backlight_panic_on() {
%1 = tail call i32 (...) @_backlight_on()
%2 = tail call i32 @_backlight_pwm(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ isinf(double);
scalar_t__ isnan(double);
int finite(double d) { return isinf(d) == 0 && isnan(d) == 0; }


x86 assembly (clang, -O0):
<finite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115d <finite+0x3d>
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1137 <finite+0x17>
pop    %rcx
ret
movsd  (%rsp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isinf(double %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = call i64 @isnan(double %7)
%9 = icmp eq i64 %8, 0
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 @finite(double %0) {
%2 = tail call i64 @isinf(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isnan(double %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    return 0;
  return atoi(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    111e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <atoi@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int M_PI;
double fmodr(double, int);
double mod2pi(double theta) { return fmodr(theta, 2 * M_PI); }


x86 assembly (clang, -O0):
<mod2pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1030 <fmodr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2pi>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
jmp    1030 <fmodr@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define double @mod2pi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = mul nsw i32 2, %4
%6 = call double @fmodr(double %3, i32 %5)
ret double %6
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @mod2pi(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = tail call double @fmodr(double %0, i32 %3)
ret double %4
}
void RTStrToInt64Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt64Ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_exit1(void) { printf("first exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"first exit handler\0A\00"
define void @my_exit1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"first exit handler\00"
define void @my_exit1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  float result, a[3];
  a[0] = 1.0000;
  a[1] = -0.375;
  a[2] = 0.1875;
  result = a[0] + a[1] + a[2];
  assert(result == 0.8125);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xef0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xedf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xece(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca [3 x float]
%3 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float -3.750000e-01, float* %4
%5 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float 1.875000e-01, float* %5
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = load float, float* %6
%8 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
%11 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
%12 = load float, float* %11
%13 = fadd float %10, %12
store float %13, float* %1
%14 = load float, float* %1
%15 = fpext float %14 to double
%16 = fcmp oeq double %15, 8.125000e-01
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetVolumeDB(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UPnPRenderingControl_GetVolumeDB(void *upnptoken, unsigned int InstanceID,
                                      char *Channel) {
  printf("Invoke: UPnPRenderingControl_GetVolumeDB(%u,%s);\r\n", InstanceID,
         Channel);
  UPnPResponse_RenderingControl_GetVolumeDB(upnptoken, 25000);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetVolumeDB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x61a8,%esi
call   1040 <UPnPResponse_RenderingControl_GetVolumeDB@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetVolumeDB>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61a8,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetVolumeDB@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Invoke: UPnPRenderingControl_GetVolumeDB(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolumeDB(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_GetVolumeDB(i8* %10, i32 25000)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Invoke: UPnPRenderingControl_GetVolumeDB(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolumeDB(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_GetVolumeDB(i8* %0, i32 25000)
ret void
}
TIFFSwabShort(wp) unsigned short *wp;
{
  register unsigned char *cp = (unsigned char *)wp;
  int t;
  t = cp[1];
  cp[1] = cp[0];
  cp[0] = t;
}


x86 assembly (clang, -O0):
<TIFFSwabShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TIFFSwabShort>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define i32 @TIFFSwabShort(i16* %0) {
%2 = alloca i32
%3 = alloca i16*
%4 = alloca i8*
%5 = alloca i32
store i16* %0, i16** %3
%6 = load i16*, i16** %3
%7 = bitcast i16* %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %5
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 %18, i8* %20
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @TIFFSwabShort(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %3
%5 = load i8, i8* %2
store i8 %5, i8* %3
store i8 %4, i8* %2
ret i32 undef
}
void main(void) {
  int x;
  float y;
  float w;
  w = x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = load float, float* %2
%7 = fadd float %5, %6
store float %7, float* %3
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_CRL_add_nconf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_register(unsigned int, unsigned int);
void write_register_dataprocessing(unsigned int reg, unsigned int data) {
  if (reg != 15) {
    write_register(reg, data);
  }
  return;
}


x86 assembly (clang, -O0):
<write_register_dataprocessing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xf,-0x4(%rbp)
je     1133 <write_register_dataprocessing+0x23>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_register_dataprocessing>:
cmp    $0xf,%edi
jne    1116 <write_register_dataprocessing+0x6>
ret
jmp    1030 <write_register@plt>

LLVM IR (-O0):
define void @write_register_dataprocessing(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 = icmp ne i32 %5, 15
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @write_register(i32 %8, i32 %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @write_register_dataprocessing(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 15
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @write_register(i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test10();
int /*<<< orphan*/ test11();
int /*<<< orphan*/ test12();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ test7();
int /*<<< orphan*/ test8();
int /*<<< orphan*/ test9();
int main(void) {
  test1();
  test2();
  test3();
  test4();
  test5();
  test6();
  test7();
  test8();
  test9();
  test10();
  test11();
  test12();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test1@plt>
mov    $0x0,%al
call   10c0 <test2@plt>
mov    $0x0,%al
call   1050 <test3@plt>
mov    $0x0,%al
call   10b0 <test4@plt>
mov    $0x0,%al
call   1040 <test5@plt>
mov    $0x0,%al
call   10a0 <test6@plt>
mov    $0x0,%al
call   1030 <test7@plt>
mov    $0x0,%al
call   10e0 <test8@plt>
mov    $0x0,%al
call   1090 <test9@plt>
mov    $0x0,%al
call   1060 <test10@plt>
mov    $0x0,%al
call   10d0 <test11@plt>
mov    $0x0,%al
call   1080 <test12@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test1@plt>
xor    %eax,%eax
call   10c0 <test2@plt>
xor    %eax,%eax
call   1050 <test3@plt>
xor    %eax,%eax
call   10b0 <test4@plt>
xor    %eax,%eax
call   1040 <test5@plt>
xor    %eax,%eax
call   10a0 <test6@plt>
xor    %eax,%eax
call   1030 <test7@plt>
xor    %eax,%eax
call   10e0 <test8@plt>
xor    %eax,%eax
call   1090 <test9@plt>
xor    %eax,%eax
call   1060 <test10@plt>
xor    %eax,%eax
call   10d0 <test11@plt>
xor    %eax,%eax
call   1080 <test12@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
%8 = call i32 (...) @test7()
%9 = call i32 (...) @test8()
%10 = call i32 (...) @test9()
%11 = call i32 (...) @test10()
%12 = call i32 (...) @test11()
%13 = call i32 (...) @test12()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
%7 = tail call i32 (...) @test7()
%8 = tail call i32 (...) @test8()
%9 = tail call i32 (...) @test9()
%10 = tail call i32 (...) @test10()
%11 = tail call i32 (...) @test11()
%12 = tail call i32 (...) @test12()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
int copy_to_user(void *result_record, void *res, size_t size) {
  memcpy(result_record, res, size);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @copy_to_user(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @copy_to_user(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret i32 0
}
void example3(void) {
  int array1[5];
  int *ptr = &array1;
  for (int i = 0; i < 5; i++) {
    *ptr = 42;
    assert(*ptr == 42);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<example3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    116b <example3+0x5b>
mov    -0x28(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x28(%rbp),%rax
cmpl   $0x2a,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1127 <example3+0x17>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @example3() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i32*
store i32* %4, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %2
store i32 42, i32* %9
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 42
%13 = zext i1 %12 to i32
%14 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %13)
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @example3() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret void
}
char dprintf_IsQualifierNoDollar(char c) {
  switch (c) {
  case '-':
  case '+':
  case ' ':
  case '#':
  case '.':
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case 'h':
  case 'l':
  case 'L':
  case 'z':
  case 'q':
  case '*':
  case 'O':
    return ((char)(1 == 1));
  default:
    return ((char)(0 == 1));
  }
}


x86 assembly (clang, -O0):
<dprintf_IsQualifierNoDollar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5a,%eax
ja     113d <dprintf_IsQualifierNoDollar+0x3d>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x1(%rbp)
jmp    1141 <dprintf_IsQualifierNoDollar+0x41>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dprintf_IsQualifierNoDollar>:
add    $0xffffffe0,%edi
cmp    $0x5a,%edi
ja     111b <dprintf_IsQualifierNoDollar+0x1b>
mov    $0x1,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @dprintf_IsQualifierNoDollar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 45, label %6
i32 43, label %6
i32 32, label %6
i32 35, label %6
i32 46, label %6
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
i32 104, label %6
i32 108, label %6
i32 76, label %6
i32 122, label %6
i32 113, label %6
i32 42, label %6
i32 79, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i8 1, i8* %2
br label %8
7: ; preds = %1
store i8 0, i8* %2
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @dprintf_IsQualifierNoDollar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 45, label %4
i32 43, label %4
i32 32, label %4
i32 35, label %4
i32 46, label %4
i32 48, label %4
i32 49, label %4
i32 50, label %4
i32 51, label %4
i32 52, label %4
i32 53, label %4
i32 54, label %4
i32 55, label %4
i32 56, label %4
i32 57, label %4
i32 104, label %4
i32 108, label %4
i32 76, label %4
i32 122, label %4
i32 113, label %4
i32 42, label %4
i32 79, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i8 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %5
}
/* Variables and functions */
int checksum(char *, int);
int /*<<< orphan*/ memcpy(int *, char *, int);
int valid(char *msg, int len) {
  int c_sum;
  int c_sum_given;
  c_sum = checksum(msg, len - 4);
  memcpy(&c_sum_given, msg + len - 4, 4);
  if (c_sum == c_sum_given)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x4,%esi
call   1030 <checksum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
lea    -0x1c(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1176 <valid+0x56>
movl   $0x1,-0x4(%rbp)
jmp    117d <valid+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x4(%rbx),%esi
call   1030 <checksum@plt>
mov    %eax,%ebp
movslq %ebx,%rax
lea    (%r14,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
cmp    0xc(%rsp),%ebp
sete   %al
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @valid(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = add nsw i32 %1, -4
%6 = tail call i32 @checksum(i8* %0, i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = getelementptr inbounds i8, i8* %8, i64 -4
%10 = call i32 @memcpy(i32* %3, i8* %9, i32 4)
%11 = load i32, i32* %3
%12 = icmp eq i32 %6, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t myHtonl(uint32_t input) {
  uint32_t output = 0;
  output |= (input & 0xFF000000) >> 24;
  output |= (input & 0x00FF0000) >> 8;
  output |= (input & 0x0000FF00) << 8;
  output |= (input & 0x000000FF) << 24;
  return output;
}


x86 assembly (clang, -O0):
<myHtonl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @myHtonl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, -16777216
%6 = lshr i32 %5, 24
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %9, 16711680
%11 = ashr i32 %10, 8
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = and i32 %14, 65280
%16 = shl i32 %15, 8
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = and i32 %19, 255
%21 = shl i32 %20, 24
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @myHtonl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ iDoRemoteFunc(unsigned char *, unsigned int, int);
char *malloc(int);
unsigned int sprintf(char *, char *, int);
void _vRcSD_DeInit(void) {
  unsigned int uiDataLen;
  char *psFunCall = malloc(100);
  uiDataLen = sprintf(psFunCall, "%u()", 5002);
  iDoRemoteFunc((unsigned char *)psFunCall, uiDataLen, 1);
  free(psFunCall);
}


x86 assembly (clang, -O0):
<_vRcSD_DeInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x138a,%edx
call   1060 <sprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1050 <iDoRemoteFunc@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vRcSD_DeInit>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
mov    $0x138a,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <iDoRemoteFunc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%u()\00"
define void @_vRcSD_DeInit() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5002)
store i32 %5, i32* %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %1
%8 = call i32 @iDoRemoteFunc(i8* %6, i32 %7, i32 1)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%u()\00"
define void @_vRcSD_DeInit() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5002)
%3 = tail call i32 @iDoRemoteFunc(i8* %1, i32 %2, i32 1)
%4 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int file_entry_comparator(const void *f1, const void *f2) {
  return strcmp((const char *)f1, (const char *)f2);
}


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

x86 assembly (clang, -O2):
<file_entry_comparator>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @file_entry_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int number_bits(int);
int umax(int, int);
int number_fuzzy(int number) {
  switch (number_bits(2)) {
  case 0:
    number -= 1;
    break;
  case 3:
    number += 1;
    break;
  }
  return (umax((1), (number)));
}


x86 assembly (clang, -O0):
<number_fuzzy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <number_bits@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
test   %eax,%eax
je     1158 <number_fuzzy+0x38>
jmp    1147 <number_fuzzy+0x27>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1166 <number_fuzzy+0x46>
jmp    116f <number_fuzzy+0x4f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <number_fuzzy+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <umax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_fuzzy>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1030 <number_bits@plt>
cmp    $0x3,%eax
je     113b <number_fuzzy+0x1b>
test   %eax,%eax
jne    113e <number_fuzzy+0x1e>
add    $0xffffffff,%ebx
jmp    113e <number_fuzzy+0x1e>
add    $0x1,%ebx
mov    $0x1,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <umax@plt>

LLVM IR (-O0):
define i32 @number_fuzzy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @number_bits(i32 2)
switch i32 %3, label %10 [
i32 0, label %4
i32 3, label %7
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %1, %7, %4
%11 = load i32, i32* %2
%12 = call i32 @umax(i32 1, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @number_fuzzy(i32 %0) {
%2 = tail call i32 @number_bits(i32 2)
switch i32 %2, label %7 [
i32 0, label %3
i32 3, label %5
]
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %7
5: ; preds = %1
%6 = add nsw i32 %0, 1
br label %7
7: ; preds = %1, %5, %3
%8 = phi i32 [ %0, %1 ], [ %6, %5 ], [ %4, %3 ]
%9 = tail call i32 @umax(i32 1, i32 %8)
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_iis(uint16_t instruction) {
  return (instruction >> 0x00) & 0x07;
}


x86 assembly (clang, -O0):
<instruction_extension_extract_iis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_extension_extract_iis>:
mov    %edi,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @instruction_extension_extract_iis(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 0
%5 = and i32 %4, 7
ret i32 %5
}

LLVM IR (-O2):
define i32 @instruction_extension_extract_iis(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int transp_connect(struct sockaddr_in dest, struct sockaddr_in src) {
  return -1;
}


x86 assembly (clang, -O0):
<transp_connect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i32 @transp_connect(i32 %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca %struct.sockaddr_in
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
store i32 %1, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @transp_connect(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void uninitgame(int sig) {
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<uninitgame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<uninitgame>:
push   %rax
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @uninitgame(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @refresh()
%4 = call i32 (...) @endwin()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @uninitgame(i32 %0) {
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x2a() {
  Assert_real((isxdigit(42) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              215, ("isxdigit should be 0 for *"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for *\00"
define void @t_isxdigit_0x2a() {
%1 = tail call i64 @isxdigit(i32 42)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 215, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pinza(int);
void pinzaPoly() { pinza(40); }


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

x86 assembly (clang, -O2):
<pinzaPoly>:
mov    $0x28,%edi
jmp    1030 <pinza@plt>

LLVM IR (-O0):
define void @pinzaPoly() {
%1 = call i32 @pinza(i32 40)
ret void
}

LLVM IR (-O2):
define void @pinzaPoly() {
%1 = tail call i32 @pinza(i32 40)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ t1_rand();
uint32_t rand_30(void) {
  uint32_t bits_29_15 = ((uint32_t)t1_rand()) << 15;
  uint32_t bits_14_0 = ((uint32_t)t1_rand());
  uint32_t ivalue = bits_29_15 | bits_14_0;
  return ivalue;
}


x86 assembly (clang, -O0):
<rand_30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <t1_rand@plt>
shl    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <t1_rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_30>:
push   %rbx
xor    %eax,%eax
call   1030 <t1_rand@plt>
mov    %rax,%rbx
shl    $0xf,%ebx
xor    %eax,%eax
call   1030 <t1_rand@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_30() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i64 (...) @t1_rand()
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 15
store i32 %6, i32* %1
%7 = call i64 (...) @t1_rand()
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = or i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_30() {
%1 = tail call i64 (...) @t1_rand()
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 15
%4 = tail call i64 (...) @t1_rand()
%5 = trunc i64 %4 to i32
%6 = or i32 %3, %5
ret i32 %6
}
/* Type definitions */
struct pdb_node_t {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pdb_standard_load_node(int /*<<< orphan*/ *, struct pdb_node_t *, char **,
                           int *);
int pdb_load_list_node_cb(FILE *fptr, struct pdb_node_t *pptr, char **tok_arr,
                          int *line) {
  return pdb_standard_load_node(fptr, pptr, tok_arr, line);
}


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

x86 assembly (clang, -O2):
<pdb_load_list_node_cb>:
jmp    1030 <pdb_standard_load_node@plt>

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

LLVM IR (-O2):
%struct.pdb_node_t = type { i32 }
define i32 @pdb_load_list_node_cb(i32* %0, %struct.pdb_node_t* %1, i8** %2, i32* %3) {
%5 = tail call i32 @pdb_standard_load_node(i32* %0, %struct.pdb_node_t* %1, i8** %2, i32* %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
void gator_annotate_marker_color(int color) {
  long long header =
      (0x1c | (0x05 << 8) | 0x00040000 | ((long long)color << 32));
  kannotate_write((char *)&header, sizeof(header));
}


x86 assembly (clang, -O0):
<gator_annotate_marker_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x20,%rax
or     $0x4051c,%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_color>:
push   %rax
shl    $0x20,%rdi
or     $0x4051c,%rdi
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <kannotate_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = shl i64 %5, 32
%7 = or i64 263452, %6
store i64 %7, i64* %3
%8 = bitcast i64* %3 to i8*
%9 = call i32 @kannotate_write(i8* %8, i32 8)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_color(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = zext i32 %0 to i64
%5 = shl nuw i64 %4, 32
%6 = or i64 %5, 263452
store i64 %6, i64* %2
%7 = call i32 @kannotate_write(i8* %3, i32 8)
ret void
}
void X509_REQ_add_extensions(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_add_extensions() {
ret void
}
/* Variables and functions */
double M_PI;
double _constPI(const int numInputs, const double *inputs,
                const double *connectionWeights) {
  return M_PI;
}


x86 assembly (clang, -O0):
<_constPI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_constPI>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @_constPI(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* @M_PI
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @_constPI(i32 %0, double* nocapture readnone %1, double* nocapture readnone %2) {
%4 = load double, double* @M_PI
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float milhas;
  printf("Milhas: \n");
  scanf("%f", &milhas);
  printf("Km: %.2f", 1.61 * milhas);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xea0(%rip),%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Milhas: \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [9 x i8] c"Km: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double 1.610000e+00, %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [9 x i8] c"Km: %.2f\00"
@str = [9 x i8] c"Milhas: \00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.610000e+00
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
int dmp_cm_capture(const char *location) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_cm_capture(i8* nocapture readnone %0) {
ret i32 0
}
void RTTcpServerListen2(void) {}


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

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

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

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