xunge/DecIR huggingface dataset:
/* Variables and functions */
int any_odd_one(int);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  assert(any_odd_one(0x2));
  assert(!any_odd_one(0x4));
  return 0;
}


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)
mov    $0x2,%edi
call   1030 <any_odd_one@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x4,%edi
call   1030 <any_odd_one@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <any_odd_one@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x4,%edi
call   1030 <any_odd_one@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 @any_odd_one(i32 2)
%7 = call i32 @assert(i32 %6)
%8 = call i32 @any_odd_one(i32 4)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @any_odd_one(i32 2)
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @any_odd_one(i32 4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gdb2029();
int main(void) {
  gdb2029();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gdb2029()
ret i32 0
}
int is_absolute(const char *path) {
  if (*path == '/')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1124 <is_absolute+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_absolute+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_absolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_absolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long hdmi_get_pixel_clock(void) {
  WARN("%s: HDMI not compiled in, returning pclk as 0\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<hdmi_get_pixel_clock>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0d(%rip),%rsi
mov    $0x0,%al
call   1030 <WARN@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"%s: HDMI not compiled in, returning pclk as 0\0A\00"
@__func__.hdmi_get_pixel_clock = [21 x i8] c"hdmi_get_pixel_clock\00"
define i64 @hdmi_get_pixel_clock() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.hdmi_get_pixel_clock, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"%s: HDMI not compiled in, returning pclk as 0\0A\00"
@__func__.hdmi_get_pixel_clock = [21 x i8] c"hdmi_get_pixel_clock\00"
define i64 @hdmi_get_pixel_clock() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.hdmi_get_pixel_clock, i64 0, i64 0))
ret i64 0
}
int return_keep() { return 2; }


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

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

LLVM IR (-O0):
define i32 @return_keep() {
ret i32 2
}

LLVM IR (-O2):
define i32 @return_keep() {
ret i32 2
}
double an(int n) {
  int k = n / 2;
  return ((n % 2 || !(k % 2)) ? 0 : -4. / (3.14159265 * n * n));
}


x86 assembly (clang, -O0):
<an>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <an+0x3d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114a <an+0x4a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1175 <an+0x75>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<an>:
xorpd  %xmm0,%xmm0
test   $0x1,%dil
jne    113a <an+0x3a>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
bt     $0x1,%eax
jae    113a <an+0x3a>
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @an(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i32, i32* %3
%11 = srem i32 %10, 2
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9, %1
br label %22
14: ; preds = %9
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to double
%17 = fmul double 0x400921FB53C8D4F1, %16
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = fmul double %17, %19
%21 = fdiv double -4.000000e+00, %20
br label %22
22: ; preds = %14, %13
%23 = phi double [ 0.000000e+00, %13 ], [ %21, %14 ]
ret double %23
}

LLVM IR (-O2):
define double @an(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = sitofp i32 %0 to double
%10 = fmul double %9, 0x400921FB53C8D4F1
%11 = fmul double %10, %9
%12 = fdiv double -4.000000e+00, %11
br label %13
13: ; preds = %1, %4, %8
%14 = phi double [ %12, %8 ], [ 0.000000e+00, %4 ], [ 0.000000e+00, %1 ]
ret double %14
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_standard_Laurentials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(122, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_standard_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x7a,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_standard_Laurentials>:
mov    %rdi,%rsi
mov    $0x7a,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_standard_Laurentials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 122, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_standard_Laurentials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 122, i32* %0, i32* undef, double* undef)
ret i32 %2
}
int is_absolute_path(path) const char *path;
{
  if (path[0] == '/')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_absolute_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1124 <is_absolute_path+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_absolute_path+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_absolute_path>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_absolute_path(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ yyerror(char *);
void error(char *msg) { yyerror(msg); }


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

x86 assembly (clang, -O2):
<error>:
jmp    1030 <yyerror@plt>

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

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @yyerror(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void dynograph_edge_count_traverse_edges(int64_t n) {}


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

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

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

LLVM IR (-O2):
define void @dynograph_edge_count_traverse_edges(i32 %0) {
ret void
}
/* Variables and functions */
int meia_noite(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ puts(int);
void teste_meia_noite() {
  puts(meia_noite(0, 0, 1) == 1);
  puts(meia_noite(0, 1, 1) == 61);
}


x86 assembly (clang, -O0):
<teste_meia_noite>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <meia_noite@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <puts@plt>
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <meia_noite@plt>
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<teste_meia_noite>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <meia_noite@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <puts@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <meia_noite@plt>
xor    %edi,%edi
cmp    $0x3d,%eax
sete   %dil
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
define void @teste_meia_noite() {
%1 = call i32 @meia_noite(i32 0, i32 0, i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @puts(i32 %3)
%5 = call i32 @meia_noite(i32 0, i32 1, i32 1)
%6 = icmp eq i32 %5, 61
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i32 %7)
ret void
}

LLVM IR (-O2):
define void @teste_meia_noite() {
%1 = tail call i32 @meia_noite(i32 0, i32 0, i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @puts(i32 %3)
%5 = tail call i32 @meia_noite(i32 0, i32 1, i32 1)
%6 = icmp eq i32 %5, 61
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i32 %7)
ret void
}
const char *filename(const char *name) {
  static const char this_file[] =
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/bb-clusters/"
      "clang/test/CoverageMapping/builtinmacro.c";
  return this_file;
}


x86 assembly (clang, -O0):
<filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@filename.this_file = internal constant [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/bb-clusters/clang/test/CoverageMapping/builtinmacro.c\00"
define i8* @filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([177 x i8], [177 x i8]* @filename.this_file, i64 0, i64 0)
}

LLVM IR (-O2):
@filename.this_file = internal constant [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/bb-clusters/clang/test/CoverageMapping/builtinmacro.c\00"
define i8* @filename(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([177 x i8], [177 x i8]* @filename.this_file, i64 0, i64 0)
}
long long min(long long x, long long y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void do_mkdir(argc, argv) char **argv;
{
  while (argc-- > 1) {
    if (mkdir(argv[1], 0777) < 0)
      perror(argv[1]);
    argv++;
  }
}


x86 assembly (clang, -O0):
<do_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jle    1180 <do_mkdir+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1ff,%esi
mov    $0x0,%al
call   1030 <mkdir@plt>
cmp    $0x0,%eax
jge    116f <do_mkdir+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <do_mkdir+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mkdir>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     116b <do_mkdir+0x4b>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
jmp    114c <do_mkdir+0x2c>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    116b <do_mkdir+0x4b>
mov    (%rbx),%rdi
mov    $0x1ff,%esi
xor    %eax,%eax
call   1030 <mkdir@plt>
test   %eax,%eax
jns    1140 <do_mkdir+0x20>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1040 <perror@plt>
jmp    1140 <do_mkdir+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do_mkdir(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %20, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp sgt i32 %6, 1
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %12, i32 511)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %18)
br label %20
20: ; preds = %15, %9
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %4
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @do_mkdir(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %17
4: ; preds = %2, %15
%5 = phi i32 [ %7, %15 ], [ %0, %2 ]
%6 = phi i8** [ %8, %15 ], [ %1, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %9, i32 511)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %13)
br label %15
15: ; preds = %12, %4
%16 = icmp ugt i32 %5, 2
br i1 %16, label %4, label %17
17: ; preds = %15, %2
ret void
}
int main() {
  int x = 0;
  int i;
#pragma omp parallel
  {
    if (x) {
      i = 1;
    } else {
      i = 0;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x1,-0xc(%rbp)
jmp    112f <main+0x2f>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ __builtin_vsx_xstsqrtdp_fe(double);
int *test_sqrt_df_2(double a, int *p) {
  if (__builtin_vsx_xstsqrtdp_fe(a))
    *p++ = 1;
  return p;
}


x86 assembly (clang, -O0):
<test_sqrt_df_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_vsx_xstsqrtdp_fe@plt>
cmp    $0x0,%rax
je     114a <test_sqrt_df_2+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sqrt_df_2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__builtin_vsx_xstsqrtdp_fe@plt>
test   %rax,%rax
je     1128 <test_sqrt_df_2+0x18>
movl   $0x1,(%rbx)
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @test_sqrt_df_2(double %0, i32* writeonly %1) {
%3 = tail call i64 @__builtin_vsx_xstsqrtdp_fe(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 1, i32* %1
br label %7
7: ; preds = %5, %2
%8 = phi i32* [ %6, %5 ], [ %1, %2 ]
ret i32* %8
}
/* Variables and functions */
char *getenv(char *);
char *strdup(char *);
char *get_homedir(void) {
  char *homedir = NULL;
  if ((homedir = getenv("HOME")) == NULL) {
    homedir = strdup("/tmp");
  }
  return homedir;
}


x86 assembly (clang, -O0):
<get_homedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    115a <get_homedir+0x3a>
lea    0xeb4(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_homedir>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1134 <get_homedir+0x14>
pop    %rcx
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @get_homedir() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %1
br label %6
6: ; preds = %4, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @get_homedir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ sys_exit(int /*<<< orphan*/);
int sys_read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ sys_write(int, char *, int);
void _start(void) {
  char buf[10];
  int r;
  r = sys_read(0, buf, sizeof buf);
  if (r > 0) {
    sys_write(1, buf, sizeof r);
    sys_write(1, "\n", 1);
  }
  sys_exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rsi
xor    %edi,%edi
mov    $0xa,%edx
call   1050 <sys_read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    117b <_start+0x4b>
lea    -0xa(%rbp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1040 <sys_write@plt>
mov    $0x1,%edx
lea    0xe8c(%rip),%rsi
mov    %edx,%edi
call   1040 <sys_write@plt>
xor    %edi,%edi
call   1030 <sys_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rsi
xor    %edi,%edi
mov    $0xa,%edx
call   1050 <sys_read@plt>
test   %eax,%eax
jle    1173 <_start+0x43>
lea    0xe(%rsp),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
call   1040 <sys_write@plt>
lea    0xe9c(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1040 <sys_write@plt>
xor    %edi,%edi
call   1030 <sys_exit@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @_start() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sys_read(i32 0, i8* %2, i32 10)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @sys_write(i32 1, i8* %2, i32 4)
%7 = call i32 @sys_write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %5, %0
%9 = call i32 @sys_exit(i32 0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t lfs1_min(uint32_t a, uint32_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<lfs1_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <lfs1_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lfs1_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs1_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lfs1_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_imm_A4int8_reg(signed char val) {
  return ((val) & (0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xa4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A4int8_reg>:
test   $0xa4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A4int8_reg(i8 signext %0) {
%2 = and i8 %0, -92
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long long roundUp(unsigned long long v, unsigned long multipleOf) {
  return v - v % multipleOf + multipleOf * (v % multipleOf ? 1 : 0);
}


x86 assembly (clang, -O0):
<roundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x20(%rbp),%rax
sub    %rdx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rdx,%rdi
xor    %edx,%edx
mov    $0x1,%esi
cmp    $0x0,%rdi
cmovne %esi,%edx
movslq %edx,%rdx
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUp>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <roundUp+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <roundUp+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
test   %rdx,%rdx
cmove  %rdx,%rsi
add    %rdi,%rsi
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @roundUp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
%9 = sub i64 %5, %8
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = urem i64 %11, %12
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = sext i32 %16 to i64
%18 = mul i64 %10, %17
%19 = add i64 %9, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @roundUp(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %0, %3
%5 = icmp eq i64 %3, 0
%6 = select i1 %5, i64 0, i64 %1
%7 = add i64 %4, %6
ret i64 %7
}
void prof_start(int pr) {}


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

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

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

LLVM IR (-O2):
define void @prof_start(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf("usage: oggenc -c key files...\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: oggenc -c key files...\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"usage: oggenc -c key files...\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
scalar_t__ __memcmp(unsigned long *, unsigned long *, int);
int _CMP_NEQ(unsigned long a, unsigned long b) {
  return (__memcmp(&a, &b, sizeof(a)) != 0);
}


x86 assembly (clang, -O0):
<_CMP_NEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <__memcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CMP_NEQ>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <__memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @_CMP_NEQ(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @__memcmp(i64* %3, i64* %4, i32 8)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @_CMP_NEQ(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @__memcmp(i64* %3, i64* %4, i32 8)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ swap(char *, char *);
void right_shift_row(char *a) {
  int i;
  for (i = 3; i > 0; i--) {
    swap(a + i, a + i - 1);
  }
}


x86 assembly (clang, -O0):
<right_shift_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115a <right_shift_row+0x4a>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
add    $0xffffffffffffffff,%rsi
call   1030 <swap@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <right_shift_row+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_shift_row>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
add    $0x3,%rdi
lea    0x2(%rbx),%r14
mov    %r14,%rsi
call   1030 <swap@plt>
lea    0x1(%rbx),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <swap@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <swap@plt>

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

LLVM IR (-O2):
define void @right_shift_row(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @swap(i8* %2, i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i32 @swap(i8* %5, i8* %6)
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = tail call i32 @swap(i8* %8, i8* %0)
ret void
}
int main() {
  int arg1 = 5;
  int arg2 = 9;
  int and = 0;
  __asm__("andl %%ebx, %%eax;" : "=a"(and) : "a"(arg1), "b"(arg2));
  return and;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x9,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
and    %ebx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%eax
mov    $0x9,%ebx
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 9, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "andl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "andl %ebx, %eax;", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 5, i32 9)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_time(void) {
  struct timeval tm;
  gettimeofday(&tm, NULL);
  return tm.tv_sec * 1000000 + tm.tv_usec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
long gethostid(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @gethostid() {
ret i64 0
}

LLVM IR (-O2):
define i64 @gethostid() {
ret i64 0
}
/* Type definitions */
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int af_sa_supported_ipv(const struct sockaddr *sa) {
  int ipv;
  ipv = 0;
  switch (sa->sa_family) {
  case AF_INET:
    ipv = 4;
    break;
  case AF_INET6:
    ipv = 6;
    break;
  }
  return (ipv);
}


x86 assembly (clang, -O0):
<af_sa_supported_ipv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1147 <af_sa_supported_ipv+0x47>
jmp    1128 <af_sa_supported_ipv+0x28>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    114e <af_sa_supported_ipv+0x4e>
jmp    113b <af_sa_supported_ipv+0x3b>
movl   $0x4,-0xc(%rbp)
jmp    114e <af_sa_supported_ipv+0x4e>
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<af_sa_supported_ipv>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0x80,%eax
mov    $0x6,%edx
cmovne %ecx,%edx
cmp    $0x81,%eax
mov    $0x4,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @af_sa_supported_ipv(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
%3 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %2
store i32 0, i32* %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %2
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 129, label %7
i32 128, label %8
]
7: ; preds = %1
store i32 4, i32* %3
br label %9
8: ; preds = %1
store i32 6, i32* %3
br label %9
9: ; preds = %1, %8, %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @af_sa_supported_ipv(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 128
%5 = select i1 %4, i32 6, i32 0
%6 = icmp eq i32 %3, 129
%7 = select i1 %6, i32 4, i32 %5
ret i32 %7
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ setInt(void *, int, unsigned int);
void *buildTCP_mode(char mode) {
  void *pkg = calloc(2, sizeof(int));
  setInt(pkg, 0, 30);
  unsigned int iMode;
  switch (mode) {
  case 's':
    iMode = 0;
    break;
  case 'r':
    iMode = 10;
    break;
  }
  setInt(pkg, sizeof(int), iMode);
  return pkg;
}


x86 assembly (clang, -O0):
<buildTCP_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1030 <setInt@plt>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x72,%eax
je     1183 <buildTCP_mode+0x63>
jmp    1166 <buildTCP_mode+0x46>
mov    -0x18(%rbp),%eax
sub    $0x73,%eax
jne    118a <buildTCP_mode+0x6a>
jmp    1177 <buildTCP_mode+0x57>
movl   $0x0,-0x14(%rbp)
jmp    118a <buildTCP_mode+0x6a>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x4,%esi
call   1030 <setInt@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildTCP_mode>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
xor    %r14d,%r14d
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1030 <setInt@plt>
cmp    $0x73,%bpl
mov    $0xa,%edx
cmove  %r14d,%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <setInt@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @buildTCP_mode(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i8 %0, i8* %2
%5 = call i8* @calloc(i32 2, i32 4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @setInt(i8* %6, i32 0, i32 30)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
switch i32 %9, label %12 [
i32 115, label %10
i32 114, label %11
]
10: ; preds = %1
store i32 0, i32* %4
br label %12
11: ; preds = %1
store i32 10, i32* %4
br label %12
12: ; preds = %1, %11, %10
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @setInt(i8* %13, i32 4, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @buildTCP_mode(i8 signext %0) {
%2 = tail call dereferenceable_or_null(8) i8* @calloc(i32 2, i32 4)
%3 = tail call i32 @setInt(i8* %2, i32 0, i32 30)
%4 = icmp eq i8 %0, 115
%5 = select i1 %4, i32 0, i32 10
%6 = tail call i32 @setInt(i8* %2, i32 4, i32 %5)
ret i8* %2
}
int slimproto_configure_socket_sigpipe(int fd) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @slimproto_configure_socket_sigpipe(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_94() {
  Assert_real((isqrt(94) == 9),
              "/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/stdlib/isqrt.c",
              475, ("Integer square root of 94 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_94>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1db,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_94>:
push   %rax
mov    $0x5e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1db,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 94 should be 9\00"
define void @t_sqrt_94() {
%1 = call i32 @isqrt(i32 94)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 94 should be 9\00"
define void @t_sqrt_94() {
%1 = tail call i32 @isqrt(i32 94)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ heapdump();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int heap_walk_main(void) {
  char *buffer;
  heapdump();
  printf("====================================\r\n");
  if ((buffer = (char *)malloc(1)) != NULL) {
    heapdump();
    free(buffer);
  }
  heapdump();
  return 0;
}


x86 assembly (clang, -O0):
<heap_walk_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <heapdump@plt>
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1183 <heap_walk_main+0x43>
mov    $0x0,%al
call   1040 <heapdump@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <heapdump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_walk_main>:
push   %rbx
xor    %eax,%eax
call   1040 <heapdump@plt>
lea    0xeb1(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1175 <heap_walk_main+0x35>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <heapdump@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <heapdump@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"====================================\0D\0A\00"
define i32 @heap_walk_main() {
%1 = alloca i8*
%2 = call i32 (...) @heapdump()
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i32 (...) @heapdump()
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %7, %0
%12 = call i32 (...) @heapdump()
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"====================================\0D\00"
define i32 @heap_walk_main() {
%1 = tail call i32 (...) @heapdump()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 @malloc(i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = inttoptr i64 %3 to i8*
%7 = tail call i32 (...) @heapdump()
%8 = tail call i32 @free(i8* %6)
br label %9
9: ; preds = %5, %0
%10 = tail call i32 (...) @heapdump()
ret i32 0
}
int __attribute__((target("default"))) foo(int i) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 2
}
void lava_ball(struct battle_char *origin, struct battle_char *target) {}


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

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

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

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @lava_ball(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ sin(double);
scalar_t__ sinf(float);
double math(float f, double d, long double ld) {
  double r = 0;
  r += sinf(f);
  r += sin(d);
  return r;
}


x86 assembly (clang, -O0):
<math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <sinf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @math(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = alloca double
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
store double 0.000000e+00, double* %7
%8 = load float, float* %4
%9 = call i64 @sinf(float %8)
%10 = sitofp i64 %9 to double
%11 = load double, double* %7
%12 = fadd double %11, %10
store double %12, double* %7
%13 = load double, double* %5
%14 = call i64 @sin(double %13)
%15 = sitofp i64 %14 to double
%16 = load double, double* %7
%17 = fadd double %16, %15
store double %17, double* %7
%18 = load double, double* %7
ret double %18
}

LLVM IR (-O2):
define double @math(float %0, double %1, x86_fp80 %2) {
%4 = tail call i64 @sinf(float %0)
%5 = sitofp i64 %4 to double
%6 = tail call i64 @sin(double %1)
%7 = sitofp i64 %6 to double
%8 = fadd double %5, %7
ret double %8
}