xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int x = 15;
  int y = x;
  int *a, *b, *c;
  a = (int *)malloc(sizeof(int));
  free(c);
  b = a;
  *b = x;
  a = c;
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
call   1030 <free@plt>
movl   $0xf,(%rbx)
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 15, i32* %6
%11 = load i32, i32* %6
store i32 %11, i32* %7
%12 = call i64 @malloc(i32 4)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %8
%14 = load i32*, i32** %10
%15 = call i32 @free(i32* %14)
%16 = load i32*, i32** %8
store i32* %16, i32** %9
%17 = load i32, i32* %6
%18 = load i32*, i32** %9
store i32 %17, i32* %18
%19 = load i32*, i32** %10
store i32* %19, i32** %8
%20 = load i32*, i32** %8
%21 = call i32 @free(i32* %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @free(i32* undef)
store i32 15, i32* %4
%6 = tail call i32 @free(i32* undef)
ret i32 0
}
void playMelody() {}


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

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

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

LLVM IR (-O2):
define void @playMelody() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_abs_flt(float *, float);
float xil_fpo_abs_flt(float a) {
  float res_flt;
  xip_fpo_abs_flt(&res_flt, a);
  return res_flt;
}


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

x86 assembly (clang, -O2):
<xil_fpo_abs_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_abs_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_abs_flt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @xip_fpo_abs_flt(float* %3, float %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_abs_flt(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_abs_flt(float* %2, float %0)
%5 = load float, float* %2
ret float %5
}
/* Variables and functions */
int equal(int *, int *, int);
int /*<<< orphan*/ sort(int *, int);
int test_already_sorted() {
  int array[] = {2, 1, 4, 3, 5};
  int expected[] = {2, 1, 4, 3, 5};
  sort(array, 5);
  return equal(expected, array, 5);
}


x86 assembly (clang, -O0):
<test_already_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_already_sorted>:
push   %rbx
sub    $0x40,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %eax,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <equal@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_already_sorted.array = [5 x i32] [i32 2, i32 1, i32 4, i32 3, i32 5]
@__const.test_already_sorted.expected = [5 x i32] [i32 2, i32 1, i32 4, i32 3, i32 5]
define i32 @test_already_sorted() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = call i32 @equal(i32* %7, i32* %8, i32 5)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_already_sorted.expected = [5 x i32] [i32 2, i32 1, i32 4, i32 3, i32 5]
define i32 @test_already_sorted() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = call i32 @sort(i32* %5, i32 5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @equal(i32* %7, i32* %5, i32 5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Testing...");
  printf("....1");
  printf("...2");
  printf("..3");
  printf("\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>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Testing...\00"
@.str.1 = [6 x i8] c"....1\00"
@.str.2 = [5 x i8] c"...2\00"
@.str.3 = [4 x i8] c"..3\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
int get_priority(char op) {
  if (op == '+' || op == '-') {
    return 1;
  } else if (op == '*' || op == '/') {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1124 <get_priority+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1130 <get_priority+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1162 <get_priority+0x62>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114a <get_priority+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1156 <get_priority+0x56>
movl   $0x2,-0x4(%rbp)
jmp    1162 <get_priority+0x62>
jmp    115b <get_priority+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_priority>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x5,%dil
ja     111a <get_priority+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_priority(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %23
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 42
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 47
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 2, i32* %2
br label %23
21: ; preds = %16
br label %22
22: ; preds = %21
store i32 0, i32* %2
br label %23
23: ; preds = %22, %20, %11
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@switch.table.get_priority = [6 x i32] [i32 2, i32 1, i32 0, i32 1, i32 0, i32 2]
define i32 @get_priority(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.get_priority, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int EINVAL;
int _checkstrtod(char const *, double *, char **);
int checkstrtod(const char *str, double *ret) {
  char *end;
  int err;
  err = _checkstrtod(str, ret, &end);
  if (*end != '\0')
    return -EINVAL;
  return err;
}


x86 assembly (clang, -O0):
<checkstrtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <_checkstrtod@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <checkstrtod+0x47>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <checkstrtod+0x4d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkstrtod>:
push   %rax
mov    %rsp,%rdx
call   1030 <_checkstrtod@plt>
mov    (%rsp),%rcx
mov    0x2ebc(%rip),%rdx
xor    %esi,%esi
sub    (%rdx),%esi
cmpb   $0x0,(%rcx)
cmovne %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @checkstrtod(i8* %0, double* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store double* %1, double** %5
%8 = load i8*, i8** %4
%9 = load double*, double** %5
%10 = call i32 @_checkstrtod(i8* %8, double* %9, i8** %6)
store i32 %10, i32* %7
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @EINVAL
%17 = sub nsw i32 0, %16
store i32 %17, i32* %3
br label %20
18: ; preds = %2
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @checkstrtod(i8* %0, double* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @_checkstrtod(i8* %0, double* %1, i8** %3)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
%11 = select i1 %8, i32 %5, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glScissor(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void setViewArea(GLint x, GLint y, GLsizei w, GLsizei h) {
  glViewport(x, y, w, h);
  glScissor(x, y, w, h);
}


x86 assembly (clang, -O0):
<setViewArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <glViewport@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <glScissor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setViewArea>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <glViewport@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <glScissor@plt>

LLVM IR (-O0):
define void @setViewArea(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glViewport(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @glScissor(i32 %14, i32 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @setViewArea(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glViewport(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @glScissor(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
void ScaleRowDown2Box_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Box_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int i = 1;
  unsigned char c = (unsigned char)i;
  printf("%d\n", c);
  if (c)
    printf("little\n");
  else
    printf("big\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpb   $0x0,-0x9(%rbp)
je     115b <main+0x4b>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <main+0x59>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"little\0A\00"
@.str.2 = [5 x i8] c"big\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8, i8* %3
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [7 x i8] c"little\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int minus1_mod(int i, int m) { return (i - 1 + m) % m; }


x86 assembly (clang, -O0):
<minus1_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minus1_mod>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @minus1_mod(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @minus1_mod(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long target;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
void set_XSelectionRequestEvent_target(void *_p, unsigned long _v) {
  ((XSelectionRequestEvent *)_p)->target = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XSelectionRequestEvent_target>:
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_XSelectionRequestEvent_target>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSelectionRequestEvent_target(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_XSelectionRequestEvent_target(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct lineFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ warn(char *, char *);
int lineFileSetTabixRegion(struct lineFile *lf, char *seqName, int start,
                           int end) {
  warn(
      "%s: Sorry, this functionality is available only when\n"
      "you have installed the tabix library from\n"
      "http://samtools.sourceforge.net/ and rebuilt kent/src with USE_TABIX=1\n"
      "(see http://genomewiki.ucsc.edu/index.php/Build_Environment_Variables).",
      "lineFileSetTabixRegion");
  return 0;
}


x86 assembly (clang, -O0):
<lineFileSetTabixRegion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    0xed3(%rip),%rdi
lea    0xfba(%rip),%rsi
call   1030 <warn@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lineFile = type { i32 }
@.str = [238 x i8] c"%s: Sorry, this functionality is available only when\0Ayou have installed the tabix library from\0Ahttp://samtools.sourceforge.net/ and rebuilt kent/src with USE_TABIX=1\0A(see http://genomewiki.ucsc.edu/index.php/Build_Environment_Variables).\00"
@.str.1 = [23 x i8] c"lineFileSetTabixRegion\00"
define i32 @lineFileSetTabixRegion(%struct.lineFile* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.lineFile*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct.lineFile* %0, %struct.lineFile** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @warn(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.lineFile = type { i32 }
@.str = [238 x i8] c"%s: Sorry, this functionality is available only when\0Ayou have installed the tabix library from\0Ahttp://samtools.sourceforge.net/ and rebuilt kent/src with USE_TABIX=1\0A(see http://genomewiki.ucsc.edu/index.php/Build_Environment_Variables).\00"
@.str.1 = [23 x i8] c"lineFileSetTabixRegion\00"
define i32 @lineFileSetTabixRegion(%struct.lineFile* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = tail call i32 @warn(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isascii(char);
scalar_t__ iscntrl(char);
char pp_control(char c) {
  if (iscntrl(c))
    return ' ';
  if (!isascii(c))
    return ' ';
  return c;
}


x86 assembly (clang, -O0):
<pp_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
je     114a <pp_control+0x2a>
movb   $0x20,-0x1(%rbp)
jmp    116b <pp_control+0x4b>
movsbl -0x2(%rbp),%edi
call   1040 <isascii@plt>
cmp    $0x0,%eax
jne    1165 <pp_control+0x45>
movb   $0x20,-0x1(%rbp)
jmp    116b <pp_control+0x4b>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_control>:
push   %rbx
mov    %edi,%ebx
call   1030 <iscntrl@plt>
mov    %rax,%rcx
mov    $0x20,%al
test   %rcx,%rcx
je     1134 <pp_control+0x14>
pop    %rbx
ret
movsbl %bl,%ebx
mov    %ebx,%edi
call   1040 <isascii@plt>
test   %eax,%eax
movzbl %bl,%ecx
mov    $0x20,%eax
cmovne %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @pp_control(i8 signext %0) {
%2 = tail call i64 @iscntrl(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @isascii(i8 signext %0)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8 32, i8 %0
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 32, %1 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ command(int /*<<< orphan*/);
void doescape() { command(0); }


x86 assembly (clang, -O0):
<doescape>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doescape>:
xor    %edi,%edi
jmp    1030 <command@plt>

LLVM IR (-O0):
define void @doescape() {
%1 = call i32 @command(i32 0)
ret void
}

LLVM IR (-O2):
define void @doescape() {
%1 = tail call i32 @command(i32 0)
ret void
}
/* Variables and functions */
int largestRectangleArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int height[] = {1};
  int area = largestRectangleArea(height, 1);
  printf("max area = %d\n", area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1040 <largestRectangleArea@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1040 <largestRectangleArea@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.main.height = [1 x i32] [i32 1]
@.str = [15 x i8] c"max area = %d\0A\00"
define void @main() {
%1 = alloca [1 x i32]
%2 = alloca i32
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%5 = call i32 @largestRectangleArea(i32* %4, i32 1)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"max area = %d\0A\00"
define void @main() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = call i32 @largestRectangleArea(i32* %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int fMax3(int a, int b) { return (a / b) ? a : b; }


x86 assembly (clang, -O0):
<fMax3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%eax
je     1125 <fMax3+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <fMax3+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fMax3>:
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
cmove  %esi,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fMax3(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 = sdiv i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @fMax3(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 %1, i32 %0
ret i32 %5
}
int valid_priv(int c) {
  int rv;
  switch (c) {
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 0x0f:
    rv = 1;
    break;
  default:
    rv = 0;
    break;
  }
  return (rv);
}


x86 assembly (clang, -O0):
<valid_priv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x5,%eax
jb     112f <valid_priv+0x2f>
jmp    111e <valid_priv+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xf,%eax
jne    113b <valid_priv+0x3b>
jmp    112f <valid_priv+0x2f>
movl   $0x1,-0x8(%rbp)
jmp    1142 <valid_priv+0x42>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_priv>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0xe,%edi
ja     1117 <valid_priv+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @valid_priv(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
i32 15, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %7
6: ; preds = %1
store i32 0, i32* %3
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@switch.table.valid_priv = [15 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1]
define i32 @valid_priv(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 15
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [15 x i32], [15 x i32]* @switch.table.valid_priv, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int toolls_is_char_paren(char ch) {
  int res = 1;
  switch (ch) {
  case '(':
  case ')': {
    res = 0;
    break;
  }
  }
  return res;
}


x86 assembly (clang, -O0):
<toolls_is_char_paren>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd8,%eax
sub    $0x1,%eax
ja     112d <toolls_is_char_paren+0x2d>
jmp    1126 <toolls_is_char_paren+0x26>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toolls_is_char_paren>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x28,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @toolls_is_char_paren(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 1, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 40, label %6
i32 41, label %6
]
6: ; preds = %1, %1
store i32 0, i32* %3
br label %7
7: ; preds = %1, %6
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @toolls_is_char_paren(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp ne i8 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
int network_connected(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @network_connected() {
ret i32 0
}
int test_imm_02int64_lowword_mem(long long *val) {
  return ((*val) & (0x02 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_02int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 2
%6 = icmp ne i64 %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_02int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void native_startup(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @native_startup(i32 %0, i8** nocapture %1) {
ret void
}
int getSum(int a, int b) {
  int c = 0;
  while (b != 0) {
    c = a & b;
    a ^= b;
    b = c << 1;
  }
  return a;
}


x86 assembly (clang, -O0):
<getSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113b <getSum+0x3b>
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <getSum+0x11>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSum>:
mov    %edi,%eax
test   %esi,%esi
je     111a <getSum+0x1a>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
and    %eax,%ecx
xor    %esi,%eax
add    %ecx,%ecx
mov    %ecx,%esi
jne    1110 <getSum+0x10>
ret

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

LLVM IR (-O2):
define i32 @getSum(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = and i32 %5, %6
%8 = xor i32 %5, %6
%9 = shl i32 %7, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %8, %4 ]
ret i32 %12
}
int init() { return 1; }


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

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

LLVM IR (-O0):
define i32 @init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @init() {
ret i32 1
}
int test_imm_55uint8_reg(unsigned char val) {
  return ((val) & (-0x55 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_55uint8_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, -85
%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_55uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -85
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *bar(void *, void *, int);
void *foo(void *p) { return bar((void *)0x12345000, p, 256); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x12345000,%edi
mov    $0x100,%edx
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rsi
mov    $0x12345000,%edi
mov    $0x100,%edx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i8* @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @bar(i8* inttoptr (i64 305418240 to i8*), i8* %3, i32 256)
ret i8* %4
}

LLVM IR (-O2):
define i8* @foo(i8* %0) {
%2 = tail call i8* @bar(i8* inttoptr (i64 305418240 to i8*), i8* %0, i32 256)
ret i8* %2
}
int ptr_to_str(char *p, char *str, int n) { return p >= str && p < (str + n); }


x86 assembly (clang, -O0):
<ptr_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x15(%rbp)
jb     113a <ptr_to_str+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_to_str>:
cmp    %rsi,%rdi
setae  %al
movslq %edx,%rcx
add    %rsi,%rcx
cmp    %rdi,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ptr_to_str(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp uge i8* %7, %8
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = icmp ult i8* %11, %15
br label %17
17: ; preds = %10, %3
%18 = phi i1 [ false, %3 ], [ %16, %10 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @ptr_to_str(i8* readnone %0, i8* readnone %1, i32 %2) {
%4 = icmp uge i8* %0, %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = icmp ugt i8* %6, %0
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
void gtk_text_buffer_get_bounds() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_get_bounds() {
ret void
}
/* Variables and functions */
int f1();
void f2() {
  int x = 1;
  x = f1();
  if (x == 1) {
    int *p = 0;
    *p = 3;
  }
  if (x == 2) {
    int *p = 0;
    *p = 3;
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f1@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1145 <f2+0x35>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpl   $0x2,-0x4(%rbp)
jne    1161 <f2+0x51>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 1, i32* %1
%4 = call i32 (...) @f1()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
store i32* null, i32** %2
%8 = load i32*, i32** %2
store i32 3, i32* %8
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
store i32* null, i32** %3
%13 = load i32*, i32** %3
store i32 3, i32* %13
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @f1()
%2 = icmp ne i32 %1, 1
tail call void @llvm.assume(i1 %2)
%3 = icmp ne i32 %1, 2
tail call void @llvm.assume(i1 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int file___NativeString_file_mkdir___impl(char *self) {
  return !mkdir(self, 0777);
}


x86 assembly (clang, -O0):
<file___NativeString_file_mkdir___impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file___NativeString_file_mkdir___impl>:
push   %rax
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @file___NativeString_file_mkdir___impl(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ file_flags;
  scalar_t__ bpf_fd;
  scalar_t__ pathname;
};
typedef scalar_t__ __u64;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void bpf_attr_setup_obj_get(union bpf_attr *attr, char *path, __u32 flags) {
  attr->pathname = (__u64)(unsigned long)path;
  attr->bpf_fd = 0;
  attr->file_flags = flags;
}


x86 assembly (clang, -O0):
<bpf_attr_setup_obj_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_attr_setup_obj_get>:
movq   $0x0,(%rdi)
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
define void @bpf_attr_setup_obj_get(%union.bpf_attr* %0, i8* %1, i32 %2) {
%4 = alloca %union.bpf_attr*
%5 = alloca i8*
%6 = alloca i32
store %union.bpf_attr* %0, %union.bpf_attr** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = ptrtoint i8* %7 to i64
%9 = load %union.bpf_attr*, %union.bpf_attr** %4
%10 = bitcast %union.bpf_attr* %9 to i64*
store i64 %8, i64* %10
%11 = load %union.bpf_attr*, %union.bpf_attr** %4
%12 = bitcast %union.bpf_attr* %11 to i64*
store i64 0, i64* %12
%13 = load i32, i32* %6
%14 = load %union.bpf_attr*, %union.bpf_attr** %4
%15 = bitcast %union.bpf_attr* %14 to i32*
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
define void @bpf_attr_setup_obj_get(%union.bpf_attr* nocapture writeonly %0, i8* nocapture readnone %1, i32 %2) {
%4 = getelementptr %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0
store i64 0, i64* %4
%5 = bitcast %union.bpf_attr* %0 to i32*
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
double pow(double, int);
double xyn(double x, double y) {
  return pow(x, 4.) - pow(y, 4.) + 0.5 * pow(x * y, 3.);
}


x86 assembly (clang, -O0):
<xyn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe89(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyn>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mulsd  0xe95(%rip),%xmm0
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @xyn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @pow(double %5, i32 4)
%7 = load double, double* %4
%8 = call double @pow(double %7, i32 4)
%9 = fsub double %6, %8
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = call double @pow(double %12, i32 3)
%14 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %13, double %9)
ret double %14
}

LLVM IR (-O2):
define double @xyn(double %0, double %1) {
%3 = tail call double @pow(double %0, i32 4)
%4 = tail call double @pow(double %1, i32 4)
%5 = fsub double %3, %4
%6 = fmul double %0, %1
%7 = tail call double @pow(double %6, i32 3)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e-01, double %5)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ core4_print(char *, char const *);
void U_EMRSTROKEANDFILLPATH_print(const char *contents) {
  core4_print("U_EMRSTROKEANDFILLPATH", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"U_EMRSTROKEANDFILLPATH\00"
define void @U_EMRSTROKEANDFILLPATH_print(i8* %0) {
%2 = tail call i32 @core4_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float normalize(float a, float b, float t) { return (t - a) / (b - a); }


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @normalize(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fdiv float %9, %12
ret float %13
}

LLVM IR (-O2):
define float @normalize(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void title_bar() { mvprintw(0, 0, "CChat"); }


x86 assembly (clang, -O0):
<title_bar>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
lea    0xee3(%rip),%rdx
mov    %esi,%edi
call   1030 <mvprintw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<title_bar>:
lea    0xee9(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <mvprintw@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"CChat\00"
define void @title_bar() {
%1 = call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"CChat\00"
define void @title_bar() {
%1 = tail call i32 @mvprintw(i32 0, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __int64_t_encoded_array_size(const int64_t *p, int elements) {
  (void)p;
  return sizeof(int64_t) * elements;
}


x86 assembly (clang, -O0):
<__int64_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int64_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int64_t_encoded_array_size(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 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__int64_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}