xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ __count;
};
typedef TYPE_1__ mbstate_t;

/* Variables and functions */
int __mbsinit(const mbstate_t *ps) { return ps == NULL || ps->__count == 0; }


x86 assembly (clang, -O0):
<__mbsinit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1126 <__mbsinit+0x26>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mbsinit>:
test   %rdi,%rdi
je     110f <__mbsinit+0xf>
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @__mbsinit(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = icmp eq %struct.TYPE_3__* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @__mbsinit(%struct.TYPE_3__* %0) {
%2 = icmp eq %struct.TYPE_3__* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_sync_pipe() { close(4); }


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

x86 assembly (clang, -O2):
<close_sync_pipe>:
mov    $0x4,%edi
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @close_sync_pipe() {
%1 = call i32 @close(i32 4)
ret void
}

LLVM IR (-O2):
define void @close_sync_pipe() {
%1 = tail call i32 @close(i32 4)
ret void
}
int test_imm_5Bint8_mem(signed char *val) {
  return ((*val) & (-0x5B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Bint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Bint8_mem>:
testb  $0xa5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -91
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: list_path"
                        " [<path> ...\n]");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: list_path [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: list_path [<path> ...\0A]\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct eb_root {
  int dummy;
};
struct eb128_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eb128_compose_264(int /*<<< orphan*/ const,
                                     int /*<<< orphan*/ const);
struct eb128_node *eb128_lookup_le(struct eb_root *const, int /*<<< orphan*/);
struct eb128_node *eb128_lookup_le_264(struct eb_root *const root,
                                       const uint64_t lo, const uint64_t hi) {
  return eb128_lookup_le(root, eb128_compose_264(lo, hi));
}


x86 assembly (clang, -O0):
<eb128_lookup_le_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <eb128_lookup_le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128_lookup_le_264>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <eb128_compose_264@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <eb128_lookup_le@plt>

LLVM IR (-O0):
%struct.eb128_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.eb128_node* @eb128_lookup_le_264(%struct.eb_root* %0, i32 %1, i32 %2) {
%4 = alloca %struct.eb_root*
%5 = alloca i32
%6 = alloca i32
store %struct.eb_root* %0, %struct.eb_root** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.eb_root*, %struct.eb_root** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @eb128_compose_264(i32 %8, i32 %9)
%11 = call %struct.eb128_node* @eb128_lookup_le(%struct.eb_root* %7, i32 %10)
ret %struct.eb128_node* %11
}

LLVM IR (-O2):
%struct.eb128_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.eb128_node* @eb128_lookup_le_264(%struct.eb_root* %0, i32 %1, i32 %2) {
%4 = tail call i32 @eb128_compose_264(i32 %1, i32 %2)
%5 = tail call %struct.eb128_node* @eb128_lookup_le(%struct.eb_root* %0, i32 %4)
ret %struct.eb128_node* %5
}
/* Variables and functions */
int __syscall_execve(char const *, char *const *, char *const *);
int execve(const char *filename, char *const *argv, char *const *envp) {
  return __syscall_execve(filename, argv, envp);
}


x86 assembly (clang, -O0):
<execve>:
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
call   1030 <__syscall_execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
jmp    1030 <__syscall_execve@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @__syscall_execve(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
/* Variables and functions */
unsigned int _blsr_u32(unsigned int);
unsigned int test_blsr_u32(unsigned int __X) { return _blsr_u32(__X); }


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

x86 assembly (clang, -O2):
<test_blsr_u32>:
jmp    1030 <_blsr_u32@plt>

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

LLVM IR (-O2):
define i32 @test_blsr_u32(i32 %0) {
%2 = tail call i32 @_blsr_u32(i32 %0)
ret i32 %2
}
void BS2PP_FlushToken(char *str) {}


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

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

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

LLVM IR (-O2):
define void @BS2PP_FlushToken(i8* nocapture %0) {
ret void
}
void debuginator_trigger_nondefault_notifications(
    struct TheDebuginator *debuginator) {
  ((void)debuginator);
}


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

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

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

LLVM IR (-O2):
%struct.TheDebuginator = type opaque
define void @debuginator_trigger_nondefault_notifications(%struct.TheDebuginator* nocapture %0) {
ret void
}
double SFMStallCoeff(double current_speed, double stall_speed,
                     double speed_max) {
  if (current_speed > stall_speed)
    return (0.0);
  else if (stall_speed <= 0.0)
    return (0.0);
  else if (current_speed <= 0.0)
    return (1.0);
  else
    return (1.0 - (current_speed / stall_speed));
}


x86 assembly (clang, -O0):
<SFMStallCoeff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1130 <SFMStallCoeff+0x30>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <SFMStallCoeff+0x86>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     114b <SFMStallCoeff+0x4b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <SFMStallCoeff+0x86>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     116b <SFMStallCoeff+0x6b>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <SFMStallCoeff+0x86>
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xe83(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SFMStallCoeff>:
movapd %xmm0,%xmm2
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
ja     112e <SFMStallCoeff+0x2e>
xorpd  %xmm3,%xmm3
ucomisd %xmm1,%xmm3
jae    112e <SFMStallCoeff+0x2e>
ucomisd %xmm2,%xmm3
jae    112f <SFMStallCoeff+0x2f>
divsd  %xmm1,%xmm2
movsd  0xed6(%rip),%xmm0
subsd  %xmm2,%xmm0
ret
movsd  0xec9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SFMStallCoeff(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0.000000e+00, double* %4
br label %25
12: ; preds = %3
%13 = load double, double* %6
%14 = fcmp ole double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 0.000000e+00, double* %4
br label %25
16: ; preds = %12
%17 = load double, double* %5
%18 = fcmp ole double %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %16
store double 1.000000e+00, double* %4
br label %25
20: ; preds = %16
%21 = load double, double* %5
%22 = load double, double* %6
%23 = fdiv double %21, %22
%24 = fsub double 1.000000e+00, %23
store double %24, double* %4
br label %25
25: ; preds = %20, %19, %15, %11
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @SFMStallCoeff(double %0, double %1, double %2) {
%4 = fcmp ule double %0, %1
%5 = fcmp ugt double %1, 0.000000e+00
%6 = and i1 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = fcmp ugt double %0, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = fdiv double %0, %1
%11 = fsub double 1.000000e+00, %10
br label %12
12: ; preds = %7, %3, %9
%13 = phi double [ %11, %9 ], [ 0.000000e+00, %3 ], [ 1.000000e+00, %7 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ japi_release(int);
void j_release(int arg0) { japi_release(arg0); }


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

x86 assembly (clang, -O2):
<j_release>:
jmp    1030 <japi_release@plt>

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

LLVM IR (-O2):
define void @j_release(i32 %0) {
%2 = tail call i32 @japi_release(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *readline(const char *prompt) {
  char *result = malloc(1024);
  printf("%s", prompt);
  fgets(result, 1023, stdin);
  result[strlen(result) - 1] = 0;
  return result;
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xea5(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i8* @readline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 1024)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 1023, i32 %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i8* @readline(i8* %0) {
%2 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgets(i8* %2, i32 1023, i32 %4)
%6 = tail call i32 @strlen(i8* %2)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
store i8 0, i8* %9
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *proc) { fprintf(stderr, "usage: %s [-f] [-k key]\n", proc); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"usage: %s [-f] [-k key]\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 ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"usage: %s [-f] [-k key]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
uint32_t start_cmd_version(char *optarg) {
  printf("Version: %s\n", "POFSwitch-1.3.4-kernel");
  exit(0);
}


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

x86 assembly (clang, -O2):
<start_cmd_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [23 x i8] c"POFSwitch-1.3.4-kernel\00"
define i32 @start_cmd_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [23 x i8] c"POFSwitch-1.3.4-kernel\00"
define i32 @start_cmd_version(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pad_set(int, int);
int(cmd_left)(int c, char **v) {
  pad_set((0x02), v[0][0] == '+');
  return 0;
}


x86 assembly (clang, -O0):
<cmd_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    $0x2,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_left>:
push   %rax
mov    (%rsi),%rax
xor    %esi,%esi
cmpb   $0x2b,(%rax)
sete   %sil
mov    $0x2,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_left(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
%12 = zext i1 %11 to i32
%13 = call i32 @pad_set(i32 2, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_left(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 43
%6 = zext i1 %5 to i32
%7 = tail call i32 @pad_set(i32 2, i32 %6)
ret i32 0
}
int benchmark_initbatch(void *tsd) {
  ;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @benchmark_initbatch(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _base64_check_decode(char const *, size_t, char const *);
int /*<<< orphan*/ _base64_check_encode(char const *, size_t, char const *);
void _base64_test_vector(const char *decoded, size_t decoded_len,
                         const char *encoded) {
  _base64_check_encode(decoded, decoded_len, encoded);
  _base64_check_decode(decoded, decoded_len, encoded);
}


x86 assembly (clang, -O0):
<_base64_test_vector>:
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
call   1030 <_base64_check_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <_base64_check_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_base64_test_vector>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <_base64_check_encode@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <_base64_check_decode@plt>

LLVM IR (-O0):
define void @_base64_test_vector(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @_base64_check_encode(i8* %7, i64 %8, i8* %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = load i8*, i8** %6
%14 = call i32 @_base64_check_decode(i8* %11, i64 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @_base64_test_vector(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @_base64_check_encode(i8* %0, i64 %1, i8* %2)
%5 = tail call i32 @_base64_check_decode(i8* %0, i64 %1, i8* %2)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *find_id_position(char *str, int times) {
  int i;
  for (i = 1; i <= times; ++i)
    str = strchr(str, ':') + 1;
  return str;
}


x86 assembly (clang, -O0):
<find_id_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1156 <find_id_position+0x46>
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <find_id_position+0x16>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_id_position>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
jle    1136 <find_id_position+0x26>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
add    $0xffffffff,%ebx
jne    1120 <find_id_position+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @find_id_position(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = tail call i8* @strchr(i8* dereferenceable(1) %6, i8 signext 58)
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw i32 %5, 1
%10 = icmp eq i32 %5, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i8* [ %0, %2 ], [ %8, %4 ]
ret i8* %12
}
long div(int n) {
  long p = ((long)999) / n;
  return n * (p * (p + 1)) / 2;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x3e7,%eax
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
movslq %edi,%rcx
mov    $0x3e7,%eax
xor    %edx,%edx
idiv   %ecx
movslq %eax,%rdx
lea    0x1(%rdx),%rax
imul   %rcx,%rdx
imul   %rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
sar    %rax
ret

LLVM IR (-O0):
define i64 @div(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = sdiv i64 999, %5
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
%12 = mul nsw i64 %9, %11
%13 = mul nsw i64 %8, %12
%14 = sdiv i64 %13, 2
ret i64 %14
}

LLVM IR (-O2):
define i64 @div(i32 %0) {
%2 = sext i32 %0 to i64
%3 = sdiv i32 999, %0
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 1
%6 = mul nsw i64 %4, %2
%7 = mul nsw i64 %6, %5
%8 = sdiv i64 %7, 2
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void teleinfo_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<teleinfo_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @teleinfo_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ apic_write(int, int);
void init_timer(void) {
  apic_write(0x320, (1 << 17) | (1 << 16) | (0 << 12) | (0 << 0));
  apic_write(0x3E0, 0xB);
  apic_write(0x380, 0xffffffff);
}


x86 assembly (clang, -O0):
<init_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x320,%edi
mov    $0x30000,%esi
call   1030 <apic_write@plt>
mov    $0x3e0,%edi
mov    $0xb,%esi
call   1030 <apic_write@plt>
mov    $0x380,%edi
mov    $0xffffffff,%esi
call   1030 <apic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_timer>:
push   %rax
mov    $0x320,%edi
mov    $0x30000,%esi
call   1030 <apic_write@plt>
mov    $0x3e0,%edi
mov    $0xb,%esi
call   1030 <apic_write@plt>
mov    $0x380,%edi
mov    $0xffffffff,%esi
pop    %rax
jmp    1030 <apic_write@plt>

LLVM IR (-O0):
define void @init_timer() {
%1 = call i32 @apic_write(i32 800, i32 196608)
%2 = call i32 @apic_write(i32 992, i32 11)
%3 = call i32 @apic_write(i32 896, i32 -1)
ret void
}

LLVM IR (-O2):
define void @init_timer() {
%1 = tail call i32 @apic_write(i32 800, i32 196608)
%2 = tail call i32 @apic_write(i32 992, i32 11)
%3 = tail call i32 @apic_write(i32 896, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const);
void usage(const char *const exe) {
  printf("Usage: %s [-h] [-q] [-r] [-t<n>] <m>\n"
         "-h: display this information.\n"
         "-q: quiet mode -- do not print computed error.\n",
         exe);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [115 x i8] c"Usage: %s [-h] [-q] [-r] [-t<n>] <m>\0A-h: display this information.\0A-q: quiet mode -- do not print computed error.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [115 x i8] c"Usage: %s [-h] [-q] [-r] [-t<n>] <m>\0A-h: display this information.\0A-q: quiet mode -- do not print computed error.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wan_plxctrl_write8(void *, int, int);
int wan_plxctrl_erase(void *info) {
  int t;
  for (t = 0; t < 0xFF; t++) {
    wan_plxctrl_write8(info, t, 0xFF);
  }
  return 0;
}


x86 assembly (clang, -O0):
<wan_plxctrl_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    114f <wan_plxctrl_erase+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xff,%edx
call   1030 <wan_plxctrl_write8@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <wan_plxctrl_erase+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wan_plxctrl_erase>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xff,%edx
call   1030 <wan_plxctrl_write8@plt>
add    $0x1,%ebp
cmp    $0xff,%ebp
jne    1120 <wan_plxctrl_erase+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @wan_plxctrl_erase(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @wan_plxctrl_write8(i8* %0, i32 %3, i32 255)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_bool();
void foo() {
  int y = 0;
  int c1 = __VERIFIER_nondet_bool(), c2 = __VERIFIER_nondet_bool();
  if (c1)
    y++;
  if (c2)
    y--;
  else
    y += 10;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_bool@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_bool@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1146 <foo+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115e <foo+0x4e>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <foo+0x57>
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_bool@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__VERIFIER_nondet_bool@plt>

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @__VERIFIER_nondet_bool()
%2 = tail call i32 (...) @__VERIFIER_nondet_bool()
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double randMax(double fMax) { return ((double)rand() / RAND_MAX) * fMax; }


x86 assembly (clang, -O0):
<randMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb8(%rip),%rax
divsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randMax>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm1
mov    0x2ebf(%rip),%rax
divsd  (%rax),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randMax(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randMax(double %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = fmul double %5, %0
ret double %6
}
void g_date_valid_month() {}


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

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

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

LLVM IR (-O2):
define void @g_date_valid_month() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCSPGRP;
int ioctl(int, int /*<<< orphan*/, int *);
int tcsetpgrp(int fd, pid_t pgrp) {
  int pgrp_int = pgrp;
  return ioctl(fd, TIOCSPGRP, &pgrp_int);
}


x86 assembly (clang, -O0):
<tcsetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetpgrp>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* @TIOCSPGRP
%9 = call i32 @ioctl(i32 %7, i32 %8, i32* %5)
ret i32 %9
}

LLVM IR (-O2):
@TIOCSPGRP = global i32 0
define i32 @tcsetpgrp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %1, i32* %3
%5 = load i32, i32* @TIOCSPGRP
%6 = call i32 @ioctl(i32 %0, i32 %5, i32* %3)
ret i32 %6
}
void print_disk_util(struct disk_util_stat *du, struct disk_util_agg *agg,
                     int terse) {}


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

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

LLVM IR (-O0):
%struct.disk_util_stat = type opaque
%struct.disk_util_agg = type opaque
define void @print_disk_util(%struct.disk_util_stat* %0, %struct.disk_util_agg* %1, i32 %2) {
%4 = alloca %struct.disk_util_stat*
%5 = alloca %struct.disk_util_agg*
%6 = alloca i32
store %struct.disk_util_stat* %0, %struct.disk_util_stat** %4
store %struct.disk_util_agg* %1, %struct.disk_util_agg** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.disk_util_stat = type opaque
%struct.disk_util_agg = type opaque
define void @print_disk_util(%struct.disk_util_stat* nocapture %0, %struct.disk_util_agg* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430UartP__0__Counter__overflow();
int /*<<< orphan*/ TransformCounterC__0__CounterFrom__overflow();
int /*<<< orphan*/ TransformCounterC__1__CounterFrom__overflow();
void Msp430CounterC__0__Counter__overflow(void) {
  TransformCounterC__1__CounterFrom__overflow();
  Msp430UartP__0__Counter__overflow();
  TransformCounterC__0__CounterFrom__overflow();
}


x86 assembly (clang, -O0):
<Msp430CounterC__0__Counter__overflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <TransformCounterC__1__CounterFrom__overflow@plt>
mov    $0x0,%al
call   1050 <Msp430UartP__0__Counter__overflow@plt>
mov    $0x0,%al
call   1030 <TransformCounterC__0__CounterFrom__overflow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Msp430CounterC__0__Counter__overflow>:
push   %rax
xor    %eax,%eax
call   1040 <TransformCounterC__1__CounterFrom__overflow@plt>
xor    %eax,%eax
call   1050 <Msp430UartP__0__Counter__overflow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <TransformCounterC__0__CounterFrom__overflow@plt>

LLVM IR (-O0):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%2 = call i32 (...) @Msp430UartP__0__Counter__overflow()
%3 = call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}

LLVM IR (-O2):
define void @Msp430CounterC__0__Counter__overflow() {
%1 = tail call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
%2 = tail call i32 (...) @Msp430UartP__0__Counter__overflow()
%3 = tail call i32 (...) @TransformCounterC__0__CounterFrom__overflow()
ret void
}
int isEven(int n) { return (n % 2 == 0); }


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isEven(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *alloc_mem(short length) {
  char *buf = NULL;
  buf = (char *)malloc((size_t)length + 1);
  if (!buf) {
    fprintf(stderr, "i2c: cannot allocate memory\n");
    perror("i2c: parse_cmd");
  }
  return buf;
}


x86 assembly (clang, -O0):
<alloc_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movq   $0x0,-0x10(%rbp)
movswq -0x2(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1185 <alloc_mem+0x55>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_mem>:
push   %rbx
movslq %edi,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114a <alloc_mem+0x1a>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <perror@plt>
jmp    1145 <alloc_mem+0x15>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"i2c: cannot allocate memory\0A\00"
@.str.1 = [15 x i8] c"i2c: parse_cmd\00"
define i8* @alloc_mem(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
store i8* null, i8** %3
%4 = load i16, i16* %2
%5 = sext i16 %4 to i64
%6 = add i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"i2c: cannot allocate memory\0A\00"
@.str.1 = [15 x i8] c"i2c: parse_cmd\00"
define i8* @alloc_mem(i16 signext %0) {
%2 = sext i16 %0 to i64
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %6, %1
%11 = inttoptr i64 %4 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ cmp_int_helper(int, int, int);
void test_cmp_ints() {
  cmp_int_helper(0, 0, 0);
  cmp_int_helper(1, 0, 1);
  cmp_int_helper(0, 1, -1);
  cmp_int_helper(12345, -12345, 1);
  cmp_int_helper(-12345, 12345, -1);
}


x86 assembly (clang, -O0):
<test_cmp_ints>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <cmp_int_helper@plt>
mov    $0x1,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1030 <cmp_int_helper@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <cmp_int_helper@plt>
mov    $0x3039,%edi
mov    $0xffffcfc7,%esi
mov    $0x1,%edx
call   1030 <cmp_int_helper@plt>
mov    $0xffffcfc7,%edi
mov    $0x3039,%esi
mov    $0xffffffff,%edx
call   1030 <cmp_int_helper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cmp_ints>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <cmp_int_helper@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <cmp_int_helper@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <cmp_int_helper@plt>
mov    $0x3039,%edi
mov    $0xffffcfc7,%esi
mov    $0x1,%edx
call   1030 <cmp_int_helper@plt>
mov    $0xffffcfc7,%edi
mov    $0x3039,%esi
mov    $0xffffffff,%edx
pop    %rax
jmp    1030 <cmp_int_helper@plt>

LLVM IR (-O0):
define void @test_cmp_ints() {
%1 = call i32 @cmp_int_helper(i32 0, i32 0, i32 0)
%2 = call i32 @cmp_int_helper(i32 1, i32 0, i32 1)
%3 = call i32 @cmp_int_helper(i32 0, i32 1, i32 -1)
%4 = call i32 @cmp_int_helper(i32 12345, i32 -12345, i32 1)
%5 = call i32 @cmp_int_helper(i32 -12345, i32 12345, i32 -1)
ret void
}

LLVM IR (-O2):
define void @test_cmp_ints() {
%1 = tail call i32 @cmp_int_helper(i32 0, i32 0, i32 0)
%2 = tail call i32 @cmp_int_helper(i32 1, i32 0, i32 1)
%3 = tail call i32 @cmp_int_helper(i32 0, i32 1, i32 -1)
%4 = tail call i32 @cmp_int_helper(i32 12345, i32 -12345, i32 1)
%5 = tail call i32 @cmp_int_helper(i32 -12345, i32 12345, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ boki(int, int);
int /*<<< orphan*/ podstawa(int);
void prostokat(int szerokosc, int wysokosc) {
  podstawa(szerokosc);
  boki(szerokosc, wysokosc - 2);
  podstawa(szerokosc);
}


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

x86 assembly (clang, -O2):
<prostokat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <podstawa@plt>
add    $0xfffffffe,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <boki@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <podstawa@plt>

LLVM IR (-O0):
define void @prostokat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @podstawa(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 2
%10 = call i32 @boki(i32 %7, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @podstawa(i32 %11)
ret void
}

LLVM IR (-O2):
define void @prostokat(i32 %0, i32 %1) {
%3 = tail call i32 @podstawa(i32 %0)
%4 = add nsw i32 %1, -2
%5 = tail call i32 @boki(i32 %0, i32 %4)
%6 = tail call i32 @podstawa(i32 %0)
ret void
}
char rgx_lower(char c) {
  if (c >= 'a' && c <= 'z')
    return c;
  return c - 'A' + 'a';
}


x86 assembly (clang, -O0):
<rgx_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     112f <rgx_lower+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     112f <rgx_lower+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    113c <rgx_lower+0x3c>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgx_lower>:
lea    -0x61(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @rgx_lower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %19
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 65
%17 = add nsw i32 %16, 97
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %19
19: ; preds = %13, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @rgx_lower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
unsigned xrop3_209_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_209_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_209_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %edx,%eax
xor    $0xff,%eax
or     %ecx,%eax
xor    %edx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_209_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_209_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %6, %8
%10 = xor i32 %9, -1
ret i32 %10
}