xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int numero;
  printf("Escribe tu numero: ");
  scanf("%i", &numero);
  if (numero < 0) {
    numero = -numero;
  }
  printf("El valor absoluto es %i\n", numero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    115f <main+0x3f>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jns    114e <main+0x2e>
neg    %esi
mov    %esi,0x4(%rsp)
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Escribe tu numero: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [25 x i8] c"El valor absoluto es %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Escribe tu numero: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [25 x i8] c"El valor absoluto es %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = sub nsw i32 0, %5
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %0
%10 = phi i32 [ %8, %7 ], [ %5, %0 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ crc16(unsigned char *, unsigned int);
int modbus_crc_correct(unsigned char *frame, unsigned int len) {
  return (!crc16(frame, len));
}


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

x86 assembly (clang, -O2):
<modbus_crc_correct>:
push   %rax
call   1030 <crc16@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @modbus_crc_correct(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @crc16(i8* %5, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @modbus_crc_correct(i8* %0, i32 %1) {
%3 = tail call i32 @crc16(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void UserPreOoaInitializationCalloutf(void) {}


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

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

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

LLVM IR (-O2):
define void @UserPreOoaInitializationCalloutf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nfinish();
void finally() { nfinish(); }


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

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

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

LLVM IR (-O2):
define void @finally() {
%1 = tail call i32 (...) @nfinish()
ret void
}
void java_security_AccessController___CLINIT_() { return; }


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

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

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

LLVM IR (-O2):
define void @java_security_AccessController___CLINIT_() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(int /*<<< orphan*/ *, int,
                                 int /*<<< orphan*/ *, int, int, int);
void pixel_avg_16x8(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                    int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 8);
}


x86 assembly (clang, -O0):
<pixel_avg_16x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_16x8>:
mov    $0x10,%r8d
mov    $0x8,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_16x8(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 16, i32 8)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XNoExposeEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XNoExposeEvent_display(void *_p, void *_v) {
  ((XNoExposeEvent *)_p)->display = (Display *)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XNoExposeEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatalError(char *message) {
  fprintf(stderr, "main: %s\n", message);
  exit(1);
}


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

x86 assembly (clang, -O2):
<fatalError>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"main: %s\0A\00"
define void @fatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"main: %s\0A\00"
define void @fatalError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_8Euint32_reg(unsigned int val) {
  return ((val) & (0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_8Euint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 142
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_8Euint32_reg(i32 %0) {
%2 = and i32 %0, 142
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void legalize() {}


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

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

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

LLVM IR (-O2):
define void @legalize() {
ret void
}
/* Type definitions */
typedef char *ssize_t;

/* Variables and functions */
long errno;
ssize_t sys_listxattr(const char *p, char *l, size_t s) {
  long __res;
  __asm__ __volatile__("syscall"
                       : "=a"(__res)
                       : "0"(194), "D"((long)(p)), "S"((long)(l)),
                         "d"((long)(s))
                       : "r11", "rcx", "memory");
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-4095)) {
      errno = -(__res);
      __res = -1;
    }
    return (ssize_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<sys_listxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xc2,%eax
syscall
mov    %rax,-0x20(%rbp)
cmpq   $0xfffffffffffff001,-0x20(%rbp)
ff
jb     114f <sys_listxattr+0x4f>
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x20(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %rcx,(%rax)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_listxattr>:
mov    $0xc2,%eax
syscall
cmp    $0xfffffffffffff001,%rax
jb     1123 <sys_listxattr+0x23>
neg    %rax
mov    0x2ec7(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i64 0
define i8* @sys_listxattr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i64
%12 = load i64, i64* %6
%13 = call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 194, i64 %9, i64 %11, i64 %12)
store i64 %13, i64* %7
br label %14
14: ; preds = %3
%15 = load i64, i64* %7
%16 = icmp uge i64 %15, -4095
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i64, i64* %7
%19 = sub nsw i64 0, %18
store i64 %19, i64* @errno
store i64 -1, i64* %7
br label %20
20: ; preds = %17, %14
%21 = load i64, i64* %7
%22 = inttoptr i64 %21 to i8*
br label %23
23: ; preds = %20
ret i8* %22
}

LLVM IR (-O2):
@errno = global i64 0
define i8* @sys_listxattr(i8* %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = tail call i64 asm sideeffect "syscall", "={ax},0,{di},{si},{dx},~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 194, i64 %4, i64 %5, i64 %2)
%7 = icmp ugt i64 %6, -4096
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sub nsw i64 0, %6
store i64 %9, i64* @errno
br label %10
10: ; preds = %8, %3
%11 = phi i64 [ -1, %8 ], [ %6, %3 ]
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}
/* Variables and functions */
int f(int **);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, a[2][2] = {{-2, -1}, {1, 2}};
  i = f(a + 2);
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x10,%rdi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <f@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [2 x [2 x i32]] [[2 x i32] [i32 -2, i32 -1], [2 x i32] [i32 1, i32 2]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [2 x [2 x i32]]
%2 = bitcast [2 x [2 x i32]]* %1 to i8*
%3 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 2
%4 = bitcast [2 x i32]* %3 to i32**
%5 = call i32 @f(i32** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int any_LSB_zero(unsigned x) { return !!(~x & 0xFF); }


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

x86 assembly (clang, -O2):
<any_LSB_zero>:
xor    %eax,%eax
cmp    $0xff,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @any_LSB_zero(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 255
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ chroot(char *);
int /*<<< orphan*/ close(int);
int main(void) {
  close(-1);
  chroot(".");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1050 <close@plt>
lea    0xeb0(%rip),%rdi
call   1040 <chroot@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1050 <close@plt>
lea    0xebe(%rip),%rdi
call   1040 <chroot@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @close(i32 -1)
%3 = call i32 @chroot(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @close(i32 -1)
%2 = tail call i32 @chroot(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @_exit(i32 0)
unreachable
}
unsigned int littlebinary2ui(char *binary) {
  unsigned int result = 0;
  int len = sizeof(result);
  unsigned int exp = 1;
  int i;
  for (i = 0; i < len; ++i) {
    result += binary[i] * exp;
    exp <<= 8;
  }
  return result;
}


x86 assembly (clang, -O0):
<littlebinary2ui>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115d <littlebinary2ui+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1124 <littlebinary2ui+0x24>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<littlebinary2ui>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @littlebinary2ui(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = add nsw i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl nsw i32 %11, 16
%13 = add nsw i32 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = add i32 %17, %13
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_CLR_ADC4_PIN();
int /*<<< orphan*/ TOSH_MAKE_ADC4_INPUT();
int /*<<< orphan*/ TOSH_MAKE_ADC4_OUTPUT();
int TOSH_READ_ADC4_PIN();
int /*<<< orphan*/ TOSH_uwait(int);
int ds2770_readBit() {
  int result;
  TOSH_MAKE_ADC4_OUTPUT();
  TOSH_CLR_ADC4_PIN();
  TOSH_uwait(1);
  TOSH_MAKE_ADC4_INPUT();
  TOSH_uwait(7);
  result = TOSH_READ_ADC4_PIN();
  TOSH_uwait(50);
  return result;
}


x86 assembly (clang, -O0):
<ds2770_readBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <TOSH_MAKE_ADC4_OUTPUT@plt>
mov    $0x0,%al
call   1040 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x1,%edi
call   1070 <TOSH_uwait@plt>
mov    $0x0,%al
call   1050 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x7,%edi
call   1070 <TOSH_uwait@plt>
mov    $0x0,%al
call   1030 <TOSH_READ_ADC4_PIN@plt>
mov    %eax,-0x4(%rbp)
mov    $0x32,%edi
call   1070 <TOSH_uwait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2770_readBit>:
push   %rbx
xor    %eax,%eax
call   1060 <TOSH_MAKE_ADC4_OUTPUT@plt>
xor    %eax,%eax
call   1040 <TOSH_CLR_ADC4_PIN@plt>
mov    $0x1,%edi
call   1070 <TOSH_uwait@plt>
xor    %eax,%eax
call   1050 <TOSH_MAKE_ADC4_INPUT@plt>
mov    $0x7,%edi
call   1070 <TOSH_uwait@plt>
xor    %eax,%eax
call   1030 <TOSH_READ_ADC4_PIN@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1070 <TOSH_uwait@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ds2770_readBit() {
%1 = alloca i32
%2 = call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%3 = call i32 (...) @TOSH_CLR_ADC4_PIN()
%4 = call i32 @TOSH_uwait(i32 1)
%5 = call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%6 = call i32 @TOSH_uwait(i32 7)
%7 = call i32 (...) @TOSH_READ_ADC4_PIN()
store i32 %7, i32* %1
%8 = call i32 @TOSH_uwait(i32 50)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @ds2770_readBit() {
%1 = tail call i32 (...) @TOSH_MAKE_ADC4_OUTPUT()
%2 = tail call i32 (...) @TOSH_CLR_ADC4_PIN()
%3 = tail call i32 @TOSH_uwait(i32 1)
%4 = tail call i32 (...) @TOSH_MAKE_ADC4_INPUT()
%5 = tail call i32 @TOSH_uwait(i32 7)
%6 = tail call i32 (...) @TOSH_READ_ADC4_PIN()
%7 = tail call i32 @TOSH_uwait(i32 50)
ret i32 %6
}
/* Variables and functions */
long mus_char_to_lint(unsigned char *);
long little_long_long(unsigned char *buf) {
  return (mus_char_to_lint((unsigned char *)(buf)));
}


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

x86 assembly (clang, -O2):
<little_long_long>:
jmp    1030 <mus_char_to_lint@plt>

LLVM IR (-O0):
define i64 @little_long_long(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mus_char_to_lint(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @little_long_long(i8* %0) {
%2 = tail call i64 @mus_char_to_lint(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
int main() {
  char a, b, c;
  a = '1';
  b = 'H';
  c = '12';
  printf("a = %c\n b =%c\n c=%c\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x31,-0x5(%rbp)
movb   $0x48,-0x6(%rbp)
movb   $0x32,-0x7(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x6(%rbp),%al
lea    0xec8(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x7(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"a = %c\0A b =%c\0A c=%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 49, i8* %2
store i8 72, i8* %3
store i8 50, i8* %4
%5 = load i8, i8* %2
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6, i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"a = %c\0A b =%c\0A c=%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 49, i8 signext 72, i8 signext 50)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scan_int(int *);
int main3() {
  int a;
  scan_int(&a);
  printf("%d \n", a);
  scan_int(&a);
  printf("%d \n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <scan_int@plt>
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1040 <scan_int@plt>
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main3>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <scan_int@plt>
mov    0x4(%rsp),%esi
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1040 <scan_int@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main3() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scan_int(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @scan_int(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cstring_cmp(const void *a, const void *b) {
  const char **str1 = (const char **)a;
  const char **str2 = (const char **)b;
  return strcmp(*str1, *str2);
}


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

x86 assembly (clang, -O2):
<cstring_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cstring_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
unsigned int random_rand();
_Bool random_boolean(void) {
  return (_Bool)(random_rand() <= (unsigned int)0xFFFFFFFF / 2);
}


x86 assembly (clang, -O0):
<random_boolean>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random_rand@plt>
cmp    $0x7fffffff,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_boolean>:
push   %rax
xor    %eax,%eax
call   1030 <random_rand@plt>
test   %eax,%eax
setns  %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @random_boolean() {
%1 = call i32 (...) @random_rand()
%2 = icmp ule i32 %1, 2147483647
ret i1 %2
}

LLVM IR (-O2):
define zeroext i1 @random_boolean() {
%1 = tail call i32 (...) @random_rand()
%2 = icmp sgt i32 %1, -1
ret i1 %2
}
void XcmsCIELabToCIEXYZ() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELabToCIEXYZ() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct tcphdr {
  int /*<<< orphan*/ ack_seq;
};

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t _tcphdr_ack_seq_ntohl(struct tcphdr *h) { return ntohl(h->ack_seq); }


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

x86 assembly (clang, -O2):
<_tcphdr_ack_seq_ntohl>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_ack_seq_ntohl(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @_tcphdr_ack_seq_ntohl(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohl(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
short __VERIFIER_nondet_short() {
  short initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(short); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_short>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x2,%rax
jae    113f <__VERIFIER_nondet_short+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_short+0x13>
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @__VERIFIER_nondet_short() {
ret i16 undef
}
void jam_strncpy(char *left, char *right, int count) {
  char ch;
  do {
    *left = *right;
    ch = *right;
    ++left;
    ++right;
    --count;
  } while ((ch != '\0') && (count != 0));
}


x86 assembly (clang, -O0):
<jam_strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
movsbl -0x15(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     1161 <jam_strncpy+0x61>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    110f <jam_strncpy+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jam_strncpy>:
add    $0xffffffff,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
je     1128 <jam_strncpy+0x28>
lea    0x1(%rax),%rcx
cmp    %eax,%edx
mov    %rcx,%rax
jne    1110 <jam_strncpy+0x10>
ret

LLVM IR (-O0):
define void @jam_strncpy(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
br label %8
8: ; preds = %27, %3
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
store i8 %10, i8* %11
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
store i8 %13, i8* %7
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
%18 = load i32, i32* %6
%19 = add nsw i32 %18, -1
store i32 %19, i32* %6
br label %20
20: ; preds = %8
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %24, %20
%28 = phi i1 [ false, %20 ], [ %26, %24 ]
br i1 %28, label %8, label %29
29: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @jam_strncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %1, %3 ], [ %11, %4 ]
%6 = phi i32 [ %2, %3 ], [ %12, %4 ]
%7 = phi i8* [ %0, %3 ], [ %10, %4 ]
%8 = load i8, i8* %5
store i8 %8, i8* %7
%9 = load i8, i8* %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = add nsw i32 %6, -1
%13 = icmp ne i8 %9, 0
%14 = icmp ne i32 %12, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %4, label %16
16: ; preds = %4
ret void
}
/* Variables and functions */
long long __divdi3(long long, long long);
long long __gnu_ldivmod_helper(long long a, long long b, long long *remainder) {
  long long quotient;
  quotient = __divdi3(a, b);
  *remainder = a - b * quotient;
  return quotient;
}


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

x86 assembly (clang, -O2):
<__gnu_ldivmod_helper>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <__divdi3@plt>
imul   %rax,%rbx
sub    %rbx,%r15
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @__gnu_ldivmod_helper(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i64 @__divdi3(i64 %8, i64 %9)
store i64 %10, i64* %7
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = mul nsw i64 %12, %13
%15 = sub nsw i64 %11, %14
%16 = load i64*, i64** %6
store i64 %15, i64* %16
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
define i64 @__gnu_ldivmod_helper(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = tail call i64 @__divdi3(i64 %0, i64 %1)
%5 = mul nsw i64 %4, %1
%6 = sub nsw i64 %0, %5
store i64 %6, i64* %2
ret i64 %4
}
int main(argc, argv, envp)
int argc;
char **argv;
char **envp;
{
  int i;
  for (i = 1; i < argc; i++) {
    if (0xff == 0xff) {
      printf("gc%d.%d/%s ", 7, 0, argv[i]);
    } else {
      printf("gc%d.%dalpha%d/%s ", 7, 0, 0xff, argv[i]);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <main+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xeb0(%rip),%rdi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     114e <main+0x3e>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rcx
mov    %r14,%rdi
mov    $0x7,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"gc%d.%d/%s \00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 1, i32* %8
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8**, i8*** %6
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 7, i32 0, i8* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %9
23: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"gc%d.%d/%s \00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 1, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 7, i32 0, i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_ack_pending_bit_for_addr_reset(int);
void nrf_802154_pending_bit_for_addr_reset(bool extended) {
  nrf_802154_ack_pending_bit_for_addr_reset(extended);
}


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

x86 assembly (clang, -O2):
<nrf_802154_pending_bit_for_addr_reset>:
jmp    1030 <nrf_802154_ack_pending_bit_for_addr_reset@plt>

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

LLVM IR (-O2):
define void @nrf_802154_pending_bit_for_addr_reset(i32 %0) {
%2 = tail call i32 @nrf_802154_ack_pending_bit_for_addr_reset(i32 %0)
ret void
}
float sinf(float x) {
  float r;
  if (isinf(x))
    return __domain_error();
  __asm__ __volatile__("fsin" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <isinf@plt>
cmp    $0x0,%eax
je     115b <sinf+0x3b>
mov    $0x0,%al
call   1030 <__domain_error@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <sinf+0x61>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
flds   -0x10(%rbp)
fsin
fstps  -0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <isinf@plt>
test   %eax,%eax
je     114c <sinf+0x2c>
xor    %eax,%eax
call   1030 <__domain_error@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x18,%rsp
ret
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
flds   0x14(%rsp)
fsin
fstps  0x10(%rsp)
movss  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 (...) @__domain_error()
%11 = sitofp i32 %10 to float
store float %11, float* %2
br label %16
12: ; preds = %1
%13 = load float, float* %3
%14 = call float asm sideeffect "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %13)
store float %14, float* %4
%15 = load float, float* %4
store float %15, float* %2
br label %16
16: ; preds = %12, %9
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 (...) @__domain_error()
%7 = sitofp i32 %6 to float
br label %10
8: ; preds = %1
%9 = tail call float asm sideeffect "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void system_shutdown() { system("sleep 5; shutdown -h now"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"sleep 5; shutdown -h now\00"
define void @system_shutdown() {
%1 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"sleep 5; shutdown -h now\00"
define void @system_shutdown() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void noiferr(void) { error("no matching #if..."); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"no matching #if...\00"
define void @noiferr() {
%1 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"no matching #if...\00"
define void @noiferr() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *dvbmc_list_prev(struct list const *, struct list const *);
struct list *dvbmc_list_tail(const struct list *list) {
  return dvbmc_list_prev(list, list);
}


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

x86 assembly (clang, -O2):
<dvbmc_list_tail>:
mov    %rdi,%rsi
jmp    1030 <dvbmc_list_prev@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @dvbmc_list_tail(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list* @dvbmc_list_prev(%struct.list* %3, %struct.list* %4)
ret %struct.list* %5
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @dvbmc_list_tail(%struct.list* %0) {
%2 = tail call %struct.list* @dvbmc_list_prev(%struct.list* %0, %struct.list* %0)
ret %struct.list* %2
}
/* Variables and functions */
int /*<<< orphan*/ PrintTemp(int, int, float, int);
void StageSet(float Temp) { PrintTemp(12, 2, Temp, 2); }


x86 assembly (clang, -O0):
<StageSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0xc,%edi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <PrintTemp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StageSet>:
mov    $0xc,%edi
mov    $0x2,%esi
mov    $0x2,%edx
jmp    1030 <PrintTemp@plt>

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

LLVM IR (-O2):
define void @StageSet(float %0) {
%2 = tail call i32 @PrintTemp(i32 12, i32 2, float %0, i32 2)
ret void
}
void ADC0Seq1_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @ADC0Seq1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ bsp_dma_disable();
int /*<<< orphan*/ bsp_ledsStripes_sendCompleteIRQ();
void bsp_dma_TxCompleteIRQ() {
  bsp_dma_disable();
  bsp_ledsStripes_sendCompleteIRQ();
}


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

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

LLVM IR (-O0):
define void @bsp_dma_TxCompleteIRQ() {
%1 = call i32 (...) @bsp_dma_disable()
%2 = call i32 (...) @bsp_ledsStripes_sendCompleteIRQ()
ret void
}

LLVM IR (-O2):
define void @bsp_dma_TxCompleteIRQ() {
%1 = tail call i32 (...) @bsp_dma_disable()
%2 = tail call i32 (...) @bsp_ledsStripes_sendCompleteIRQ()
ret void
}
/* Variables and functions */
int fls(unsigned long long);
int fls64(unsigned long long x) {
  unsigned long h = x >> 32;
  if (h)
    return fls(h) + 32;
  return fls(x);
}


x86 assembly (clang, -O0):
<fls64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <fls64+0x37>
mov    -0x18(%rbp),%rdi
call   1030 <fls@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fls64+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <fls@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls64>:
mov    %rdi,%rax
shr    $0x20,%rax
jne    111e <fls64+0xe>
jmp    1030 <fls@plt>
push   %rax
mov    %rax,%rdi
call   1030 <fls@plt>
add    $0x20,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fls64(i64 %0) {
%2 = icmp ult i64 %0, 4294967296
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = lshr i64 %0, 32
%5 = tail call i32 @fls(i64 %4)
%6 = add nsw i32 %5, 32
br label %9
7: ; preds = %1
%8 = tail call i32 @fls(i64 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
void printBacktraceIfSegmentationFaultOccurs(void) {}


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

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

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

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