xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) unsigned __int128 t164_5sub(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (unsigned __int128)(14), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t164_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
sub    $0xe,%rdx
sbb    $0x0,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t164_5sub+0x48>
jmp    115f <t164_5sub+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t164_5sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
sub    $0xe,%rbx
sbb    $0x0,%r14
jae    112b <t164_5sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t164_5sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %11, i128 14)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t164_5sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %6, i128 14)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int checkfile(char *filename) {
  int result = 0;
  int fh = 0;
  fh = open(filename, O_RDONLY);
  if (fh != -1) {
    result = 1;
    close(fh);
  }
  return result;
}


x86 assembly (clang, -O0):
<checkfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     1168 <checkfile+0x48>
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfile>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1142 <checkfile+0x22>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @checkfile(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
int test_imm_00uint8_reg(unsigned char val) {
  return ((val) & (-0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 0
%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_00uint8_reg(i8 zeroext %0) {
ret i32 -40
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *str;
  if ((str = (char *)malloc(sizeof(char) * 10)) == NULL) {
    abort();
  } else {
    free(str);
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115e <main+0x2e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     114c <main+0x1c>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
%7 = tail call i32 @free(i8* %6)
ret i32 0
}
int emax(int vv, int v3, int v4) {
  int tmp;
  tmp = ((vv) > (v3) ? (vv) : (v3));
  tmp = ((tmp) > (v4) ? (tmp) : (v4));
  return tmp;
}


x86 assembly (clang, -O0):
<emax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <emax+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <emax+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <emax+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <emax+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<emax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @emax(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %7
br label %24
22: ; preds = %15
%23 = load i32, i32* %6
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %7
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @emax(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
int doubleSize() {
  double doubArray[10];
  double *doubPtr1;
  double *doubPtr2;
  doubPtr1 = doubArray;
  doubPtr2 = doubPtr1 + 1;
  return (char *)doubPtr2 - (char *)doubPtr1;
}


x86 assembly (clang, -O0):
<doubleSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @doubleSize() {
%1 = alloca [10 x double]
%2 = alloca double*
%3 = alloca double*
%4 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
store double* %4, double** %2
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double* %6, double** %3
%7 = load double*, double** %3
%8 = bitcast double* %7 to i8*
%9 = load double*, double** %2
%10 = bitcast double* %9 to i8*
%11 = ptrtoint i8* %8 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @doubleSize() {
ret i32 8
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_prim2_exp(unsigned int, struct Cyc_Absyn_Exp *,
                                          struct Cyc_Absyn_Exp *, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_add_exp(struct Cyc_Absyn_Exp *e1,
                                        struct Cyc_Absyn_Exp *e2,
                                        unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_prim2_exp(0U, e1, e2, loc);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_add_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
call   1030 <Cyc_Absyn_prim2_exp@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_add_exp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <Cyc_Absyn_prim2_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_add_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
%7 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
store i32 %2, i32* %6
%8 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%10 = load i32, i32* %6
%11 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 0, %struct.Cyc_Absyn_Exp* %8, %struct.Cyc_Absyn_Exp* %9, i32 %10)
store %struct.Cyc_Absyn_Exp* %11, %struct.Cyc_Absyn_Exp** %7
%12 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %7
ret %struct.Cyc_Absyn_Exp* %12
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_add_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 0, %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2)
ret %struct.Cyc_Absyn_Exp* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void free_demo(char *p) {
  fprintf(stderr, "Destructing string '%s'\n", p);
  free(p);
}


x86 assembly (clang, -O0):
<free_demo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_demo>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Destructing string '%s'\0A\00"
define void @free_demo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Destructing string '%s'\0A\00"
define void @free_demo(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @free(i8* %0)
ret void
}
void cellgen_total_stop(int loop __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @cellgen_total_stop(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_task() { write("msproject.xml", "<Task>\n", NULL); }


x86 assembly (clang, -O0):
<pre_task>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_task>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [8 x i8] c"<Task>\0A\00"
define void @pre_task() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [8 x i8] c"<Task>\0A\00"
define void @pre_task() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void main() {
  int i = 0;
  while (i < 4) {
    int j = 0;
    while (j < 4) {
      i = i + 1;
      j = j + 1;
    }
    i = i - j + 1;
    assert(i <= j + 3);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    117a <main+0x6a>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1151 <main+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <main+0x20>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %26
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %10, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %7
15: ; preds = %7
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 3
%23 = icmp sle i32 %20, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
br label %3
26: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret void
}
int main(void) {
  int a = 1;
  a <<= 31;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello word !\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello word !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello word !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double f4_cb_send_two_double(double (*cb)(double, double)) {
  double r1 = 66.0;
  double r2 = 66.0;
  return cb(r1, r2) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_two_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_two_double>:
push   %rax
movsd  0xef7(%rip),%xmm0
movapd %xmm0,%xmm1
call   *%rdi
addsd  0xef1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_two_double(double (double, double)* %0) {
%2 = alloca double (double, double)*
%3 = alloca double
%4 = alloca double
store double (double, double)* %0, double (double, double)** %2
store double 6.600000e+01, double* %3
store double 6.600000e+01, double* %4
%5 = load double (double, double)*, double (double, double)** %2
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double %5(double %6, double %7)
%9 = fadd double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @f4_cb_send_two_double(double (double, double)* nocapture %0) {
%2 = tail call double %0(double 6.600000e+01, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
__attribute__((__naked__)) void SGVObjcMsgSendSuperStretTrampolineSwift(void) {
  asm volatile("addq $"
               "16"
               ", "
               "%%rsi"
               "\n\t"
               "jmp "
               "_objc_msgSendSuper_stret"
               "\n\t"
               :
               :
               : "rsi", "rdi");
}


x86 assembly (clang, -O0):
<SGVObjcMsgSendSuperStretTrampolineSwift>:
add    $0x10,%rsi
jmp    1030 <_objc_msgSendSuper_stret@plt>

x86 assembly (clang, -O2):
<SGVObjcMsgSendSuperStretTrampolineSwift>:
add    $0x10,%rsi
jmp    1030 <_objc_msgSendSuper_stret@plt>

LLVM IR (-O0):
define void @SGVObjcMsgSendSuperStretTrampolineSwift() {
unreachable
}

LLVM IR (-O2):
define void @SGVObjcMsgSendSuperStretTrampolineSwift() {
tail call void asm sideeffect "addq $$16, %rsi\0A\09jmp _objc_msgSendSuper_stret\0A\09", "~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void printError(char *fname) {
  char *s = malloc((sizeof("mkdir: cannot create directory ") - 1) +
                   strlen(fname) + 1);
  strcpy(s, "mkdir: cannot create directory ");
  strcat(s, fname);
  perror(s);
  free(s);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1f,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1070 <perror@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x20(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe81(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1070 <perror@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"mkdir: cannot create directory \00"
define void @printError(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 31, %5
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @perror(i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"mkdir: cannot create directory \00"
define void @printError(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 32
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %4, i8* %0)
%7 = tail call i32 @perror(i8* %4)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(char);
void to_upper(char *s) {
  while (*s) {
    toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <to_upper+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <to_upper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <to_upper+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <to_upper+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @to_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @toupper(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar_dbg(char);
int main(void) {
  putchar_dbg('H');
  putchar_dbg('i');
  putchar_dbg('\n');
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar_dbg(i8 signext 72)
%3 = call i32 @putchar_dbg(i8 signext 105)
%4 = call i32 @putchar_dbg(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar_dbg(i8 signext 72)
%2 = tail call i32 @putchar_dbg(i8 signext 105)
%3 = tail call i32 @putchar_dbg(i8 signext 10)
ret i32 0
}
/* Variables and functions */
char toupper(char);
void to_upp(char *stra) {
  while (*stra) {
    *stra = toupper(*stra);
    stra++;
  }
}


x86 assembly (clang, -O0):
<to_upp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <to_upp+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <to_upp+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upp>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <to_upp+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <to_upp+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @to_upp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
unsigned long __raw_local_save_flags(void) {
  unsigned long flags;
  __asm__ __volatile__("# __raw_save_flags\n\t"
                       "pushfq ; popq %q0"
                       : "=g"(flags)
                       :
                       : "memory");
  return flags;
}


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

x86 assembly (clang, -O2):
<__raw_local_save_flags>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__raw_local_save_flags() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @__raw_local_save_flags() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
void __attribute__((no)) HEX00_mathDatInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_mathDatInit() {
ret void
}
OP(dd, e7) {
  illegal_1();
  op_e7();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_e7@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_e7()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e7()
ret i32 undef
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
scalar_t__ calc_tree(struct tree *);
double op_not(struct tree *left, struct tree *right) {
  return calc_tree(left) != calc_tree(right);
}


x86 assembly (clang, -O0):
<op_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_not>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <calc_tree@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <calc_tree@plt>
cmp    %rax,%rbx
jne    1131 <op_not+0x21>
xorps  %xmm0,%xmm0
jmp    1139 <op_not+0x29>
movsd  0xec7(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_not(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call i64 @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call i64 @calc_tree(%struct.tree* %7)
%9 = icmp ne i64 %6, %8
%10 = zext i1 %9 to i32
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_not(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call i64 @calc_tree(%struct.tree* %0)
%4 = tail call i64 @calc_tree(%struct.tree* %1)
%5 = icmp ne i64 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
void av_bprint_get_buffer() {}


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

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

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

LLVM IR (-O2):
define void @av_bprint_get_buffer() {
ret void
}
float Plus(float a, float b) { return (a + b); }


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

x86 assembly (clang, -O2):
<Plus>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Plus(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
int glutGetWindow(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @glutGetWindow() {
ret i32 0
}

LLVM IR (-O2):
define i32 @glutGetWindow() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ htsstr_format0(char const *, char *, char const **);
char *malloc(int /*<<< orphan*/);
char *htsstr_format(const char *str, const char **map) {
  char *s;
  s = malloc(htsstr_format0(str, NULL, map));
  htsstr_format0(str, s, map);
  return s;
}


x86 assembly (clang, -O0):
<htsstr_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <htsstr_format0@plt>
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <htsstr_format0@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htsstr_format>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <htsstr_format0@plt>
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <htsstr_format0@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @htsstr_format(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8**, i8*** %4
%8 = call i32 @htsstr_format0(i8* %6, i8* null, i8** %7)
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
%13 = call i32 @htsstr_format0(i8* %10, i8* %11, i8** %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @htsstr_format(i8* %0, i8** %1) {
%3 = tail call i32 @htsstr_format0(i8* %0, i8* null, i8** %1)
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @htsstr_format0(i8* %0, i8* %4, i8** %1)
ret i8* %4
}
void myhandler(int signo __attribute__((unused))) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PUTSHORT(int /*<<< orphan*/, int /*<<< orphan*/ *);
void __putshort(u_int16_t s, u_char *msgp) { PUTSHORT(s, msgp); }


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

x86 assembly (clang, -O2):
<__putshort>:
jmp    1030 <PUTSHORT@plt>

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

LLVM IR (-O2):
define void @__putshort(i32 %0, i32* %1) {
%3 = tail call i32 @PUTSHORT(i32 %0, i32* %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long your_event_mask;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_your_event_mask(void *_p, long _v) {
  ((XWindowAttributes *)_p)->your_event_mask = (long)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_your_event_mask>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XWindowAttributes_your_event_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_your_event_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
bool Function1Bool(bool x) { return !x; }


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

x86 assembly (clang, -O2):
<Function1Bool>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @Function1Bool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ intArr;

/* Variables and functions */
int /*<<< orphan*/ pass_array(int *);
int /*<<< orphan*/ printf(char *, int);
void array() {
  int intArr[10];
  int size = sizeof(intArr);
  int length = size / sizeof(int);
  printf("stack size = %d \n", size);
  printf("length = %d \n", length);
  pass_array(intArr);
}


x86 assembly (clang, -O0):
<array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x28,-0x34(%rbp)
movslq -0x34(%rbp),%rax
shr    $0x2,%rax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <pass_array@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <pass_array@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"stack size = %d \0A\00"
@.str.1 = [14 x i8] c"length = %d \0A\00"
define void @array() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 40, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = udiv i64 %5, 4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%13 = call i32 @pass_array(i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"stack size = %d \0A\00"
@.str.1 = [14 x i8] c"length = %d \0A\00"
define void @array() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 40)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @pass_array(i32* %5)
ret void
}
/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
double Seconds() { return clock() * 1.0 / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<Seconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2eba(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seconds>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @Seconds() {
%1 = call double (...) @clock()
%2 = fmul double %1, 1.000000e+00
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @Seconds() {
%1 = tail call double (...) @clock()
%2 = load double, double* @CLOCKS_PER_SEC
%3 = fdiv double %1, %2
ret double %3
}
__attribute__((noipa)) unsigned long f3(unsigned int a, unsigned int b) {
  unsigned int i = __builtin_add_overflow(a, b, &a);
  return a + i;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
setb   %al
mov    %ecx,-0x4(%rbp)
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
add    %esi,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i64 @f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %6, i32 %7)
%9 = extractvalue { i32, i1 } %8, 1
%10 = extractvalue { i32, i1 } %8, 0
store i32 %10, i32* %3
%11 = zext i1 %9 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = add i32 %12, %13
%15 = zext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @f3(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 1
%5 = extractvalue { i32, i1 } %3, 0
%6 = zext i1 %4 to i32
%7 = add i32 %5, %6
%8 = zext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int funcao2(void) {
  printf("ok");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
define i32 @funcao2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define i32 @funcao2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int db_retrieval(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ free(char *);
char *sql_generate(char const *, char const *, long const);
int db_active_status(sqlite3 *db, const char *board_id, const long id) {
  static const char *sql = "SELECT COUNT(*) FROM active_threads "
                           "WHERE board_id = \"%s\" AND post_id = %ld;";
  char *cmd = sql_generate(sql, board_id, id);
  int exists = db_retrieval(db, cmd);
  free(cmd);
  return exists;
}


x86 assembly (clang, -O0):
<db_active_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eed(%rip),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <sql_generate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <db_retrieval@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_active_status>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1040 <sql_generate@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <db_retrieval@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@db_active_status.sql = internal global i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i32 0, i32 0)
@.str = [77 x i8] c"SELECT COUNT(*) FROM active_threads WHERE board_id = \22%s\22 AND post_id = %ld;\00"
define i32 @db_active_status(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** @db_active_status.sql
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @sql_generate(i8* %9, i8* %10, i64 %11)
store i8* %12, i8** %7
%13 = load i32*, i32** %4
%14 = load i8*, i8** %7
%15 = call i32 @db_retrieval(i32* %13, i8* %14)
store i32 %15, i32* %8
%16 = load i8*, i8** %7
%17 = call i32 @free(i8* %16)
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
@.str = [77 x i8] c"SELECT COUNT(*) FROM active_threads WHERE board_id = \22%s\22 AND post_id = %ld;\00"
define i32 @db_active_status(i32* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sql_generate(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2)
%5 = tail call i32 @db_retrieval(i32* %0, i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kattach_sysexec(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void kattach_net_linkdown(char *devname) {
  char lcmd[255];
  sprintf(lcmd, "%s%s link set %s down", "/kaos/core/busybox/bin/", "ip",
          devname);
  kattach_sysexec(lcmd);
  return;
}


x86 assembly (clang, -O0):
<kattach_net_linkdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
lea    0xebf(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xedf(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <kattach_sysexec@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_net_linkdown>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rsi
lea    0xedd(%rip),%rdx
lea    0xeee(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <kattach_sysexec@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s%s link set %s down\00"
@.str.1 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @kattach_net_linkdown(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @kattach_sysexec(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s%s link set %s down\00"
@.str.1 = [24 x i8] c"/kaos/core/busybox/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @kattach_net_linkdown(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = call i32 @kattach_sysexec(i8* %3)
ret void
}