xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ notice(char *, char *);
int /*<<< orphan*/ printf(char *);
int test_notice(char *msg) {
  printf("   notice( \"log.c:notice(): test message: '%%s'\", msg );");
  notice("log.c:notice(): test message: '%s'", msg);
  printf(" passed\n");
  return (0);
}


x86 assembly (clang, -O0):
<test_notice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef6(%rip),%rdi
call   1040 <notice@plt>
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_notice>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rbx,%rsi
call   1050 <notice@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c" notice( \22log.c:notice(): test message: '%%s'\22, msg );\00"
@.str.1 = [35 x i8] c"log.c:notice(): test message: '%s'\00"
@.str.2 = [9 x i8] c" passed\0A\00"
define i32 @test_notice(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @notice(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c" notice( \22log.c:notice(): test message: '%%s'\22, msg );\00"
@.str.1 = [35 x i8] c"log.c:notice(): test message: '%s'\00"
@str = [8 x i8] c" passed\00"
define i32 @test_notice(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @notice(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void deallocate_GetMaxChildrenResponse(struct GetMaxChildrenResponse *v) {}


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

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

LLVM IR (-O0):
%struct.GetMaxChildrenResponse = type opaque
define void @deallocate_GetMaxChildrenResponse(%struct.GetMaxChildrenResponse* %0) {
%2 = alloca %struct.GetMaxChildrenResponse*
store %struct.GetMaxChildrenResponse* %0, %struct.GetMaxChildrenResponse** %2
ret void
}

LLVM IR (-O2):
%struct.GetMaxChildrenResponse = type opaque
define void @deallocate_GetMaxChildrenResponse(%struct.GetMaxChildrenResponse* nocapture %0) {
ret void
}
void ubi_debugfs_exit_dev(struct ubi_device *ubi) { return; }


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

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

LLVM IR (-O0):
%struct.ubi_device = type opaque
define void @ubi_debugfs_exit_dev(%struct.ubi_device* %0) {
%2 = alloca %struct.ubi_device*
store %struct.ubi_device* %0, %struct.ubi_device** %2
ret void
}

LLVM IR (-O2):
%struct.ubi_device = type opaque
define void @ubi_debugfs_exit_dev(%struct.ubi_device* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ft_isdigit(char);
int how_much_digit(char *ptr) {
  int i;
  int b;
  i = 0;
  b = 0;
  while (ft_isdigit(ptr[++i]))
    b++;
  return (b);
}


x86 assembly (clang, -O0):
<how_much_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%rax
je     115b <how_much_digit+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <how_much_digit+0x1a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<how_much_digit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0xffffffff,%ebp
nop
movsbl (%rbx),%edi
call   1030 <ft_isdigit@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <how_much_digit+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @how_much_digit(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @ft_isdigit(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
double floor(double);
struct timeval Timeval_of_second(double sec) {
  struct timeval retval;
  double n;
  n = floor(sec);
  retval.tv_sec = (int)n;
  retval.tv_usec = (int)((sec - n) * 1000.0 * 1000.0);
  return retval;
}


x86 assembly (clang, -O0):
<Timeval_of_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timeval_of_second>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @Timeval_of_second(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call double @llvm.floor.f64(double %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i32 %8, i32* %9
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fsub double %10, %11
%13 = fmul double %12, 1.000000e+03
%14 = fmul double %13, 1.000000e+03
%15 = fptosi double %14 to i32
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i32 %15, i32* %16
%17 = bitcast %struct.timeval* %2 to i64*
%18 = load i64, i64* %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @Timeval_of_second(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fptosi double %2 to i32
%4 = fsub double %0, %2
%5 = fmul double %4, 1.000000e+03
%6 = fmul double %5, 1.000000e+03
%7 = fptosi double %6 to i32
%8 = zext i32 %7 to i64
%9 = shl nuw i64 %8, 32
%10 = zext i32 %3 to i64
%11 = or i64 %9, %10
ret i64 %11
}
unsigned long fibonacci(int n) {
  if (n == 0 || n == 1)
    return n;
  return (fibonacci(n - 1) + fibonacci(n - 2));
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <fibonacci+0x1f>
cmpl   $0x1,-0xc(%rbp)
jne    113c <fibonacci+0x2c>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <fibonacci+0x54>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x2,%edi
jb     1133 <fibonacci+0x23>
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i64 @fibonacci(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add i64 %12, %10
%15 = icmp ult i32 %13, 2
br i1 %15, label %3, label %8
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int _kill(int pid, int sig) {
  pid = pid;
  sig = sig;
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
%7 = load i32, i32* @EINVAL
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
scalar_t__ jsondec_epochdays(int, int, int);
int64_t jsondec_unixtime(int y, int m, int d, int h, int min, int s) {
  return (int64_t)jsondec_epochdays(y, m, d) * 86400 + h * 3600 + min * 60 + s;
}


x86 assembly (clang, -O0):
<jsondec_unixtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <jsondec_epochdays@plt>
imul   $0x15180,%eax,%eax
imul   $0xe10,-0x10(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,-0x14(%rbp),%ecx
add    %ecx,%eax
add    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsondec_unixtime>:
push   %rbp
push   %r14
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%ebp
mov    %ecx,%ebx
call   1030 <jsondec_epochdays@plt>
imul   $0x15180,%eax,%ecx
imul   $0xe10,%ebx,%edx
imul   $0x3c,%ebp,%eax
add    %edx,%eax
add    %r14d,%eax
add    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @jsondec_unixtime(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i64 @jsondec_epochdays(i32 %13, i32 %14, i32 %15)
%17 = trunc i64 %16 to i32
%18 = mul nsw i32 %17, 86400
%19 = load i32, i32* %10
%20 = mul nsw i32 %19, 3600
%21 = add nsw i32 %18, %20
%22 = load i32, i32* %11
%23 = mul nsw i32 %22, 60
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %12
%26 = add nsw i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @jsondec_unixtime(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i64 @jsondec_epochdays(i32 %0, i32 %1, i32 %2)
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %8, 86400
%10 = mul nsw i32 %3, 3600
%11 = mul nsw i32 %4, 60
%12 = add i32 %11, %10
%13 = add i32 %12, %5
%14 = add i32 %13, %9
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetMap_size(int /*<<< orphan*/, int /*<<< orphan*/);
GLint __glGetMapiv_size(GLenum target, GLenum query) {
  return __glGetMap_size(target, query);
}


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

x86 assembly (clang, -O2):
<__glGetMapiv_size>:
jmp    1030 <__glGetMap_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetMapiv_size(i32 %0, i32 %1) {
%3 = tail call i32 @__glGetMap_size(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int const);
char *bitoa(const int val) {
  static char buf[13];
  sprintf(buf, "%i", val);
  return buf;
}


x86 assembly (clang, -O0):
<bitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@bitoa.buf = internal global [13 x i8] zeroinitializer
@.str = [3 x i8] c"%i\00"
define i8* @bitoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @bitoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @bitoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@bitoa.buf = internal global [13 x i8] zeroinitializer
@.str = [3 x i8] c"%i\00"
define i8* @bitoa(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @bitoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @bitoa.buf, i64 0, i64 0)
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_I2C_BUS1_SCL_PIN() { return 0x01 & (inp_emulate(0x35) >> 4); }


x86 assembly (clang, -O0):
<TOSH_READ_I2C_BUS1_SCL_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
sar    $0x4,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_I2C_BUS1_SCL_PIN>:
push   %rax
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
shr    $0x4,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_I2C_BUS1_SCL_PIN() {
%1 = call i32 @inp_emulate(i32 53)
%2 = ashr i32 %1, 4
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_I2C_BUS1_SCL_PIN() {
%1 = tail call i32 @inp_emulate(i32 53)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 4
%4 = and i8 %3, 1
ret i8 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t vlan_tci2vid(uint16_t tci) { return tci & 0x0fff; }


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

x86 assembly (clang, -O2):
<vlan_tci2vid>:
mov    %edi,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @vlan_tci2vid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4095
ret i32 %4
}

LLVM IR (-O2):
define i32 @vlan_tci2vid(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
int complong(const void *arg1, const void *arg2) {
  long l1 = *(long *)arg1;
  long l2 = *(long *)arg2;
  if (l1 == l2)
    return 0;
  else if (l1 < l2)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<complong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <complong+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115d <complong+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <complong+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <complong+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @complong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ output_banner();
int /*<<< orphan*/ run_shell();
void root(void) {
  output_banner();
  run_shell();
}


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

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

LLVM IR (-O0):
define void @root() {
%1 = call i32 (...) @output_banner()
%2 = call i32 (...) @run_shell()
ret void
}

LLVM IR (-O2):
define void @root() {
%1 = tail call i32 (...) @output_banner()
%2 = tail call i32 (...) @run_shell()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf(
      "Usage: %s [OPTION]... [FILE]...\n\nOptions:\n    -l, --long\t\toutput "
      "long format listing\n    -H, --human\t\tdisplay filesize in kilobytes "
      "and megabytes if appropriate (implies --long)\n    -a, --all\t\tinclude "
      "dotfiles and implied `.' and `..' entries\n    -1, --one\t\tlist files "
      "one per line\n    -i, --inode\t\tdisplay inode numbers (implies "
      "--long)\n    -d, --dereference\tshow information for the file links "
      "reference rather than for the link itself\n    -h, --help\t\tdisplay "
      "this help\n    -V, --version\tdisplay version information\n\nReport "
      "bugs to <bulliver@gmail.com>\n",
      "ls");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x110e(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [556 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -l, --long\09\09output long format listing\0A -H, --human\09\09display filesize in kilobytes and megabytes if appropriate (implies --long)\0A -a, --all\09\09include dotfiles and implied `.' and `..' entries\0A -1, --one\09\09list files one per line\0A -i, --inode\09\09display inode numbers (implies --long)\0A -d, --dereference\09show information for the file links reference rather than for the link itself\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([556 x i8], [556 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [556 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0AOptions:\0A -l, --long\09\09output long format listing\0A -H, --human\09\09display filesize in kilobytes and megabytes if appropriate (implies --long)\0A -a, --all\09\09include dotfiles and implied `.' and `..' entries\0A -1, --one\09\09list files one per line\0A -i, --inode\09\09display inode numbers (implies --long)\0A -d, --dereference\09show information for the file links reference rather than for the link itself\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([556 x i8], [556 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("\nhello\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"\0Ahello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __delete(char const *);
int /*<<< orphan*/ __inc_remove_counter();
int __carbon_delete(const char *path) {
  int res = __delete(path);
  if (res == 0)
    __inc_remove_counter();
  return res;
}


x86 assembly (clang, -O0):
<__carbon_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__delete@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <__carbon_delete+0x29>
mov    $0x0,%al
call   1040 <__inc_remove_counter@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__carbon_delete>:
push   %rbx
call   1030 <__delete@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1133 <__carbon_delete+0x13>
xor    %eax,%eax
call   1040 <__inc_remove_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @__carbon_delete(i8* %0) {
%2 = tail call i32 @__delete(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @__inc_remove_counter()
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int baz();
int foo(void) { return -1 >> baz(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <baz@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <baz@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @baz()
%2 = ashr i32 -1, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @baz()
ret i32 -1
}
void ll_to_int(long long x, volatile int *p) {
  int i;
  asm("" : "=r"(i) : "0"(x));
  *p = i;
}


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

x86 assembly (clang, -O2):
<ll_to_int>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @ll_to_int(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
%7 = call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32*, i32** %4
store volatile i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @ll_to_int(i64 %0, i32* %1) {
%3 = tail call i64 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%4 = trunc i64 %3 to i32
store volatile i32 %4, i32* %1
ret void
}
unsigned int atvd_fits_get_unused_bits_num(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @atvd_fits_get_unused_bits_num() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ part1();
int /*<<< orphan*/ part2();
int main(void) {
  part1();
  part2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @part1()
%2 = tail call i32 (...) @part2()
ret i32 0
}
/* Variables and functions */
unsigned int ioread32(void *);
unsigned int COM_ReadReg32(unsigned long addr) {
  return ioread32((void *)addr);
}


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

x86 assembly (clang, -O2):
<COM_ReadReg32>:
jmp    1030 <ioread32@plt>

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

LLVM IR (-O2):
define i32 @COM_ReadReg32(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @ioread32(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
void dev_putch(int c) {
  if (c > 0) {
    putchar((char)c);
  } else {
    printf("\033[2J\033[1;1H");
  }
  if (c == 8) {
    putchar(32);
    putchar(8);
  }
}


x86 assembly (clang, -O0):
<dev_putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <dev_putch+0x25>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1151 <dev_putch+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x8,-0x4(%rbp)
jne    116f <dev_putch+0x4f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_putch>:
push   %rbx
test   %edi,%edi
jle    1149 <dev_putch+0x29>
mov    %edi,%ebx
movsbl %bl,%edi
call   1030 <putchar@plt>
cmp    $0x8,%ebx
jne    1156 <dev_putch+0x36>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xeb0(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @dev_putch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = sext i8 %7 to i32
%9 = call i32 @putchar(i32 %8)
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 8
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @putchar(i32 32)
%17 = call i32 @putchar(i32 8)
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @dev_putch(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %13
5: ; preds = %1
%6 = shl i32 %0, 24
%7 = ashr exact i32 %6, 24
%8 = tail call i32 @putchar(i32 %7)
%9 = icmp eq i32 %0, 8
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = tail call i32 @putchar(i32 32)
%12 = tail call i32 @putchar(i32 8)
br label %13
13: ; preds = %3, %10, %5
ret void
}
void InitializeIIC() {}


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

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

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

LLVM IR (-O2):
define void @InitializeIIC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_uname(char *uname) {
  write("json-task.json", "\"username\":\"%s\", ", uname);
}


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

x86 assembly (clang, -O2):
<function_uname>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [18 x i8] c"\22username\22:\22%s\22, \00"
define void @function_uname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [18 x i8] c"\22username\22:\22%s\22, \00"
define void @function_uname(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((no, noclone)) short foo1(short arg) {
  short ret = 1;
  if (arg + 1 < ((!0) ? -(1 << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!0) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xffffff80,%eax
jl     1131 <foo1+0x31>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x7f,%eax
jle    113e <foo1+0x3e>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115c <foo1+0x5c>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
lea    0x1(%rdi),%ecx
add    $0xffffff81,%edi
movzwl %di,%eax
cmp    $0xff00,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @foo1(i16 signext %0) {
%2 = add i16 %0, 1
%3 = add i16 %0, -127
%4 = icmp ult i16 %3, -256
%5 = select i1 %4, i16 1, i16 %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ config_parse(char *);
void config_load(void) {
  static int config_parsed = 0;
  if (config_parsed == 0) {
    config_parse("/etc/pamnss-mysql/global.conf");
    config_parse("/etc/pamnss-mysql/root.conf");
    config_parsed = 1;
  }
}


x86 assembly (clang, -O0):
<config_load>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1143 <config_load+0x33>
lea    0xed8(%rip),%rdi
call   1030 <config_parse@plt>
lea    0xeea(%rip),%rdi
call   1030 <config_parse@plt>
movl   $0x1,0x2ee9(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_load>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    1139 <config_load+0x29>
lea    0xedf(%rip),%rdi
call   1030 <config_parse@plt>
lea    0xef1(%rip),%rdi
call   1030 <config_parse@plt>
movb   $0x1,0x2ef3(%rip)
pop    %rax
ret

LLVM IR (-O0):
@config_load.config_parsed = internal global i32 0
@.str = [30 x i8] c"/etc/pamnss-mysql/global.conf\00"
@.str.1 = [28 x i8] c"/etc/pamnss-mysql/root.conf\00"
define void @config_load() {
%1 = load i32, i32* @config_load.config_parsed
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @config_parse(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @config_parse(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* @config_load.config_parsed
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@config_load.config_parsed = internal unnamed_addr global i1 false
@.str = [30 x i8] c"/etc/pamnss-mysql/global.conf\00"
@.str.1 = [28 x i8] c"/etc/pamnss-mysql/root.conf\00"
define void @config_load() {
%1 = load i1, i1* @config_load.config_parsed
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 @config_parse(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @config_parse(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i1 true, i1* @config_load.config_parsed
br label %5
5: ; preds = %2, %0
ret void
}
unsigned long long read_timer() {
  unsigned long temp1;
  unsigned long temp2;
  unsigned long long time;
  asm volatile("rdtsc\t\n"
               "movl %%eax, %0\t\n"
               "movl %%edx, %1\t\n"
               : "=m"(temp1), "=m"(temp2)
               :
               : "%eax", "%edx");
  time = (((unsigned long long)temp2) << 32) + temp1;
  return time;
}


x86 assembly (clang, -O0):
<read_timer>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_timer>:
rdtsc
mov    %eax,-0x8(%rsp)
mov    %edx,-0x10(%rsp)
mov    -0x10(%rsp),%rax
shl    $0x20,%rax
add    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @read_timer() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = load i64, i64* %2
%5 = shl i64 %4, 32
%6 = load i64, i64* %1
%7 = add i64 %5, %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @read_timer() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = load i64, i64* %2
%6 = shl i64 %5, 32
%7 = load i64, i64* %1
%8 = add i64 %6, %7
ret i64 %8
}
int sys$imgfix() {
  return ({
    unsigned long resultvar;
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(65)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$imgfix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%rax
int    $0x81
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$imgfix>:
mov    $0x41,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$imgfix"() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 65)
store i64 %3, i64* %1
%4 = load i64, i64* %1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @"sys$imgfix"() {
%1 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 65)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ fe_delivery_system_t;

/* Variables and functions */
int change_delivery_system(fe_delivery_system_t delivery_system,
                           int fd_frontend) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @change_delivery_system(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_itoa_base_unsigned(unsigned long, int, char *);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putaddress(void *ptr) {
  unsigned long nbr;
  char *address;
  nbr = (unsigned long)ptr;
  address = ft_itoa_base_unsigned(nbr, 16, "0123456789abcdef");
  ft_putstr("0x");
  ft_putstr(address);
  free(address);
}


x86 assembly (clang, -O0):
<ft_putaddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
lea    0xeac(%rip),%rdx
call   1050 <ft_itoa_base_unsigned@plt>
mov    %rax,-0x18(%rbp)
lea    0xead(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putaddress>:
push   %rbx
lea    0xec8(%rip),%rdx
mov    $0x10,%esi
call   1050 <ft_itoa_base_unsigned@plt>
mov    %rax,%rbx
lea    0xec5(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
@.str.1 = [3 x i8] c"0x\00"
define void @ft_putaddress(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i8* @ft_itoa_base_unsigned(i64 %7, i32 16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %4
%9 = call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = call i32 @ft_putstr(i8* %10)
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
@.str.1 = [3 x i8] c"0x\00"
define void @ft_putaddress(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i8* @ft_itoa_base_unsigned(i64 %2, i32 16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @ft_putstr(i8* %3)
%6 = tail call i32 @free(i8* %3)
ret void
}
__attribute__((weak)) void NMI_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<NMI_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <NMI_Handler+0x9>
jmp    1109 <NMI_Handler+0x9>

x86 assembly (clang, -O2):
<NMI_Handler>:
jmp    1100 <NMI_Handler>

LLVM IR (-O0):
define weak void @NMI_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @NMI_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void __attribute__((visibility("default"))) lib3_default(void) {}


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

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

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

LLVM IR (-O2):
define void @lib3_default() {
ret void
}
/* Variables and functions */
unsigned char __lwpins32(unsigned int, unsigned int, int);
unsigned char ___lwpins32(unsigned int A, unsigned int B, int const I) {
  return __lwpins32(A, B, 1);
}


x86 assembly (clang, -O0):
<___lwpins32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <__lwpins32@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___lwpins32>:
mov    $0x1,%edx
jmp    1030 <__lwpins32@plt>

LLVM IR (-O0):
define zeroext i8 @___lwpins32(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 i32, i32* %4
%8 = load i32, i32* %5
%9 = call zeroext i8 @__lwpins32(i32 %7, i32 %8, i32 1)
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @___lwpins32(i32 %0, i32 %1, i32 %2) {
%4 = tail call zeroext i8 @__lwpins32(i32 %0, i32 %1, i32 1)
ret i8 %4
}
void gpio_uart_active(int port, int no_irda) {}


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

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

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

LLVM IR (-O2):
define void @gpio_uart_active(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_ret(void) { output_line("ret"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"ret\00"
define void @gen_ret() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void atomic_inc(int *v) { asm volatile("lock incl %0" : "=m"(*v) : "m"(*v)); }


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

x86 assembly (clang, -O2):
<atomic_inc>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc(i32* %0) {
tail call void asm sideeffect "lock incl $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0)
ret void
}
ISR(TIMER2_COMP_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double main() { printf("привет мир!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"\D0\BF\D1\80\D0\B8\D0\B2\D0\B5\D1\82 \D0\BC\D0\B8\D1\80!\0A\00"
define double @main() {
%1 = alloca double
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
@str = [21 x i8] c"\D0\BF\D1\80\D0\B8\D0\B2\D0\B5\D1\82 \D0\BC\D0\B8\D1\80!\00"
define double @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret double undef
}