xunge/DecIR huggingface dataset:
int maximum1(int a, int b) {
  int c = 0;
  return ((a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c));
}


x86 assembly (clang, -O0):
<maximum1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1145 <maximum1+0x45>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1134 <maximum1+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113a <maximum1+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <maximum1+0x68>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115c <maximum1+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <maximum1+0x62>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum1>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

LLVM IR (-O0):
define i32 @maximum1(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
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %3
br label %17
15: ; preds = %9
%16 = load i32, i32* %5
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
br label %29
19: ; preds = %2
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %4
br label %27
25: ; preds = %19
%26 = load i32, i32* %5
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
br label %29
29: ; preds = %27, %17
%30 = phi i32 [ %18, %17 ], [ %28, %27 ]
ret i32 %30
}

LLVM IR (-O2):
define i32 @maximum1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = icmp sgt i32 %4, %1
%6 = select i1 %5, i32 %4, i32 %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ mytqli(double *, double *, int const, double **);
int /*<<< orphan*/ mytred2(double **, int const, double *, double *);
void makeEigen(double **_a, const int n, double *d, double *e) {
  mytred2(_a, n, d, e);
  mytqli(d, e, n, _a);
}


x86 assembly (clang, -O0):
<makeEigen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <mytred2@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
call   1030 <mytqli@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeEigen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r15
call   1040 <mytred2@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <mytqli@plt>

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

LLVM IR (-O2):
define void @makeEigen(double** %0, i32 %1, double* %2, double* %3) {
%5 = tail call i32 @mytred2(double** %0, i32 %1, double* %2, double* %3)
%6 = tail call i32 @mytqli(double* %2, double* %3, i32 %1, double** %0)
ret void
}
int isdos(int t) {
  return t == 0x01 || t == 0x04 || t == 0x06 || t == 0x0b || t == 0x0c;
}


x86 assembly (clang, -O0):
<isdos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isdos+0x4d>
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isdos+0x4d>
mov    $0x1,%al
cmpl   $0x6,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isdos+0x4d>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <isdos+0x4d>
cmpl   $0xc,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdos>:
cmp    $0xb,%edi
ja     1115 <isdos+0x15>
mov    $0x1,%eax
mov    $0x852,%ecx
bt     %edi,%ecx
jae    1115 <isdos+0x15>
ret
xor    %eax,%eax
cmp    $0xc,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isdos(i32 %0) {
switch i32 %0, label %2 [
i32 11, label %5
i32 6, label %5
i32 4, label %5
i32 1, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 12
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int fun1012() { return 1012; }


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

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

LLVM IR (-O0):
define i32 @fun1012() {
ret i32 1012
}

LLVM IR (-O2):
define i32 @fun1012() {
ret i32 1012
}
a() {
  int(*p)[2] = (int[][2]){1, 2, {3, 4, sideeffect()}};
  if (p[0][0] != 1 || p[0][1] != 2 || p[1][0] != 3 || p[1][1] != 4)
    abort();
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1173 <a+0x63>
mov    -0x10(%rbp),%rax
cmpl   $0x2,0x4(%rax)
jne    1173 <a+0x63>
mov    -0x10(%rbp),%rax
cmpl   $0x3,0x8(%rax)
jne    1173 <a+0x63>
mov    -0x10(%rbp),%rax
cmpl   $0x4,0xc(%rax)
je     1178 <a+0x68>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @a() {
%1 = alloca i32
%2 = alloca [2 x i32]*
%3 = alloca [2 x [2 x i32]]
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 2, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 1
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 3, i32* %8
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 4, i32* %9
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
store [2 x i32]* %10, [2 x i32]** %2
%11 = load [2 x i32]*, [2 x i32]** %2
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 1
br i1 %15, label %34, label %16
16: ; preds = %0
%17 = load [2 x i32]*, [2 x i32]** %2
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 1
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 2
br i1 %21, label %34, label %22
22: ; preds = %16
%23 = load [2 x i32]*, [2 x i32]** %2
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %23, i64 1
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 0, i64 0
%26 = load i32, i32* %25
%27 = icmp ne i32 %26, 3
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load [2 x i32]*, [2 x i32]** %2
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %29, i64 1
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 4
br i1 %33, label %34, label %35
34: ; preds = %28, %22, %16, %0
unreachable
35: ; preds = %28
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
define i32 @a() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *rtinfo_get_time() {
  time_t t;
  time(&t);
  return localtime(&t);
}


x86 assembly (clang, -O0):
<rtinfo_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtinfo_get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @rtinfo_get_time() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %3
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @rtinfo_get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
uint32_t UP3D_GetPositiveLimitState(int motor) {
  if ((motor < 1) || (motor > 4))
    return -1;
  return UP3D_GetParameter(0x22 + motor - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetPositiveLimitState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetPositiveLimitState+0x1f>
cmpl   $0x4,-0x8(%rbp)
jle    113b <UP3D_GetPositiveLimitState+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetPositiveLimitState+0x3c>
mov    -0x8(%rbp),%edi
add    $0x22,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetPositiveLimitState>:
lea    -0x5(%rdi),%eax
cmp    $0xfffffffc,%eax
jae    111e <UP3D_GetPositiveLimitState+0xe>
mov    $0xffffffff,%eax
ret
add    $0x21,%edi
jmp    1030 <UP3D_GetParameter@plt>

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

LLVM IR (-O2):
define i32 @UP3D_GetPositiveLimitState(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, -4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 33
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int EECR();
int EEARL(void) { return EECR() + 2; }


x86 assembly (clang, -O0):
<EEARL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EECR@plt>
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEARL>:
push   %rax
xor    %eax,%eax
call   1030 <EECR@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @EEARL() {
%1 = call i32 (...) @EECR()
%2 = add nsw i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @EEARL() {
%1 = tail call i32 (...) @EECR()
%2 = add nsw i32 %1, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ a();
void func2() { a(); }


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

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

LLVM IR (-O0):
define void @func2() {
%1 = call i32 (...) @a()
ret void
}

LLVM IR (-O2):
define void @func2() {
%1 = tail call i32 (...) @a()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ quad_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ SYS_lseek;
int /*<<< orphan*/ __syscall(int /*<<< orphan*/, int, int /*<<< orphan*/,
                             int /*<<< orphan*/, int);
off_t machdep_sys_lseek(int fd, off_t offset, int whence) {
  return (__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
}


x86 assembly (clang, -O0):
<machdep_sys_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
xor    %edx,%edx
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_lseek>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%esi
mov    0x2ed2(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
@SYS_lseek = global i64 0
define i32 @machdep_sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* @SYS_lseek
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @__syscall(i32 %8, i32 %9, i32 0, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@SYS_lseek = global i64 0
define i32 @machdep_sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i64, i64* @SYS_lseek
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__syscall(i32 %5, i32 %0, i32 0, i32 %1, i32 %2)
ret i32 %6
}
float fIdentity(void) { return (0.0f); }


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

x86 assembly (clang, -O2):
<fIdentity>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fIdentity() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @fIdentity() {
ret float 0.000000e+00
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int o_getaddrinfo(char const *, char const *, struct addrinfo const *,
                  struct addrinfo **);
int f_getaddrinfo(const char *node, const char *service,
                  const struct addrinfo *hints, struct addrinfo **res) {
  return o_getaddrinfo(node, service, hints, res);
}


x86 assembly (clang, -O0):
<f_getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <o_getaddrinfo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_getaddrinfo>:
jmp    1030 <o_getaddrinfo@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @f_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.addrinfo*, %struct.addrinfo** %7
%12 = load %struct.addrinfo**, %struct.addrinfo*** %8
%13 = call i32 @o_getaddrinfo(i8* %9, i8* %10, %struct.addrinfo* %11, %struct.addrinfo** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @f_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = tail call i32 @o_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3)
ret i32 %5
}
void border_ne_ext_corner_special_sand_long_hori(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_ne_ext_corner_special_sand_long_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_ne_ext_corner_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_ne_ext_corner_special_sand_long_hori(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
store i8 48, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_ne_ext_corner_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 2, i8* %1
ret void
}
unsigned long c_nio_http_parser_version(void) {
  return 2 * 0x10000 | 9 * 0x00100 | 4 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @c_nio_http_parser_version() {
ret i64 133380
}

LLVM IR (-O2):
define i64 @c_nio_http_parser_version() {
ret i64 133380
}
unsigned long crb_read(long channel, unsigned long length, char *buf,
                       unsigned long block) {
  return 0x8000000000000000ul;
}


x86 assembly (clang, -O0):
<crb_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movabs $0x8000000000000000,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @crb_read(i64 %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i64 -9223372036854775808
}

LLVM IR (-O2):
define i64 @crb_read(i64 %0, i64 %1, i8* nocapture readnone %2, i64 %3) {
ret i64 -9223372036854775808
}
getlstn(uid) { return ("last name"); }


x86 assembly (clang, -O0):
<getlstn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"last name\00"
define i32 @getlstn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 ptrtoint ([10 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [10 x i8] c"last name\00"
define i32 @getlstn(i32 %0) {
ret i32 ptrtoint ([10 x i8]* @.str to i32)
}
void foo158(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo158(i32 %0) {
ret void
}
unsigned int hash_string(register const char *key) {
  register unsigned int hash = 0;
  while (*key)
    hash = hash * 37 + *key++;
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <hash_string+0x3c>
imul   $0x25,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash_string+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %3
%10 = mul i32 %9, 37
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 37
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__1__Out__set();
void LedsP__Led2__set(void) { ReverseGPIOP__1__Out__set(); }


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

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

LLVM IR (-O0):
define void @LedsP__Led2__set() {
%1 = call i32 (...) @ReverseGPIOP__1__Out__set()
ret void
}

LLVM IR (-O2):
define void @LedsP__Led2__set() {
%1 = tail call i32 (...) @ReverseGPIOP__1__Out__set()
ret void
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int setCloexec(int fd) {
  int flags = fcntl(fd, F_GETFD, 0);
  if (flags == -1)
    return -1;
  flags |= FD_CLOEXEC;
  return fcntl(fd, F_SETFD, flags);
}


x86 assembly (clang, -O0):
<setCloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1147 <setCloexec+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <setCloexec+0x5d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCloexec>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1144 <setCloexec+0x34>
mov    0x2ea9(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @setCloexec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* @FD_CLOEXEC
%13 = load i32, i32* %4
%14 = or i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* @F_SETFD
%17 = load i32, i32* %4
%18 = call i32 @fcntl(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@FD_CLOEXEC = global i32 0
@F_SETFD = global i32 0
define i32 @setCloexec(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @FD_CLOEXEC
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
char *roadmap_trip_get_focus_name();
int /*<<< orphan*/ roadmap_trip_set_focus(char *);
int /*<<< orphan*/ strcmp(char const *, char *);
void roadmap_gps_fine_fix_focus(void) {
  const char *focus = roadmap_trip_get_focus_name();
  if (focus && (!strcmp(focus, "Location"))) {
    roadmap_trip_set_focus("GPS");
  }
}


x86 assembly (clang, -O0):
<roadmap_gps_fine_fix_focus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <roadmap_trip_get_focus_name@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <roadmap_gps_fine_fix_focus+0x43>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1173 <roadmap_gps_fine_fix_focus+0x43>
lea    0xe9b(%rip),%rdi
call   1050 <roadmap_trip_set_focus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_gps_fine_fix_focus>:
push   %rax
xor    %eax,%eax
call   1030 <roadmap_trip_get_focus_name@plt>
test   %rax,%rax
je     1150 <roadmap_gps_fine_fix_focus+0x20>
lea    0xebc(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1152 <roadmap_gps_fine_fix_focus+0x22>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
pop    %rax
jmp    1050 <roadmap_trip_set_focus@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Location\00"
@.str.1 = [4 x i8] c"GPS\00"
define void @roadmap_gps_fine_fix_focus() {
%1 = alloca i8*
%2 = call i8* (...) @roadmap_trip_get_focus_name()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %5, %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Location\00"
@.str.1 = [4 x i8] c"GPS\00"
define void @roadmap_gps_fine_fix_focus() {
%1 = tail call i8* (...) @roadmap_trip_get_focus_name()
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @roadmap_trip_set_focus(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void tiger_print_int(int i) {
  fprintf(stdout, "%i", i);
  return;
}


x86 assembly (clang, -O0):
<tiger_print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiger_print_int>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%i\00"
define void @tiger_print_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%i\00"
define void @tiger_print_int(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *_G_LevelMalloc(scalar_t__, char const *, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *_G_LevelCopyString(const char *in, const char *filename, int fileline) {
  char *out;
  out = _G_LevelMalloc(strlen(in) + 1, filename, fileline);
  strcpy(out, in);
  return out;
}


x86 assembly (clang, -O0):
<_G_LevelCopyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <_G_LevelMalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_G_LevelCopyString>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <_G_LevelMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @_G_LevelCopyString(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i8* @_G_LevelMalloc(i64 %10, i8* %11, i32 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @_G_LevelCopyString(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @_G_LevelMalloc(i64 %5, i8* %1, i32 %2)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
void __attribute__((
    __warning__("curl_easy_setopt expects a "
                "string ('char *' or char[]) argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_string(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_string() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
char *strdup(char const *);
void bsg_ksstring_replace(const char **dest, const char *replacement) {
  if (*dest != NULL) {
    free((void *)*dest);
  }
  if (replacement == NULL) {
    *dest = NULL;
  } else {
    *dest = strdup(replacement);
  }
}


x86 assembly (clang, -O0):
<bsg_ksstring_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <bsg_ksstring_replace+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1165 <bsg_ksstring_replace+0x45>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1178 <bsg_ksstring_replace+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsg_ksstring_replace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <bsg_ksstring_replace+0x17>
call   1030 <free@plt>
test   %rbx,%rbx
je     1146 <bsg_ksstring_replace+0x26>
mov    %rbx,%rdi
call   1040 <strdup@plt>
jmp    1148 <bsg_ksstring_replace+0x28>
xor    %eax,%eax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bsg_ksstring_replace(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i8**, i8*** %3
store i8* null, i8** %16
br label %21
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = call i8* @strdup(i8* %18)
%20 = load i8**, i8*** %3
store i8* %19, i8** %20
br label %21
21: ; preds = %17, %15
ret void
}

LLVM IR (-O2):
define void @bsg_ksstring_replace(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i8* @strdup(i8* %1)
br label %11
11: ; preds = %7, %9
%12 = phi i8* [ %10, %9 ], [ null, %7 ]
store i8* %12, i8** %0
ret void
}
int g(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @g(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main(void) {
  void *ptr = malloc(5555);
  if (ptr == NULL) {
    return 1;
  }
  free(ptr);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x15b3,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    116d <main+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x15b3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <main+0x27>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(5555) i8* @malloc(i32 5555)
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_usigned_greater_than() {
  gen_pop();
  gen_call("ccugt");
}


x86 assembly (clang, -O0):
<gen_usigned_greater_than>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_usigned_greater_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccugt\00"
define i32 @gen_usigned_greater_than() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccugt\00"
define i32 @gen_usigned_greater_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int str_islower(const char *s) {
  while (*s)
    if (*s < 'a' || *s > 'z')
      return 0;
    else
      s++;
  return 1;
}


x86 assembly (clang, -O0):
<str_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <str_islower+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1135 <str_islower+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jle    1141 <str_islower+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1159 <str_islower+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <str_islower+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_islower>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <str_islower+0x23>
add    $0x1,%rdi
nop
add    $0x85,%cl
cmp    $0xe5,%cl
jbe    1124 <str_islower+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_islower+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_islower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -123
%11 = icmp ult i8 %10, -26
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
int ui_init_testcmds2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ui_init_testcmds2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeInt(int);
int /*<<< orphan*/ writeLine();
void printInt(int i) {
  writeInt(i);
  writeLine();
}


x86 assembly (clang, -O0):
<printInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <writeInt@plt>
mov    $0x0,%al
call   1040 <writeLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @printInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @writeInt(i32 %3)
%5 = call i32 (...) @writeLine()
ret void
}

LLVM IR (-O2):
define void @printInt(i32 %0) {
%2 = tail call i32 @writeInt(i32 %0)
%3 = tail call i32 (...) @writeLine()
ret void
}
/* Variables and functions */
void *ft_memset(void *s, int c, size_t len) {
  char *tmp;
  size_t i;
  i = 0;
  if (s == NULL)
    return (NULL);
  tmp = (char *)s;
  while (i < len) {
    tmp[i] = (char)c;
    ++i;
  }
  return ((void *)tmp);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112f <ft_memset+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    116e <ft_memset+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1166 <ft_memset+0x66>
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1137 <ft_memset+0x37>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1126 <ft_memset+0x16>
test   %rdx,%rdx
je     1126 <ft_memset+0x16>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* writeonly %0, i32 %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i64 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = trunc i32 %1 to i8
br label %9
9: ; preds = %7, %3
ret i8* %0
}
int test1(void) {
  unsigned char buf[4096];
  memset(buf, 0xFE, 4096);
  (memset(&(buf), 0, (13)));
  return (buf[0] == 0 && buf[13 - 1] == 0 && buf[13] == 0xFE &&
          buf[4096 - 1] == 0xFE);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
lea    -0x1000(%rbp),%rdi
mov    $0xfe,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
lea    -0x1000(%rbp),%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1030 <memset@plt>
movzbl -0x1000(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1001(%rbp)
jne    11a1 <test1+0x91>
movzbl -0xff4(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1001(%rbp)
jne    11a1 <test1+0x91>
movzbl -0xff3(%rbp),%ecx
xor    %eax,%eax
cmp    $0xfe,%ecx
mov    %al,-0x1001(%rbp)
jne    11a1 <test1+0x91>
movzbl -0x1(%rbp),%eax
cmp    $0xfe,%eax
sete   %al
mov    %al,-0x1001(%rbp)
mov    -0x1001(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x1010,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test1() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = bitcast [4096 x i8]* %1 to i8*
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %0
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 12
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 254
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 4095
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 254
br label %23
23: ; preds = %18, %13, %8, %0
%24 = phi i1 [ false, %13 ], [ false, %8 ], [ false, %0 ], [ %22, %18 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @test1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BSP_UART_SendByte(unsigned int, unsigned char);
void BSP_UART_SendCongestionString(unsigned int port, char *pString) {
  unsigned int n = 0;
  while (pString[n] != '\0') {
    BSP_UART_SendByte(port, (unsigned char)(pString[n]));
    n++;
  }
}


x86 assembly (clang, -O0):
<BSP_UART_SendCongestionString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115b <BSP_UART_SendCongestionString+0x4b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
call   1030 <BSP_UART_SendByte@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <BSP_UART_SendCongestionString+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_UART_SendCongestionString>:
push   %rbp
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     1148 <BSP_UART_SendCongestionString+0x38>
mov    %rsi,%rbx
mov    %edi,%r14d
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%esi
mov    %r14d,%edi
call   1030 <BSP_UART_SendByte@plt>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ebp
test   %al,%al
jne    1130 <BSP_UART_SendCongestionString+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @BSP_UART_SendCongestionString(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = tail call i32 @BSP_UART_SendByte(i32 %0, i8 zeroext %6)
%9 = add i32 %7, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}