xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
__attribute__((always_)) void tu_move_right(int delta_x) {
  printf("\x1b[%dC", delta_x);
}


x86 assembly (clang, -O0):
<tu_move_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_move_right>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dC\00"
define void @tu_move_right(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "usage: %s [chip] register [value]\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [35 x i8] c"usage: %s [chip] register [value]\0A\00"
define void @usage(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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s [chip] register [value]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void math_sin(void) {
  double d = luaL_check_number(1);
  lua_pushnumber(sin(((d)*3.14159265358979323846 / 180.0)));
}


x86 assembly (clang, -O0):
<math_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sin@plt>
mov    $0x1,%al
call   1050 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_sin>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xeb7(%rip),%xmm0
divsd  0xeb7(%rip),%xmm0
call   1040 <sin@plt>
mov    $0x1,%al
pop    %rcx
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_sin() {
%1 = alloca double
%2 = call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = call double @sin(double %6)
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
define void @math_sin() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @sin(double %4)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "stdout\n");
  fflush(stdout);
  fprintf(stderr, "stderr\n");
  fflush(stderr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0x2e9c(%rip),%rbx
mov    (%rbx),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"stdout\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"stderr\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"stdout\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"stderr\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doit(int);
int main() {
  doit(42);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <doit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doit(i32 42)
ret i32 0
}
int is_dead(int *current, int length) {
  int counter;
  for (counter = 0; counter < length - 1; counter++) {
    if (*(current + counter) != 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_dead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1154 <is_dead+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1141 <is_dead+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <is_dead+0x5b>
jmp    1146 <is_dead+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_dead+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dead>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     111f <is_dead+0x1f>
add    $0xffffffff,%esi
xor    %ecx,%ecx
nop
cmpl   $0x0,(%rdi,%rcx,4)
jne    1120 <is_dead+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <is_dead+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_dead(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %4, %7
%10 = phi i64 [ 0, %4 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %7, label %15
15: ; preds = %9, %7, %2
%16 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ hideCursor_24064();
void hideCursor(void) { hideCursor_24064(); }


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

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

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

LLVM IR (-O2):
define void @hideCursor() {
%1 = tail call i32 (...) @hideCursor_24064()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get32(uint8_t *buf) {
  return (uint32_t)buf[0] + ((uint32_t)buf[1] << 8) + ((uint32_t)buf[2] << 16) +
         ((uint32_t)buf[3] << 24);
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
mov    0x8(%rdi),%eax
mov    0x10(%rdi),%ecx
shl    $0x8,%eax
add    (%rdi),%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get32(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 3
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i32
%23 = shl i32 %22, 24
%24 = add nsw i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = add nsw i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = add nsw i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i = 1;
  printf("%d\n", 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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, unsigned int, int);
int main(void) {
  short val1 = -12345;
  unsigned short cast_val1 = (unsigned short)val1;
  printf("val1=%d\tcast_val1=%d\n", val1, cast_val1);
  unsigned val2 = 4294967295U;
  int cast_val2 = (int)val2;
  printf("val2=%u\tcast_val2=%d\n", val2, cast_val2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xcfc7,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%esi
movzwl -0x8(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"val1=%d\09cast_val1=%d\0A\00"
@.str.1 = [22 x i8] c"val2=%u\09cast_val2=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i16 -12345, i16* %2
%6 = load i16, i16* %2
store i16 %6, i16* %3
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
store i32 -1, i32* %4
%12 = load i32, i32* %4
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"val1=%d\09cast_val1=%d\0A\00"
@.str.1 = [22 x i8] c"val2=%u\09cast_val2=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -12345, i32 53191)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 -1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
OP(ed, b5) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int wps_validate_m4(const struct wpabuf *tlvs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m4(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
void exynos_get_idle_ip_list(char *(*idle_ip_list)[32]) { return; }


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

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

LLVM IR (-O0):
define void @exynos_get_idle_ip_list([32 x i8*]* %0) {
%2 = alloca [32 x i8*]*
store [32 x i8*]* %0, [32 x i8*]** %2
ret void
}

LLVM IR (-O2):
define void @exynos_get_idle_ip_list([32 x i8*]* nocapture %0) {
ret void
}
char console_get_ticks(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @console_get_ticks() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @console_get_ticks() {
ret i8 0
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getusec(struct timeval *tv) {
  struct timeval tv_l;
  if (tv == NULL) {
    tv = &tv_l;
    gettimeofday(tv, NULL);
  }
  return (uint64_t)tv->tv_sec * 1000000 + tv->tv_usec;
}


x86 assembly (clang, -O0):
<getusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <getusec+0x2c>
lea    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0xf4240,%eax,%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusec>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
test   %rdi,%rdi
jne    112a <getusec+0x1a>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rbx),%eax
add    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @getusec(%struct.timeval* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = icmp eq %struct.timeval* %0, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
br label %7
7: ; preds = %5, %1
%8 = phi %struct.timeval* [ %2, %5 ], [ %0, %1 ]
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i64 0, i32 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i64 0, i32 0
%14 = load i32, i32* %13
%15 = add nsw i32 %12, %14
ret i32 %15
}
void LPS25H_IO_ITConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @LPS25H_IO_ITConfig() {
ret void
}
int fun712() { return 712; }


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

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

LLVM IR (-O0):
define i32 @fun712() {
ret i32 712
}

LLVM IR (-O2):
define i32 @fun712() {
ret i32 712
}
int main(void) {
  unsigned int o = 1;
  unsigned int z = 0;
  return (int)(o / z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
/* Variables and functions */
double __nv_erf(double);
double erf(double __a) { return __nv_erf(__a); }


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

x86 assembly (clang, -O2):
<erf>:
jmp    1030 <__nv_erf@plt>

LLVM IR (-O0):
define double @erf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__nv_erf(double %3)
ret double %4
}

LLVM IR (-O2):
define double @erf(double %0) {
%2 = tail call double @__nv_erf(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int current_setting(char *path) {
  int current;
  FILE *f = fopen(path, "r");
  if (f == NULL) {
    return 0;
  }
  current = fgetc(f);
  fclose(f);
  if (current == 48) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<current_setting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <current_setting+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1199 <current_setting+0x69>
mov    -0x20(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x30,-0x14(%rbp)
jne    1192 <current_setting+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1199 <current_setting+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_setting>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1163 <current_setting+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
cmp    $0x30,%ebp
setne  %al
jmp    1165 <current_setting+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @current_setting(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %20
11: ; preds = %1
%12 = load i32*, i32** %5
%13 = call i32 @fgetc(i32* %12)
store i32 %13, i32* %4
%14 = load i32*, i32** %5
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 48
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 0, i32* %2
br label %20
19: ; preds = %11
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18, %10
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @current_setting(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @fgetc(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
%7 = icmp ne i32 %5, 48
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void cfs_memory_pressure_restore(int old) {
  if (old)
    do {
    } while (0);
  else
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<cfs_memory_pressure_restore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1120 <cfs_memory_pressure_restore+0x20>
jmp    1116 <cfs_memory_pressure_restore+0x16>
jmp    111b <cfs_memory_pressure_restore+0x1b>
jmp    112f <cfs_memory_pressure_restore+0x2f>
jmp    1125 <cfs_memory_pressure_restore+0x25>
jmp    112a <cfs_memory_pressure_restore+0x2a>
jmp    112f <cfs_memory_pressure_restore+0x2f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cfs_memory_pressure_restore(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gu_free2d(void *pp) {
  void *p;
  p = ((void **)pp)[0];
  free(pp);
  free(p);
}


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

x86 assembly (clang, -O2):
<gu_free2d>:
push   %rbx
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @gu_free2d(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @gu_free2d(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %0)
%5 = tail call i32 @free(i8* %3)
ret void
}
void tdefault_update_thread_list(struct target_ops *self) {}


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define void @tdefault_update_thread_list(%struct.target_ops* nocapture %0) {
ret void
}
unsigned char DropsBelowThreshold(int initial, int delta, int threshold) {
  return ((initial >= threshold) && (initial + delta < threshold));
}


x86 assembly (clang, -O0):
<DropsBelowThreshold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112d <DropsBelowThreshold+0x2d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DropsBelowThreshold>:
cmp    %edx,%edi
setge  %cl
add    %edi,%esi
cmp    %edx,%esi
setl   %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @DropsBelowThreshold(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* %6
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br label %16
16: ; preds = %10, %3
%17 = phi i1 [ false, %3 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @DropsBelowThreshold(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %2
%5 = add nsw i32 %1, %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts(("Usage: icalc [parameters]\n  Interval calculator-intepreter with "
        "assembly syntax.\n  It reads stdin and writes into stdout.\n    "
        "Parameters:\n    -h, --help      This help\n    -v, --version   "
        "Version info\n    -W              Exit on errors\n\n    Supported "
        "commands:\n      mov, xchg,\n      add, sub, mul, div, neg, sqrt, "
        "inv, inc, dec,\n      sin, cos, tan, cot, asin, acos, atan, acot,\n   "
        "   jmp, cmp, je, jne, jgt, jge, jlt, jle, jin, jout,\n      nop, hlt, "
        "out, free, ret, call.\n"));
}


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

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

LLVM IR (-O0):
@.str = [475 x i8] c"Usage: icalc [parameters]\0A Interval calculator-intepreter with assembly syntax.\0A It reads stdin and writes into stdout.\0A Parameters:\0A -h, --help This help\0A -v, --version Version info\0A -W Exit on errors\0A\0A Supported commands:\0A mov, xchg,\0A add, sub, mul, div, neg, sqrt, inv, inc, dec,\0A sin, cos, tan, cot, asin, acos, atan, acot,\0A jmp, cmp, je, jne, jgt, jge, jlt, jle, jin, jout,\0A nop, hlt, out, free, ret, call.\0A\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([475 x i8], [475 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [475 x i8] c"Usage: icalc [parameters]\0A Interval calculator-intepreter with assembly syntax.\0A It reads stdin and writes into stdout.\0A Parameters:\0A -h, --help This help\0A -v, --version Version info\0A -W Exit on errors\0A\0A Supported commands:\0A mov, xchg,\0A add, sub, mul, div, neg, sqrt, inv, inc, dec,\0A sin, cos, tan, cot, asin, acos, atan, acot,\0A jmp, cmp, je, jne, jgt, jge, jlt, jle, jin, jout,\0A nop, hlt, out, free, ret, call.\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([475 x i8], [475 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x82() {
  Assert_real((isalnum(130) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              655, ("isalnum should be 0 for 0x82"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x82\00"
define void @t_isalnum_0x82() {
%1 = call i64 @isalnum(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x82\00"
define void @t_isalnum_0x82() {
%1 = tail call i64 @isalnum(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cycles_iterative(int n) {
  int cycl = 1;
  while (n > 1) {
    if ((n % 2) == 0) {
      n = n / 2;
    } else {
      n = (3 * n) + 1;
    }
    cycl++;
  }
  return cycl;
}


x86 assembly (clang, -O0):
<cycles_iterative>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1157 <cycles_iterative+0x57>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <cycles_iterative+0x3f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1149 <cycles_iterative+0x49>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <cycles_iterative+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycles_iterative>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1127 <cycles_iterative+0x27>
mov    $0x1,%eax
nop
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
jg     1110 <cycles_iterative+0x10>
ret

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

LLVM IR (-O2):
define i32 @cycles_iterative(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 1, %1 ]
%5 = phi i32 [ %11, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = lshr i32 %5, 1
%9 = mul nsw i32 %5, 3
%10 = add nsw i32 %9, 1
%11 = select i1 %7, i32 %8, i32 %10
%12 = add nuw nsw i32 %4, 1
%13 = icmp sgt i32 %11, 1
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %12, %3 ]
ret i32 %15
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fail();
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ report_and_exit();
char *strerror(int);
void error_exit(char *what) {
  int code = errno;
  printf("error_message=%s %s\n", what, strerror(code));
  fail();
  report_and_exit();
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <fail@plt>
mov    $0x0,%al
call   1040 <report_and_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_exit>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <fail@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <report_and_exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [21 x i8] c"error_message=%s %s\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
%9 = call i32 (...) @fail()
%10 = call i32 (...) @report_and_exit()
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [21 x i8] c"error_message=%s %s\0A\00"
define void @error_exit(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 (...) @fail()
%6 = tail call i32 (...) @report_and_exit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPrivateKey_it;
RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len) {
  return (RSA *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &RSAPrivateKey_it);
}


x86 assembly (clang, -O0):
<d2i_RSAPrivateKey>:
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
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_RSAPrivateKey>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@RSAPrivateKey_it = global i32 0
define i32* @d2i_RSAPrivateKey(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @RSAPrivateKey_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@RSAPrivateKey_it = global i32 0
define i32* @d2i_RSAPrivateKey(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @RSAPrivateKey_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int test_imm_B1uint8_reg(unsigned char val) {
  return ((val) & (0xB1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B1uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -79
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ slave_dismissed();
int /*<<< orphan*/ slave_update();
int main() {
  while (!slave_dismissed()) {
    slave_update();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <slave_dismissed@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114b <main+0x2b>
jmp    1157 <main+0x37>
mov    $0x0,%al
call   1040 <slave_update@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <slave_dismissed@plt>
test   %eax,%eax
jne    1144 <main+0x24>
xor    %eax,%eax
call   1040 <slave_update@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @slave_dismissed()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @slave_update()
br label %2
8: ; preds = %2
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @slave_dismissed()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @slave_update()
%5 = tail call i32 (...) @slave_dismissed()
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef scalar_t__ x;
typedef int uint16_t;

/* Variables and functions */
extern uint16_t __swab16(uint16_t x) {
  return ((uint16_t)((((uint16_t)(x) & (uint16_t)0x00FF) << 8) |
                     (((uint16_t)(x) & (uint16_t)0xFF00) >> 8)));
}


x86 assembly (clang, -O0):
<__swab16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swab16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @__swab16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__swab16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cond_init(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
void usbi_cond_init(pthread_cond_t *cond) {
  (void)pthread_cond_init(cond, NULL);
}


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

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

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

LLVM IR (-O2):
define void @usbi_cond_init(i32* %0) {
%2 = tail call i32 @pthread_cond_init(i32* %0, i32* null)
ret void
}
void g_idle_add_full() {}


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

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

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

LLVM IR (-O2):
define void @g_idle_add_full() {
ret void
}
void wtypeInt_delete(void **wtypePtr) { (void)wtypePtr; }


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

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

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

LLVM IR (-O2):
define void @wtypeInt_delete(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int do_test(void) {
  if (foo(2) != 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <foo@plt>
cmp    $0x3,%eax
je     113e <do_test+0x1e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
mov    $0x2,%edi
call   1040 <foo@plt>
cmp    $0x3,%eax
jne    1134 <do_test+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @do_test() {
%1 = call i32 @foo(i32 2)
%2 = icmp ne i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @do_test() {
%1 = tail call i32 @foo(i32 2)
%2 = icmp eq i32 %1, 3
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
char *g(char *outstr) { return outstr; }


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

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @g(i8* readnone returned %0) {
ret i8* %0
}
void swap(int *array, int i, int j) {
  if (i == j)
    return;
  unsigned temp = array[i];
  array[i] = array[j];
  array[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    111f <swap+0x1f>
jmp    1151 <swap+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1116 <swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %3, %5
ret void
}