xunge/DecIR huggingface dataset:
int iscntrl(int c) { return (c == 0x7f) || (c < 0x1f); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x7f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <iscntrl+0x20>
cmpl   $0x1f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x7f,%edi
sete   %al
cmp    $0x1f,%edi
setl   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 127
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 31
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp eq i32 %0, 127
%3 = icmp slt i32 %0, 31
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void zzAKSC_InitHDOEProcPrmsS3(void) {}


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

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

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

LLVM IR (-O2):
define void @zzAKSC_InitHDOEProcPrmsS3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void _err(int _en, char *str) {
  fprintf(stderr, "%s: %s\n", str, strerror(_en));
}


x86 assembly (clang, -O0):
<_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_err>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
call   1040 <strerror@plt>
lea    0xec5(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @_err(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %0)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
struct passwd *getpwuid(scalar_t__);
int /*<<< orphan*/ prt_passwd(struct passwd *);
int /*<<< orphan*/ stderr;
void user_by_uid(uid_t uid) {
  struct passwd *pw;
  pw = getpwuid(uid);
  if (pw == NULL) {
    fprintf(stderr, "No entry found. -u %d\n", (int)uid);
    exit(-1);
  };
  prt_passwd(pw);
}


x86 assembly (clang, -O0):
<user_by_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1189 <user_by_uid+0x49>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <prt_passwd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_by_uid>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1157 <user_by_uid+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <prt_passwd@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"No entry found. -u %d\0A\00"
define void @user_by_uid(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.passwd*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call %struct.passwd* @getpwuid(i64 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp eq %struct.passwd* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %1
%15 = load %struct.passwd*, %struct.passwd** %3
%16 = call i32 @prt_passwd(%struct.passwd* %15)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"No entry found. -u %d\0A\00"
define void @user_by_uid(i64 %0) {
%2 = tail call %struct.passwd* @getpwuid(i64 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = trunc i64 %0 to i32
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = tail call i32 @prt_passwd(%struct.passwd* %2)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ rmdir(char const *);
void rmdir_protect_errno(const char *dir) {
  int saved_errno = errno;
  (void)rmdir(dir);
  errno = saved_errno;
}


x86 assembly (clang, -O0):
<rmdir_protect_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
mov    -0xc(%rbp),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir_protect_errno>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <rmdir@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @rmdir_protect_errno(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 = call i32 @rmdir(i8* %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @rmdir_protect_errno(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @rmdir(i8* %0)
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int M_PI;
double M_PI_2;
double heading_of_to_angle_rad(double angle) {
  double two_pi = 2 * M_PI;
  double a = M_PI_2 - angle + two_pi;
  while (a >= two_pi)
    a -= two_pi;
  return a;
}


x86 assembly (clang, -O0):
<heading_of_to_angle_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
movsd  (%rax),%xmm0
subsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1160 <heading_of_to_angle_rad+0x60>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1138 <heading_of_to_angle_rad+0x38>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<heading_of_to_angle_rad>:
movapd %xmm0,%xmm1
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm2
mov    0x2ec6(%rip),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm2,%xmm0
jb     113a <heading_of_to_angle_rad+0x3a>
nopl   0x0(%rax)
subsd  %xmm2,%xmm0
ucomisd %xmm2,%xmm0
jae    1130 <heading_of_to_angle_rad+0x30>
ret

LLVM IR (-O0):
@M_PI = global i32 0
@M_PI_2 = global double 0.000000e+00
define double @heading_of_to_angle_rad(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 2, %5
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load double, double* @M_PI_2
%9 = load double, double* %2
%10 = fsub double %8, %9
%11 = load double, double* %3
%12 = fadd double %10, %11
store double %12, double* %4
br label %13
13: ; preds = %17, %1
%14 = load double, double* %4
%15 = load double, double* %3
%16 = fcmp oge double %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fsub double %19, %18
store double %20, double* %4
br label %13
21: ; preds = %13
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
@M_PI = global i32 0
@M_PI_2 = global double 0.000000e+00
define double @heading_of_to_angle_rad(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = load double, double* @M_PI_2
%6 = fsub double %5, %0
%7 = fadd double %6, %4
%8 = fcmp ult double %7, %4
br i1 %8, label %13, label %9
9: ; preds = %1, %9
%10 = phi double [ %11, %9 ], [ %7, %1 ]
%11 = fsub double %10, %4
%12 = fcmp ult double %11, %4
br i1 %12, label %13, label %9
13: ; preds = %9, %1
%14 = phi double [ %7, %1 ], [ %11, %9 ]
ret double %14
}
float Absolute(float num) { return (num >= 0 ? num : -num); }


x86 assembly (clang, -O0):
<Absolute>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <Absolute+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1140 <Absolute+0x40>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Absolute>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @Absolute(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load float, float* %2
br label %10
7: ; preds = %1
%8 = load float, float* %2
%9 = fneg float %8
br label %10
10: ; preds = %7, %5
%11 = phi float [ %6, %5 ], [ %9, %7 ]
ret float %11
}

LLVM IR (-O2):
define float @Absolute(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ funcL(unsigned char *, unsigned char *);
void funcC(unsigned char number, unsigned char *output) {
  unsigned char tempI[16] = {0};
  tempI[15] = number;
  funcL(tempI, output);
}


x86 assembly (clang, -O0):
<funcC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x11(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <funcL@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcC>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %dil,0xf(%rsp)
mov    %rsp,%rdi
call   1030 <funcL@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @funcC(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca [16 x i8]
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = bitcast [16 x i8]* %5 to i8*
%7 = load i8, i8* %3
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 15
store i8 %7, i8* %8
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @funcL(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @funcC(i8 zeroext %0, i8* %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 15
store i8 %0, i8* %5
%6 = call i32 @funcL(i8* %4, i8* %1)
ret void
}
/* Variables and functions */
int bar();
int foo(void) { return bar() + 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 1
ret i32 %2
}
const char *fpp_config_get_plugin_name(void) { return "Native Client"; }


x86 assembly (clang, -O0):
<fpp_config_get_plugin_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Native Client\00"
define i8* @fpp_config_get_plugin_name() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Native Client\00"
define i8* @fpp_config_get_plugin_name() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<bnep_event_channel_timeout_get_bnep_cid>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @bnep_event_channel_timeout_get_bnep_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
char *PlatformGetLine(char *Buf, int MaxLen, const char *Prompt) { return 0; }


x86 assembly (clang, -O0):
<PlatformGetLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @PlatformGetLine(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @PlatformGetLine(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i8* null
}
void cgo_callback_assert_ptr(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @cgo_callback_assert_ptr(i8* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
unsigned long get_XButtonEvent_time(void *_p) {
  return (unsigned long)((XButtonEvent *)_p)->time;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XButtonEvent_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XButtonEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xcirculate;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xcirculate_display(void *_p) {
  return (void *)((XEvent *)_p)->xcirculate.display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xcirculate_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xcirculate_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
long O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, long);
int setnonblock(int fd) {
  long fl;
  fl = fcntl(fd, F_GETFL, 0);
  return fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <fcntl@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    0x2e9b(%rip),%rax
or     (%rax),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
movslq %eax,%rdx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
or     (%rax),%rdx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define i32 @setnonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i64 0)
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i32, i32* %2
%9 = load i32, i32* @F_SETFL
%10 = load i64, i64* %3
%11 = load i64, i64* @O_NONBLOCK
%12 = or i64 %10, %11
%13 = call i32 @fcntl(i32 %8, i32 %9, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define i32 @setnonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i64 0)
%4 = sext i32 %3 to i64
%5 = load i32, i32* @F_SETFL
%6 = load i64, i64* @O_NONBLOCK
%7 = or i64 %6, %4
%8 = tail call i32 @fcntl(i32 %0, i32 %5, i64 %7)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t co_max(uint32_t a, uint32_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<co_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <co_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <co_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @co_max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @co_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int null_code_fragments_needed(void *code_desc, int *missing_idxs,
                               int *fragments_needed) {
  return 0;
}


x86 assembly (clang, -O0):
<null_code_fragments_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @null_code_fragments_needed(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
void rop3_28_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_28_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_28_0_0>:
mov    (%rdi),%al
and    %dl,%al
or     %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_28_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo(long x1, long x2, long x3, long x4, long x5, long x6, long x7, long x8,
         long x9, long x10) {
  exit(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @foo(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
store i64 %0, i64* %11
store i64 %1, i64* %12
store i64 %2, i64* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64 %5, i64* %16
store i64 %6, i64* %17
store i64 %7, i64* %18
store i64 %8, i64* %19
store i64 %9, i64* %20
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pin_Direction(int);
int /*<<< orphan*/ pin_Value(int, int);
void motor_direction_right(int dr) {
  pin_Direction(60);
  pin_Value(60, dr);
}


x86 assembly (clang, -O0):
<motor_direction_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3c,%edi
call   1030 <pin_Direction@plt>
mov    -0x4(%rbp),%esi
mov    $0x3c,%edi
call   1040 <pin_Value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_direction_right>:
push   %rbx
mov    %edi,%ebx
mov    $0x3c,%edi
call   1030 <pin_Direction@plt>
mov    $0x3c,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <pin_Value@plt>

LLVM IR (-O0):
define void @motor_direction_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pin_Direction(i32 60)
%4 = load i32, i32* %2
%5 = call i32 @pin_Value(i32 60, i32 %4)
ret void
}

LLVM IR (-O2):
define void @motor_direction_right(i32 %0) {
%2 = tail call i32 @pin_Direction(i32 60)
%3 = tail call i32 @pin_Value(i32 60, i32 %0)
ret void
}
void dummy_handler(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @dummy_handler(i32 %0) {
ret void
}
void foo(char *p) {
  volatile int two = 2;
  __builtin_memcpy(p, "abc", two);
  p[0] = 'd';
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movslq %eax,%rdx
lea    0xecc(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
movb   $0x64,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x2,0xc(%rsp)
movslq 0xc(%rsp),%rdx
lea    0xed4(%rip),%rsi
call   1030 <memcpy@plt>
movb   $0x64,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store volatile i32 2, i32* %3
%4 = load i8*, i8** %2
%5 = load volatile i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 100, i8* %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define void @foo(i8* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 2, i32* %2
%4 = load volatile i32, i32* %2
%5 = sext i32 %4 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5, i1 false)
store i8 100, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: cottage -f|-c|-o <args>\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: cottage -f|-c|-o <args>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: cottage -f|-c|-o <args>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void strv_free(char **l) {
  char **k;
  if (!l)
    return;
  for (k = l; *k; k++)
    free(*k);
  free(l);
}


x86 assembly (clang, -O0):
<strv_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strv_free+0x1c>
jmp    1168 <strv_free+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115f <strv_free+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <strv_free+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_free>:
test   %rdi,%rdi
je     1150 <strv_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <strv_free+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <strv_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @strv_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %1, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("%s\n", "sysv"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"sysv\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int config_MODULE_CCCSHARE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_CCCSHARE() {
ret i32 0
}
/* Variables and functions */
void applyFreeFunction(void *ptr, void (*freeFunc)(void *)) {
  if (ptr != NULL & freeFunc != NULL) {
    freeFunc(ptr);
  }
}


x86 assembly (clang, -O0):
<applyFreeFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,-0x10(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <applyFreeFunction+0x40>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyFreeFunction>:
test   %rdi,%rdi
je     110c <applyFreeFunction+0xc>
test   %rsi,%rsi
je     110c <applyFreeFunction+0xc>
jmp    *%rsi
ret

LLVM IR (-O0):
define void @applyFreeFunction(i8* %0, void (i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i8*)*
store i8* %0, i8** %3
store void (i8*)* %1, void (i8*)** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = load void (i8*)*, void (i8*)** %4
%9 = icmp ne void (i8*)* %8, null
%10 = zext i1 %9 to i32
%11 = and i32 %7, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load void (i8*)*, void (i8*)** %4
%15 = load i8*, i8** %3
br label %16
16: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
define void @applyFreeFunction(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
tail call void %1(i8* %0)
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test61_AvrPin_clear__E();
void test61_Led_off__E() { test61_AvrPin_clear__E(); }


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

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

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

LLVM IR (-O2):
define void @test61_Led_off__E() {
%1 = tail call i32 (...) @test61_AvrPin_clear__E()
ret void
}
int fitsBits(int x, int n) {
  int shift = (~n + 1);
  int num = (x << shift) >> shift;
  int result = !(num ^ x);
  return result;
}


x86 assembly (clang, -O0):
<fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsBits>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%edx
shl    %cl,%edx
sar    %cl,%edx
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = shl i32 %11, %12
%14 = load i32, i32* %5
%15 = ashr i32 %13, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %3
%18 = xor i32 %16, %17
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
store i32 %21, i32* %7
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _outbyte(char);
void outbyte(char **dst, char c) {
  if (*dst)
    *(*dst)++ = c;
  else
    _outbyte(c);
}


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114b <outbyte+0x3b>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
jmp    1154 <outbyte+0x44>
movsbl -0x9(%rbp),%edi
call   1030 <_outbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
mov    (%rdi),%rax
test   %rax,%rax
je     1123 <outbyte+0x13>
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret
movsbl %sil,%edi
jmp    1030 <_outbyte@plt>

LLVM IR (-O0):
define void @outbyte(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %4
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = call i32 @_outbyte(i8 signext %14)
br label %16
16: ; preds = %13, %8
ret void
}

LLVM IR (-O2):
define void @outbyte(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %6, i8** %0
store i8 %1, i8* %3
br label %9
7: ; preds = %2
%8 = tail call i32 @_outbyte(i8 signext %1)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
scalar_t__ ENOENT;
int _time_error(char *, int);
scalar_t__ errno;
int /*<<< orphan*/ execvp(char *, char **);
int _time_exec(char *argv[]) {
  execvp(argv[0], argv);
  if (errno == ENOENT)
    return _time_error(argv[0], 127);
  return _time_error(argv[0], 126);
}


x86 assembly (clang, -O0):
<_time_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <execvp@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <_time_exec+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x7f,%esi
call   1030 <_time_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1183 <_time_exec+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x7e,%esi
call   1030 <_time_error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_time_exec>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rbx,%rsi
call   1040 <execvp@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    0x2e90(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
sete   %sil
mov    (%rbx),%rdi
or     $0x7e,%esi
pop    %rbx
jmp    1030 <_time_error@plt>

LLVM IR (-O0):
@errno = global i64 0
@ENOENT = global i64 0
define i32 @_time_exec(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = load i8**, i8*** %3
%8 = call i32 @execvp(i8* %6, i8** %7)
%9 = load i64, i64* @errno
%10 = load i64, i64* @ENOENT
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8**, i8*** %3
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @_time_error(i8* %15, i32 127)
store i32 %16, i32* %2
br label %22
17: ; preds = %1
%18 = load i8**, i8*** %3
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @_time_error(i8* %20, i32 126)
store i32 %21, i32* %2
br label %22
22: ; preds = %17, %12
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@ENOENT = global i64 0
define i32 @_time_exec(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = load i64, i64* @errno
%5 = load i64, i64* @ENOENT
%6 = icmp eq i64 %4, %5
%7 = load i8*, i8** %0
%8 = select i1 %6, i32 127, i32 126
%9 = tail call i32 @_time_error(i8* %7, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __const_udelay(unsigned long);
void __udelay(unsigned long usecs) { __const_udelay(usecs * 0x000010c6); }


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

x86 assembly (clang, -O2):
<__udelay>:
imul   $0x10c6,%rdi,%rdi
jmp    1030 <__const_udelay@plt>

LLVM IR (-O0):
define void @__udelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4294
%5 = call i32 @__const_udelay(i64 %4)
ret void
}

LLVM IR (-O2):
define void @__udelay(i64 %0) {
%2 = mul i64 %0, 4294
%3 = tail call i32 @__const_udelay(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
void readCommand(char *buffer) { gets(buffer); }


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

x86 assembly (clang, -O2):
<readCommand>:
jmp    1030 <gets@plt>

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

LLVM IR (-O2):
define void @readCommand(i8* %0) {
%2 = tail call i32 @gets(i8* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *jcv_alloc_fn(void *memctx, size_t size) {
  (void)memctx;
  return malloc(size);
}


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

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

LLVM IR (-O0):
define i8* @jcv_alloc_fn(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @jcv_alloc_fn(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *teststack() {
  int i = 10;
  printf("i_ptr=0x%p\n", &i);
  int array[10];
  printf("array_ptr=0x%p\n", array);
  printf("hello_ptr=0x%p\n", &"hello, world");
  return "stack";
}


x86 assembly (clang, -O0):
<teststack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0xa,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teststack>:
sub    $0x38,%rsp
movl   $0xa,0xc(%rsp)
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"i_ptr=0x%p\0A\00"
@.str.1 = [16 x i8] c"array_ptr=0x%p\0A\00"
@.str.2 = [16 x i8] c"hello_ptr=0x%p\0A\00"
@.str.3 = [13 x i8] c"hello, world\00"
@.str.4 = [6 x i8] c"stack\00"
define i8* @teststack() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), [13 x i8]* @.str.3)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"i_ptr=0x%p\0A\00"
@.str.1 = [16 x i8] c"array_ptr=0x%p\0A\00"
@.str.2 = [16 x i8] c"hello_ptr=0x%p\0A\00"
@.str.3 = [13 x i8] c"hello, world\00"
@.str.4 = [6 x i8] c"stack\00"
define i8* @teststack() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), [13 x i8]* @.str.3)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
}
/* Variables and functions */
double sqrt(double);
double my_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<my_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <my_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @my_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int feclearexcept(int excepts) {
  int cw;
  excepts &= FE_ALL_EXCEPT;
  _FPU_GETCW(cw);
  cw &= ~excepts;
  _FPU_SETCW(cw);
  return 0;
}


x86 assembly (clang, -O0):
<feclearexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feclearexcept>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %edi,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feclearexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = load i32, i32* %2
%6 = and i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @_FPU_GETCW(i32 %7)
%9 = load i32, i32* %2
%10 = xor i32 %9, -1
%11 = load i32, i32* %3
%12 = and i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @_FPU_SETCW(i32 %13)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feclearexcept(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
%3 = tail call i32 @_FPU_SETCW(i32 0)
ret i32 0
}