xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x3c() {
  Assert_real((isspace(60) == 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_isspace.c",
              305, ("isspace should be 0 for <"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x3c>:
push   %rax
mov    $0x3c,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x131,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for <\00"
define void @t_isspace_0x3c() {
%1 = call i64 @isspace(i32 60)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for <\00"
define void @t_isspace_0x3c() {
%1 = tail call i64 @isspace(i32 60)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 305, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float freqbin2freq(float fs, int fft_len, int freqbin) {
  float delta_f;
  float f;
  delta_f = fs / fft_len;
  f = freqbin * delta_f;
  return f;
}


x86 assembly (clang, -O0):
<freqbin2freq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<freqbin2freq>:
cvtsi2ss %edi,%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %esi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @freqbin2freq(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load float, float* %4
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fdiv float %9, %11
store float %12, float* %7
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = load float, float* %7
%16 = fmul float %14, %15
store float %16, float* %8
%17 = load float, float* %8
ret float %17
}

LLVM IR (-O2):
define float @freqbin2freq(float %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to float
%5 = fdiv float %0, %4
%6 = sitofp i32 %2 to float
%7 = fmul float %5, %6
ret float %7
}
void __attribute__((no)) __attribute__((visibility("default")))
rtld_db_dlactivity(void) {}


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

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

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

LLVM IR (-O2):
define void @rtld_db_dlactivity() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _pspsdk_alloc_deinit();
int /*<<< orphan*/ _pspsdk_stdio_deinit();
int /*<<< orphan*/ _pspsdk_stdlib_deinit();
__attribute__((weak, destructor)) void _pspsdk_libc_deinit() {
  _pspsdk_stdlib_deinit();
  _pspsdk_stdio_deinit();
  _pspsdk_alloc_deinit();
}


x86 assembly (clang, -O0):
<_pspsdk_libc_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_pspsdk_stdlib_deinit@plt>
mov    $0x0,%al
call   1050 <_pspsdk_stdio_deinit@plt>
mov    $0x0,%al
call   1040 <_pspsdk_alloc_deinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pspsdk_libc_deinit>:
push   %rax
xor    %eax,%eax
call   1030 <_pspsdk_stdlib_deinit@plt>
xor    %eax,%eax
call   1050 <_pspsdk_stdio_deinit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_pspsdk_alloc_deinit@plt>

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_pspsdk_libc_deinit, i8* null }]
define weak void @_pspsdk_libc_deinit() {
%1 = call i32 (...) @_pspsdk_stdlib_deinit()
%2 = call i32 (...) @_pspsdk_stdio_deinit()
%3 = call i32 (...) @_pspsdk_alloc_deinit()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_pspsdk_libc_deinit, i8* null }]
define weak void @_pspsdk_libc_deinit() {
%1 = tail call i32 (...) @_pspsdk_stdlib_deinit()
%2 = tail call i32 (...) @_pspsdk_stdio_deinit()
%3 = tail call i32 (...) @_pspsdk_alloc_deinit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b_ls(char *);
void b_dir(char *dir) { b_ls(dir); }


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

x86 assembly (clang, -O2):
<b_dir>:
jmp    1030 <b_ls@plt>

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

LLVM IR (-O2):
define void @b_dir(i8* %0) {
%2 = tail call i32 @b_ls(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UNREFERENCED_PARAMETER(void *);
void ILibWebClient_TimerInterruptSink(void *object) {
  UNREFERENCED_PARAMETER(object);
}


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

x86 assembly (clang, -O2):
<ILibWebClient_TimerInterruptSink>:
jmp    1030 <UNREFERENCED_PARAMETER@plt>

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

LLVM IR (-O2):
define void @ILibWebClient_TimerInterruptSink(i8* %0) {
%2 = tail call i32 @UNREFERENCED_PARAMETER(i8* %0)
ret void
}
void U444ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @U444ToABGR() {
ret void
}
const char *path_default_slash() { return "/"; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @path_default_slash() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ my_init();
__attribute__((__constructor__)) void actual_init() { my_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_init, i8* null }]
define void @actual_init() {
%1 = call i32 (...) @my_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @actual_init, i8* null }]
define void @actual_init() {
%1 = tail call i32 (...) @my_init()
ret void
}
void ARGBBlendRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBBlendRow_NEON() {
ret void
}
float fa_fast_invsqrtf(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<fa_fast_invsqrtf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_fast_invsqrtf>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fa_fast_invsqrtf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @fa_fast_invsqrtf(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
char *mklower(str)
char *str;
{
  char *sp;
  sp = str;
  while (*sp) {
    if ('A' <= *sp && *sp <= 'Z')
      *sp += 'a' - 'A';
    ++sp;
  }
  return (str);
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <mklower+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <mklower+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <mklower+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mklower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <mklower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <mklower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <mklower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <mklower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <mklower+0x10>
ret

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

LLVM IR (-O2):
define i8* @mklower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
double glmComputeVectorLength4dPow2(const float v[4]) {
  return v[0] * v[0] + v[1] * v[1] + v[2] * v[2] + v[3] * v[3];
}


x86 assembly (clang, -O0):
<glmComputeVectorLength4dPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorLength4dPow2>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  0x8(%rdi),%xmm1
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0xc(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @glmComputeVectorLength4dPow2(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = load float*, float** %2
%25 = getelementptr inbounds float, float* %24, i64 3
%26 = load float, float* %25
%27 = load float*, float** %2
%28 = getelementptr inbounds float, float* %27, i64 3
%29 = load float, float* %28
%30 = call float @llvm.fmuladd.f32(float %26, float %29, float %23)
%31 = fpext float %30 to double
ret double %31
}

LLVM IR (-O2):
define double @glmComputeVectorLength4dPow2(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = tail call float @llvm.fmuladd.f32(float %11, float %11, float %9)
%13 = fpext float %12 to double
ret double %13
}
void drawAIStatus(void) {}


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

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

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

LLVM IR (-O2):
define void @drawAIStatus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  static const char *val = "Hello";
  strcpy((char *)val, "Jel");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2f02(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.val = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"Hello\00"
@.str.1 = [4 x i8] c"Jel\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8*, i8** @main.val
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [4 x i8] c"Jel\00"
define i32 @main() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void script_finish_for_python(void) {}


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

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

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

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

/* Variables and functions */
char *checking_malloc(int);
int full_path_length(struct url const *);
int /*<<< orphan*/ full_path_write(struct url const *, char *);
char *url_full_path(const struct url *url) {
  int length = full_path_length(url);
  char *full_path = checking_malloc(length + 1);
  full_path_write(url, full_path);
  full_path[length] = '\0';
  return full_path;
}


x86 assembly (clang, -O0):
<url_full_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <full_path_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <checking_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <full_path_write@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_full_path>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <full_path_length@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1040 <checking_malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <full_path_write@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.url = type { i32 }
define i8* @url_full_path(%struct.url* %0) {
%2 = alloca %struct.url*
%3 = alloca i32
%4 = alloca i8*
store %struct.url* %0, %struct.url** %2
%5 = load %struct.url*, %struct.url** %2
%6 = call i32 @full_path_length(%struct.url* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @checking_malloc(i32 %8)
store i8* %9, i8** %4
%10 = load %struct.url*, %struct.url** %2
%11 = load i8*, i8** %4
%12 = call i32 @full_path_write(%struct.url* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
%struct.url = type { i32 }
define i8* @url_full_path(%struct.url* %0) {
%2 = tail call i32 @full_path_length(%struct.url* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @checking_malloc(i32 %3)
%5 = tail call i32 @full_path_write(%struct.url* %0, i8* %4)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int get_eflags();
int /*<<< orphan*/ set_eflags(int);
int compare_and_swap_is_available(void) {
  int oldflags = get_eflags();
  int changed;
  set_eflags(oldflags ^ 0x40000);
  changed = (get_eflags() ^ oldflags) & 0x40000;
  set_eflags(oldflags);
  return changed != 0;
}


x86 assembly (clang, -O0):
<compare_and_swap_is_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_eflags@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    $0x40000,%edi
call   1030 <set_eflags@plt>
mov    $0x0,%al
call   1040 <get_eflags@plt>
xor    -0x4(%rbp),%eax
and    $0x40000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_eflags@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap_is_available>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get_eflags@plt>
mov    %eax,%ebx
mov    %eax,%edi
xor    $0x40000,%edi
call   1030 <set_eflags@plt>
xor    %eax,%eax
call   1040 <get_eflags@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
mov    %ebx,%edi
call   1030 <set_eflags@plt>
shr    $0x12,%ebp
and    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compare_and_swap_is_available() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_eflags()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = xor i32 %4, 262144
%6 = call i32 @set_eflags(i32 %5)
%7 = call i32 (...) @get_eflags()
%8 = load i32, i32* %1
%9 = xor i32 %7, %8
%10 = and i32 %9, 262144
store i32 %10, i32* %2
%11 = load i32, i32* %1
%12 = call i32 @set_eflags(i32 %11)
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_and_swap_is_available() {
%1 = tail call i32 (...) @get_eflags()
%2 = xor i32 %1, 262144
%3 = tail call i32 @set_eflags(i32 %2)
%4 = tail call i32 (...) @get_eflags()
%5 = xor i32 %4, %1
%6 = tail call i32 @set_eflags(i32 %1)
%7 = lshr i32 %5, 18
%8 = and i32 %7, 1
ret i32 %8
}
int test_imm_D6int16_mem(short *val) {
  return ((*val) & (0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xd6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int16_mem>:
testb  $0xd6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 214
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int func1(int *f) {}


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

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

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

LLVM IR (-O2):
define i32 @func1(i32* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int cpu_filter_cb(const char *name) {
  if (!strcmp(name, "cpuidle"))
    return 1;
  if (!strcmp(name, "cpufreq"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cpu_filter_cb>:
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,%eax
jne    1141 <cpu_filter_cb+0x31>
movl   $0x1,-0x4(%rbp)
jmp    116d <cpu_filter_cb+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1166 <cpu_filter_cb+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <cpu_filter_cb+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_filter_cb>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113e <cpu_filter_cb+0x2e>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"cpuidle\00"
@.str.1 = [8 x i8] c"cpufreq\00"
define i32 @cpu_filter_cb(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
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 = [8 x i8] c"cpuidle\00"
@.str.1 = [8 x i8] c"cpufreq\00"
define i32 @cpu_filter_cb(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %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
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void emit(const char *s) { printf("\t%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\09%s\00"
define void @emit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_131_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = *D | stk4;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_131_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_131_1_0>:
mov    %esi,%r8d
not    %r8b
mov    (%rdi),%al
mov    %eax,%ecx
or     %r8b,%cl
and    %dl,%cl
xor    %sil,%cl
not    %cl
and    %sil,%al
and    %r8b,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_131_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %10
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %9
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %5
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_131_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = and i8 %6, %2
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = and i8 %9, %4
%12 = or i8 %11, %10
store i8 %12, i8* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
unsigned int pop_count(uint32_t mask) {
  unsigned int count;
  for (count = 0; mask; ++count)
    mask &= (mask - 1);
  return count;
}


x86 assembly (clang, -O0):
<pop_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <pop_count+0x38>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <pop_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_count>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <pop_count+0x1c>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rcx
add    $0x1,%eax
and    %rcx,%rdi
jne    1110 <pop_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @pop_count(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = and i64 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
void wait_for_interrupts(void) { __asm__ __volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @wait_for_interrupts() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ execve(char const *, char *const *, char *const *);
int /*<<< orphan*/ unix_error(char *);
void csapp_execve(const char *filename, char *const argv[],
                  char *const envp[]) {
  if (execve(filename, argv, envp) < 0)
    unix_error("execve error");
}


x86 assembly (clang, -O0):
<csapp_execve>:
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 <execve@plt>
cmp    $0x0,%rax
jge    115b <csapp_execve+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_execve>:
push   %rax
call   1030 <execve@plt>
test   %rax,%rax
js     112d <csapp_execve+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"execve error\00"
define void @csapp_execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i64 @execve(i8* %0, i8** %1, i8** %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
long long szsz() { return 0xffff0000ffff0000LL; }


x86 assembly (clang, -O0):
<szsz>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff0000ffff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szsz>:
movabs $0xffff0000ffff0000,%rax
ret

LLVM IR (-O0):
define i64 @szsz() {
ret i64 -281470681808896
}

LLVM IR (-O2):
define i64 @szsz() {
ret i64 -281470681808896
}
/* Variables and functions */
int mus_seek(int, long, int);
int seek_sound(int tfd, long offset, int origin) {
  return (mus_seek(tfd, offset, origin));
}


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

x86 assembly (clang, -O2):
<seek_sound>:
jmp    1030 <mus_seek@plt>

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

LLVM IR (-O2):
define i32 @seek_sound(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @mus_seek(i32 %0, i64 %1, i32 %2)
ret i32 %4
}
void av_get_channel_layout_nb_channels() {}


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

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

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

LLVM IR (-O2):
define void @av_get_channel_layout_nb_channels() {
ret void
}
/* Variables and functions */
unsigned int validateGraph(char **, char *);
unsigned int validateRegex(char *first, char *last) {
  return validateGraph(&first, last);
}


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

x86 assembly (clang, -O2):
<validateRegex>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <validateGraph@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @validateRegex(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @validateGraph(i8** %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("./stealer --stealer=n --punish-time=n\n");
  printf("See README for more prarameters\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"./stealer --stealer=n --punish-time=n\0A\00"
@.str.1 = [33 x i8] c"See README for more prarameters\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"./stealer --stealer=n --punish-time=n\00"
@str.2 = [32 x i8] c"See README for more prarameters\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret void
}
void AD_PowerDown() {}


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

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

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

LLVM IR (-O2):
define void @AD_PowerDown() {
ret void
}
/* Variables and functions */
float modf_c(float, int *);
float modf_neon_sfp(float x, int *i) { return modf_c(x, i); }


x86 assembly (clang, -O0):
<modf_neon_sfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <modf_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modf_neon_sfp>:
jmp    1030 <modf_c@plt>

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

LLVM IR (-O2):
define float @modf_neon_sfp(float %0, i32* %1) {
%3 = tail call float @modf_c(float %0, i32* %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ getLine(char *, int);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int getInteger() {
  char str[7];
  int result = 0;
  getLine(str, 7);
  sscanf(str, "%d", &result);
  return result;
}


x86 assembly (clang, -O0):
<getInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    -0x7(%rbp),%rdi
mov    $0x7,%esi
call   1040 <getLine@plt>
lea    -0x7(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInteger>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
lea    0x9(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <getLine@plt>
lea    0xeba(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getInteger() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @getLine(i8* %3, i32 7)
%6 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
ret i32 %7
}
/* Type definitions */
struct trace_tree {
  int dummy;
};

/* Variables and functions */
struct trace_tree *trace_tree_E();
struct trace_tree *trace_tree(void) {
  return trace_tree_E();
}


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

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

LLVM IR (-O0):
%struct.trace_tree = type { i32 }
define %struct.trace_tree* @trace_tree() {
%1 = call %struct.trace_tree* (...) @trace_tree_E()
ret %struct.trace_tree* %1
}

LLVM IR (-O2):
%struct.trace_tree = type { i32 }
define %struct.trace_tree* @trace_tree() {
%1 = tail call %struct.trace_tree* (...) @trace_tree_E()
ret %struct.trace_tree* %1
}
float l2f(long long a) { return (long long)a; }


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

x86 assembly (clang, -O2):
<l2f>:
cvtsi2ss %rdi,%xmm0
ret

LLVM IR (-O0):
define float @l2f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @l2f(i64 %0) {
%2 = sitofp i64 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ write_ZIGBEE_short(int, int);
void BB_reset() { write_ZIGBEE_short(0x2A, 0x02); }


x86 assembly (clang, -O0):
<BB_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x2,%esi
call   1030 <write_ZIGBEE_short@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BB_reset>:
mov    $0x2a,%edi
mov    $0x2,%esi
jmp    1030 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @BB_reset() {
%1 = call i32 @write_ZIGBEE_short(i32 42, i32 2)
ret void
}

LLVM IR (-O2):
define void @BB_reset() {
%1 = tail call i32 @write_ZIGBEE_short(i32 42, i32 2)
ret void
}
void gdk_window_invalidate_rect() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_invalidate_rect() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int isNewWord(char *text, size_t pos) {
  if (isspace(text[pos]) && !isspace(text[pos + 1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isNewWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1163 <isNewWord+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl 0x1(%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    1163 <isNewWord+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <isNewWord+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNewWord>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl (%rdi,%rsi,1),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1138 <isNewWord+0x28>
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113c <isNewWord+0x2c>
xor    %eax,%eax
jmp    1141 <isNewWord+0x31>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @isNewWord(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = add i64 %1, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i64 @isspace(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %7, %2
br label %14
14: ; preds = %7, %13
%15 = phi i32 [ 0, %13 ], [ 1, %7 ]
ret i32 %15
}
void nested_parallel_0(void) {
#pragma omp parallel
  {
#pragma omp parallel
    {}
  }
}


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

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

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

LLVM IR (-O2):
define void @nested_parallel_0() {
ret void
}
unsigned int read_UInt32Number(char *p) {
  unsigned int rv;
  rv = 16777216 * (unsigned int)((unsigned char *)p)[0] +
       65536 * (unsigned int)((unsigned char *)p)[1] +
       256 * (unsigned int)((unsigned char *)p)[2] +
       (unsigned int)((unsigned char *)p)[3];
  return rv;
}


x86 assembly (clang, -O0):
<read_UInt32Number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_UInt32Number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = mul i32 16777216, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = mul i32 65536, %12
%14 = add i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = mul i32 256, %18
%20 = add i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_UInt32Number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}