xunge/DecIR huggingface dataset:
int comp_char_desc(const void *a, const void *b) {
  char a_tmp = *((char *)a);
  char b_tmp = *((char *)b);
  if ((int)a_tmp < (int)b_tmp)
    return 1;
  if ((int)a_tmp > (int)b_tmp)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<comp_char_desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <comp_char_desc+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115d <comp_char_desc+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    1156 <comp_char_desc+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <comp_char_desc+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_char_desc>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setg   %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_char_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int n) {
  scanf("%d", &n);
  printf("%d\n", f(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <f@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @f(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
double PAWMetersToKilometers(double meters) { return meters / 1000.0; }


x86 assembly (clang, -O0):
<PAWMetersToKilometers>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAWMetersToKilometers>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @PAWMetersToKilometers(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @PAWMetersToKilometers(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello World"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int num, *pnum;
  num = 10;
  pnum = &num;
  if (num == *pnum) {
    printf("verdade: %d %d", num, *pnum);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1152 <main+0x42>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"verdade: %d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
ret i32 0
}
/* Variables and functions */
int syscall(int, int, int, unsigned int);
int write(int fd, void *buffer, unsigned int size) {
  return syscall(4, fd, (int)buffer, size);
}


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

x86 assembly (clang, -O2):
<write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @syscall(i32 4, i32 %0, i32 %5, i32 %2)
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ function;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_function(void *_p) {
  return (int)((XGCValues *)_p)->function;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XGCValues_function(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_02(int a, int b, int c, int d) { return a - b - 1; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
not    %esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test_02(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 = sub nsw i32 %9, %10
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_02(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %1, -1
%6 = add i32 %5, %0
ret i32 %6
}
int is_integer(double x) {
  const long as_integer = (long)x;
  const double as_fp = (double)as_integer;
  return (x == as_fp);
}


x86 assembly (clang, -O0):
<is_integer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_integer>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_integer(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
store double %8, double* %4
%9 = load double, double* %2
%10 = load double, double* %4
%11 = fcmp oeq double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_integer(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fcmp oeq double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void CFGMR3QueryS32(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryS32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *p = strdup(s);
  if (!p)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1040 <strdup@plt>
test   %rax,%rax
je     112d <xstrdup+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fnDecryption();
int main() {
  fnDecryption();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fnDecryption()
ret i32 0
}
/* Type definitions */
struct sdp_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sdps_init_ops(struct sdp_dev *dev) {
  printf("sdps not supported\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<sdps_init_ops>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sdp_dev = type { i32 }
@.str = [20 x i8] c"sdps not supported\0A\00"
define void @sdps_init_ops(%struct.sdp_dev* %0) {
%2 = alloca %struct.sdp_dev*
store %struct.sdp_dev* %0, %struct.sdp_dev** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.sdp_dev = type { i32 }
@str = [19 x i8] c"sdps not supported\00"
define void @sdps_init_ops(%struct.sdp_dev* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void cprop_result8(int *data) {
  if (data[0])
    data[1] = 4;
  else
    data[2] = 3;
  data[3] = 210;
}


x86 assembly (clang, -O0):
<cprop_result8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1125 <cprop_result8+0x25>
mov    -0x8(%rbp),%rax
movl   $0x4,0x4(%rax)
jmp    1130 <cprop_result8+0x30>
mov    -0x8(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xd2,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result8>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    $0x4,%ecx
sub    %eax,%ecx
mov    %ecx,0x4(%rdi,%rax,4)
movl   $0xd2,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_result8(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 3, i32 4
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 210, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doSleep() { printf("Sleep\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Sleep\00"
define void @doSleep() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int setenv(name, value)
char *name, *value;
{ return (do_setenv(name, value, 0)); }


x86 assembly (clang, -O0):
<setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <do_setenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setenv>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <do_setenv@plt>

LLVM IR (-O0):
define i32 @setenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @do_setenv to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @setenv(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @do_setenv to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ board_led_1_toggle();
int main(void) {
  for (uint32_t i = 0; i < 10; i++) {
    board_led_1_toggle();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <board_led_1_toggle@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @board_led_1_toggle()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @board_led_1_toggle()
%2 = tail call i32 (...) @board_led_1_toggle()
%3 = tail call i32 (...) @board_led_1_toggle()
%4 = tail call i32 (...) @board_led_1_toggle()
%5 = tail call i32 (...) @board_led_1_toggle()
%6 = tail call i32 (...) @board_led_1_toggle()
%7 = tail call i32 (...) @board_led_1_toggle()
%8 = tail call i32 (...) @board_led_1_toggle()
%9 = tail call i32 (...) @board_led_1_toggle()
%10 = tail call i32 (...) @board_led_1_toggle()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *mmalloc(size_t n) {
  void *p;
  p = (void *)malloc(n);
  if (!p) {
    fprintf(stderr, "Not enough memory to allocate %d bytes\n", (int)n);
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<mmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <mmalloc+0x46>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <mmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Not enough memory to allocate %d bytes\0A\00"
define i8* @mmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i64, i64* %2
%12 = trunc i64 %11 to i32
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Not enough memory to allocate %d bytes\0A\00"
define i8* @mmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = trunc i64 %0 to i32
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
%10 = inttoptr i64 %2 to i8*
ret i8* %10
}
int pe_utils_round_up(int num_to_round, int multiple) {
  if (multiple == 0)
    return 0;
  return (num_to_round + multiple - 1) / multiple * multiple;
}


x86 assembly (clang, -O0):
<pe_utils_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <pe_utils_round_up+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1134 <pe_utils_round_up+0x34>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_utils_round_up>:
test   %esi,%esi
je     1114 <pe_utils_round_up+0x14>
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pe_utils_round_up(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add i32 %0, -1
%6 = add i32 %5, %1
%7 = srem i32 %6, %1
%8 = sub i32 %6, %7
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int Fib(int);
int Fibonacci(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  printf("%d\n%d\n", Fib(7), Fibonacci(7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1050 <Fib@plt>
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
call   1030 <Fibonacci@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7,%edi
call   1050 <Fib@plt>
mov    %eax,%ebx
mov    $0x7,%edi
call   1030 <Fibonacci@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @Fib(i32 7)
%2 = tail call i32 @Fibonacci(i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
int matchempty(void *__restrict__ x, const char *__restrict__ s, int ofs,
               struct __regex_t *__restrict__ preg, int plus, int eflags) {
  (void)x;
  (void)s;
  (void)ofs;
  (void)preg;
  (void)plus;
  (void)eflags;
  return 0;
}


x86 assembly (clang, -O0):
<matchempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.__regex_t = type opaque
define i32 @matchempty(i8* noalias %0, i8* noalias %1, i32 %2, %struct.__regex_t* noalias %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.__regex_t*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store %struct.__regex_t* %3, %struct.__regex_t** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load %struct.__regex_t*, %struct.__regex_t** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
ret i32 0
}

LLVM IR (-O2):
%struct.__regex_t = type opaque
define i32 @matchempty(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i32 %2, %struct.__regex_t* noalias nocapture readnone %3, i32 %4, i32 %5) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OutputDAchannel(int, int /*<<< orphan*/);
void ClearDAchannel(int channel_no) { OutputDAchannel(channel_no, 0); }


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

x86 assembly (clang, -O2):
<ClearDAchannel>:
xor    %esi,%esi
jmp    1030 <OutputDAchannel@plt>

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

LLVM IR (-O2):
define void @ClearDAchannel(i32 %0) {
%2 = tail call i32 @OutputDAchannel(i32 %0, i32 0)
ret void
}
void _M2_circle_finish(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_circle_finish(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 @_M2_circle_finish(i32 %0, i8** nocapture %1) {
ret void
}
char *mkupper(str)
char *str;
{
  char *sp;
  sp = str;
  while (*sp) {
    if ('a' <= *sp && *sp <= 'z')
      *sp += 'A' - 'a';
    ++sp;
  }
  return (str);
}


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

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

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

LLVM IR (-O2):
define i8* @mkupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
unsigned *__attribute__((no)) start_sequence(unsigned *x, unsigned *y) {
  return (unsigned *)0xdeadbeef;
}


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

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

LLVM IR (-O0):
define i32* @start_sequence(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret i32* inttoptr (i64 3735928559 to i32*)
}

LLVM IR (-O2):
define i32* @start_sequence(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32* inttoptr (i64 3735928559 to i32*)
}
/* Variables and functions */
int /*<<< orphan*/ i2c_EnableINT(int, unsigned char);
void i2c1_EnableINT(unsigned char i2cints) { i2c_EnableINT(1, i2cints); }


x86 assembly (clang, -O0):
<i2c1_EnableINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2c_EnableINT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_EnableINT>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <i2c_EnableINT@plt>

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

LLVM IR (-O2):
define void @i2c1_EnableINT(i8 zeroext %0) {
%2 = tail call i32 @i2c_EnableINT(i32 1, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  void *newp = realloc(p, size);
  if (newp == NULL) {
    if (size == 0)
      return NULL;
    abort();
  }
  return newp;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <xrealloc+0x4b>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <xrealloc+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1173 <xrealloc+0x53>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rbx,%rbx
je     1133 <xrealloc+0x13>
test   %rax,%rax
je     1135 <xrealloc+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i64, i64* %5
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i8* null, i8** %3
br label %20
16: ; preds = %12
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %15
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = icmp eq i64 %1, 0
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
void glUniformMatrix2x4fv(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *item) {
  list_replace(old, item);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
unsigned long long pawnAttacks(int, int);
uint64_t pawnEnpassCaptures(uint64_t pawns, int epsq, int colour) {
  return epsq == -1 ? 0ull : pawnAttacks(!colour, epsq) & pawns;
}


x86 assembly (clang, -O0):
<pawnEnpassCaptures>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1137 <pawnEnpassCaptures+0x27>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1155 <pawnEnpassCaptures+0x45>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0xc(%rbp),%esi
call   1030 <pawnAttacks@plt>
and    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pawnEnpassCaptures>:
cmp    $0xffffffff,%esi
je     112b <pawnEnpassCaptures+0x1b>
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %edx,%edx
sete   %dil
call   1030 <pawnAttacks@plt>
and    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @pawnEnpassCaptures(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %3
br label %19
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = load i32, i32* %5
%16 = call i64 @pawnAttacks(i32 %14, i32 %15)
%17 = load i64, i64* %4
%18 = and i64 %16, %17
br label %19
19: ; preds = %10, %9
%20 = phi i64 [ 0, %9 ], [ %18, %10 ]
ret i64 %20
}

LLVM IR (-O2):
define i64 @pawnEnpassCaptures(i64 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp eq i32 %2, 0
%7 = zext i1 %6 to i32
%8 = tail call i64 @pawnAttacks(i32 %7, i32 %1)
%9 = and i64 %8, %0
br label %10
10: ; preds = %3, %5
%11 = phi i64 [ %9, %5 ], [ 0, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  struct int_ptrs {
    int *p1;
    int *p2;
  };
  struct int_ptrs pointers;
  int i1 = 100, i2;
  pointers.p1 = &i1;
  pointers.p2 = &i2;
  *pointers.p2 = -97;
  printf("i1 = %i, *pointers.p1 = %i\n", i1, *pointers.p1);
  printf("i2 = %i, *pointers.p2 = %i\n", i2, *pointers.p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffff9f,(%rax)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0xffffff9f,%esi
mov    $0xffffff9f,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.int_ptrs = type { i32*, i32* }
@.str = [28 x i8] c"i1 = %i, *pointers.p1 = %i\0A\00"
@.str.1 = [28 x i8] c"i2 = %i, *pointers.p2 = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.int_ptrs
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %3
%5 = getelementptr inbounds %struct.int_ptrs, %struct.int_ptrs* %2, i32 0, i32 0
store i32* %3, i32** %5
%6 = getelementptr inbounds %struct.int_ptrs, %struct.int_ptrs* %2, i32 0, i32 1
store i32* %4, i32** %6
%7 = getelementptr inbounds %struct.int_ptrs, %struct.int_ptrs* %2, i32 0, i32 1
%8 = load i32*, i32** %7
store i32 -97, i32* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds %struct.int_ptrs, %struct.int_ptrs* %2, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
%14 = load i32, i32* %4
%15 = getelementptr inbounds %struct.int_ptrs, %struct.int_ptrs* %2, i32 0, i32 1
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"i1 = %i, *pointers.p1 = %i\0A\00"
@.str.1 = [28 x i8] c"i2 = %i, *pointers.p2 = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 -97, i32 -97)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
__attribute__((weak)) ssize_t __real_read(int fd, void *buf, size_t nbyte) {
  return read(fd, buf, nbyte);
}


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

x86 assembly (clang, -O2):
<__real_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define weak i32 @__real_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void myfunction3(int (*fruit)[3][5]) {}


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

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

LLVM IR (-O0):
define void @myfunction3([3 x [5 x i32]]* %0) {
%2 = alloca [3 x [5 x i32]]*
store [3 x [5 x i32]]* %0, [3 x [5 x i32]]** %2
ret void
}

LLVM IR (-O2):
define void @myfunction3([3 x [5 x i32]]* nocapture %0) {
ret void
}
void ioctl_load(void) {}


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

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

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

LLVM IR (-O2):
define void @ioctl_load() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long get_timestamp(void) {
  unsigned long long thetime;
  struct timeval tv;
  if (gettimeofday(&tv, NULL) != 0)
    return 0;
  thetime = ((unsigned long long)tv.tv_sec) * 1000000ULL +
            ((unsigned long long)tv.tv_usec);
  return thetime;
}


x86 assembly (clang, -O0):
<get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <get_timestamp+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1154 <get_timestamp+0x44>
imul   $0xf4240,-0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rcx
add    (%rsp),%rcx
test   %rax,%rax
cmovne %rbx,%rcx
mov    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_timestamp() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca %struct.timeval
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 0, i64* %1
br label %15
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = add i64 %10, %12
store i64 %13, i64* %2
%14 = load i64, i64* %2
store i64 %14, i64* %1
br label %15
15: ; preds = %7, %6
%16 = load i64, i64* %1
ret i64 %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %7, %9
%11 = select i1 %4, i64 %10, i64 0
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ putCommand(int);
void lcdClear() { putCommand(0x01); }


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

x86 assembly (clang, -O2):
<lcdClear>:
mov    $0x1,%edi
jmp    1030 <putCommand@plt>

LLVM IR (-O0):
define void @lcdClear() {
%1 = call i32 @putCommand(i32 1)
ret void
}

LLVM IR (-O2):
define void @lcdClear() {
%1 = tail call i32 @putCommand(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void readinitdir(void) { nocall("readinitdir"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"readinitdir\00"
define void @readinitdir() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((weak)) void fd_nrf8001_data_credit_change(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_data_credit_change() {
ret void
}
void extern_postdeclared(void) {}


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

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

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

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