xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int set_nonblocking_sloppy(int fd) {
  return fcntl(fd, F_SETFL, fcntl(fd, F_GETFD, 0) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblocking_sloppy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblocking_sloppy>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFD = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblocking_sloppy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 @fcntl(i32 %3, i32 %4, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFD = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblocking_sloppy(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFD
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %6)
ret i32 %7
}
/* Type definitions */
struct variable_list {
  int dummy;
};
struct enum_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_badtype(char *buf, struct variable_list *var,
                    struct enum_list *enums, const char *hint,
                    const char *units) {
  sprintf(buf, "Variable has bad type");
}


x86 assembly (clang, -O0):
<sprint_badtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_badtype>:
movups 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movabs $0x65707974206461,%rax
mov    %rax,0xe(%rdi)
ret

LLVM IR (-O0):
%struct.variable_list = type { i32 }
%struct.enum_list = type { i32 }
@.str = [22 x i8] c"Variable has bad type\00"
define void @sprint_badtype(i8* %0, %struct.variable_list* %1, %struct.enum_list* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca %struct.variable_list*
%8 = alloca %struct.enum_list*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store %struct.variable_list* %1, %struct.variable_list** %7
store %struct.enum_list* %2, %struct.enum_list** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.variable_list = type { i32 }
%struct.enum_list = type { i32 }
@.str = [22 x i8] c"Variable has bad type\00"
define void @sprint_badtype(i8* nocapture writeonly %0, %struct.variable_list* nocapture readnone %1, %struct.enum_list* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(22) %0, i8* align 1 dereferenceable(22) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 22, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FixedWingAirspeedsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FixedWingAirspeedsRequestUpdate() {
  UAVObjRequestUpdate(FixedWingAirspeedsHandle());
}


x86 assembly (clang, -O0):
<FixedWingAirspeedsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FixedWingAirspeedsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedWingAirspeedsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FixedWingAirspeedsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FixedWingAirspeedsRequestUpdate() {
%1 = call i32 (...) @FixedWingAirspeedsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FixedWingAirspeedsRequestUpdate() {
%1 = tail call i32 (...) @FixedWingAirspeedsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ln() { write(1, "\n", 1); }


x86 assembly (clang, -O0):
<ln>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ln() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ look(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x, y;
  x = 10;
  y = 5;
  printf("x=%d, y=%d \n", x, y);
  printf("&x=%p, &y=%p \n", &x, &y);
  look(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <look@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,(%rsp)
movl   $0x5,0x4(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%edi
call   1040 <look@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"x=%d, y=%d \0A\00"
@.str.1 = [15 x i8] c"&x=%p, &y=%p \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %1
store i32 5, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10, i32 5)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = call i32 @look(i32 %7)
ret i32 0
}
void remove_dev_func(struct ctlra_dev_t *dev, int unexpected_removal,
                     void *userdata) {}


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

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

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

LLVM IR (-O2):
%struct.ctlra_dev_t = type opaque
define void @remove_dev_func(%struct.ctlra_dev_t* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t dds_phase_rate(float frequency) {
  return (int32_t)(frequency * 65536.0f * 65536.0f / 8000);
}


x86 assembly (clang, -O0):
<dds_phase_rate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee6(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed6(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_phase_rate>:
movss  0xef8(%rip),%xmm1
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
divss  0xeec(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @dds_phase_rate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 6.553600e+04
%5 = fmul float %4, 6.553600e+04
%6 = fdiv float %5, 8.000000e+03
%7 = fptosi float %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @dds_phase_rate(float %0) {
%2 = fmul float %0, 6.553600e+04
%3 = fmul float %2, 6.553600e+04
%4 = fdiv float %3, 8.000000e+03
%5 = fptosi float %4 to i32
ret i32 %5
}
/* Variables and functions */
char *calloc(int, int);
char *string_repeat(char character, int count) {
  char *text = calloc(count + 1, 1);
  int i = 0;
  for (i = 0; i < count; ++i) {
    text[i] = character;
  }
  return text;
}


x86 assembly (clang, -O0):
<string_repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116b <string_repeat+0x5b>
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <string_repeat+0x33>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_repeat>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
lea    0x1(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    114b <string_repeat+0x2b>
mov    %ebp,%edx
movzbl %r14b,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @string_repeat(i8 signext %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %2
ret i8* %4
}
int f7(int x, int y) {
  if (y <= -17 || y >= -1)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffef,-0x8(%rbp)
jle    111e <f7+0x1e>
cmpl   $0xffffffff,-0x8(%rbp)
jl     111e <f7+0x1e>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f7(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sle i32 %5, -17
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %7, %2
unreachable
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = srem i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1) {
%3 = add i32 %1, 16
%4 = icmp ult i32 %3, 15
tail call void @llvm.assume(i1 %4)
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
ret i32 %6
}
/* Variables and functions */
double floor(double);
double limit_degrees(double degrees) {
  double limited;
  degrees /= 360.0;
  limited = 360.0 * (degrees - floor(degrees));
  if (limited < 0)
    limited += 360.0;
  return limited;
}


x86 assembly (clang, -O0):
<limit_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <limit_degrees+0x71>
movsd  0xe89(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_degrees>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
movapd %xmm3,%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm3,%xmm0
orpd   %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @limit_degrees(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 3.600000e+02
store double %5, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @llvm.floor.f64(double %7)
%9 = fsub double %6, %8
%10 = fmul double 3.600000e+02, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load double, double* %3
%15 = fadd double %14, 3.600000e+02
store double %15, double* %3
br label %16
16: ; preds = %13, %1
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @limit_degrees(double %0) {
%2 = fdiv double %0, 3.600000e+02
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fsub double %2, %3
%5 = fmul double %4, 3.600000e+02
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 3.600000e+02
%8 = select i1 %6, double %7, double %5
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ smsc911x_reset();
void enreset(void) { smsc911x_reset(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_u32(uint32_t x) { assert_or_panic(x == 0xfffffffd); }


x86 assembly (clang, -O0):
<c_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_u32>:
xor    %eax,%eax
cmp    $0xfffffffd,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

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

LLVM IR (-O2):
define void @c_u32(i32 %0) {
%2 = icmp eq i32 %0, -3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
/* Variables and functions */
int RAND_bytes(void *, int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void ptls_openssl_random_bytes(void *buf, size_t len) {
  int ret = RAND_bytes(buf, (int)len);
  if (ret != 1) {
    fprintf(stderr, "RAND_bytes() failed with code: %d\n", ret);
    abort();
  }
}


x86 assembly (clang, -O0):
<ptls_openssl_random_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1040 <RAND_bytes@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     117b <ptls_openssl_random_bytes+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe91(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptls_openssl_random_bytes>:
push   %rax
call   1040 <RAND_bytes@plt>
cmp    $0x1,%eax
jne    113d <ptls_openssl_random_bytes+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb3(%rip),%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"RAND_bytes() failed with code: %d\0A\00"
define void @ptls_openssl_random_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = call i32 @RAND_bytes(i8* %6, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %5
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"RAND_bytes() failed with code: %d\0A\00"
define void @ptls_openssl_random_bytes(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @RAND_bytes(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_head(struct genlist const *);
struct fc_sockaddr_list_link *
fc_sockaddr_list_head(const struct fc_sockaddr_list *tthis) {
  return (struct fc_sockaddr_list_link *)genlist_head(
      (const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_head>:
jmp    1030 <genlist_head@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_head(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i64 @genlist_head(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %6
}

LLVM IR (-O2):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_head(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_head(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %4
}
/* Variables and functions */
scalar_t__ realloc_array(void **, int, int, int, int, int);
int **realloc_int(int **array, int first, int second, int ext1, int ext2) {
  return (int **)realloc_array((void **)array, sizeof(int), first, second, ext1,
                               ext2);
}


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

x86 assembly (clang, -O2):
<realloc_int>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <realloc_array@plt>

LLVM IR (-O0):
define i32** @realloc_int(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32** %0, i32*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32**, i32*** %6
%12 = bitcast i32** %11 to i8**
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i64 @realloc_array(i8** %12, i32 4, i32 %13, i32 %14, i32 %15, i32 %16)
%18 = inttoptr i64 %17 to i32**
ret i32** %18
}

LLVM IR (-O2):
define i32** @realloc_int(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast i32** %0 to i8**
%7 = tail call i64 @realloc_array(i8** %6, i32 4, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = inttoptr i64 %7 to i32**
ret i32** %8
}
double mins(double f1, double f2, double df) {
  double limlin(double x, double x0, double dx, double y0);
  return (limlin(f1, f2, df, f2));
}


x86 assembly (clang, -O0):
<mins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
call   1030 <limlin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mins>:
movaps %xmm1,%xmm3
jmp    1030 <limlin@plt>

LLVM IR (-O0):
define double @mins(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = load double, double* %5
%11 = call double @limlin(double %7, double %8, double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @mins(double %0, double %1, double %2) {
%4 = tail call double @limlin(double %0, double %1, double %2, double %1)
ret double %4
}
/* Variables and functions */
int os_delete(char const *, int *);
int /*<<< orphan*/ os_freakout();
int remove(const char *filename) {
  int rc;
  if (os_delete(filename, &rc) == -1)
    os_freakout();
  return rc;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <os_delete@plt>
cmp    $0xffffffff,%eax
jne    1149 <remove+0x29>
mov    $0x0,%al
call   1030 <os_freakout@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rax
lea    0x4(%rsp),%rsi
call   1040 <os_delete@plt>
cmp    $0xffffffff,%eax
jne    1137 <remove+0x17>
xor    %eax,%eax
call   1030 <os_freakout@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @remove(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @os_delete(i8* %0, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @os_freakout()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_track_ref(void *track) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_track_ref(i8* nocapture readnone %0) {
ret i8* null
}
void g_scanner_cur_line() {}


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

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

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

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

/* Variables and functions */
int write(int, int *, int);
int lewrite32(int fd, int c) {
  int r;
  do {
    int __feh = c;
    if (1)
      c = c;
    else
      c = ((((__feh)&0xff000000) >> 24) | (((__feh)&0x00ff0000) >> 8) |
           (((__feh)&0x0000ff00) << 8) | (((__feh)&0x000000ff) << 24));
  } while (0);
  r = write(fd, &c, 4);
  return r;
}


x86 assembly (clang, -O0):
<lewrite32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lewrite32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lewrite32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %2
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %4
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @write(i32 %11, i32* %4, i32 4)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @lewrite32(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 4)
ret i32 %4
}
float grad1(int hash, float x) {
  int h = hash & 15;
  float grad = 1.0 + (h & 7);
  if (h & 8)
    grad = -grad;
  return (grad * x);
}


x86 assembly (clang, -O0):
<grad1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
cvtsi2sd %eax,%xmm1
movsd  0xed9(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     115a <grad1+0x5a>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grad1>:
mov    %edi,%eax
and    $0x7,%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
test   $0x8,%dil
je     1119 <grad1+0x19>
xorps  0xee7(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @grad1(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 15
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 7
%11 = sitofp i32 %10 to double
%12 = fadd double 1.000000e+00, %11
%13 = fptrunc double %12 to float
store float %13, float* %6
%14 = load i32, i32* %5
%15 = and i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load float, float* %6
%19 = fneg float %18
store float %19, float* %6
br label %20
20: ; preds = %17, %2
%21 = load float, float* %6
%22 = load float, float* %4
%23 = fmul float %21, %22
ret float %23
}

LLVM IR (-O2):
define float @grad1(i32 %0, float %1) {
%3 = and i32 %0, 7
%4 = add nuw nsw i32 %3, 1
%5 = sitofp i32 %4 to float
%6 = and i32 %0, 8
%7 = icmp eq i32 %6, 0
%8 = fneg float %5
%9 = select i1 %7, float %5, float %8
%10 = fmul float %9, %1
ret float %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ decode_rle_sample32(void *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, void *,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ init_alphaTables();
void exported_decode_rle_sample32(void *sampleBuffer, uint32_t sampleBufferSize,
                                  uint32_t isKeyFrame, void *frameBuffer,
                                  uint32_t frameBufferWidth,
                                  uint32_t frameBufferHeight) {
  init_alphaTables();
  decode_rle_sample32(sampleBuffer, sampleBufferSize, isKeyFrame, frameBuffer,
                      frameBufferWidth, frameBufferHeight);
}


x86 assembly (clang, -O0):
<exported_decode_rle_sample32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0x0,%al
call   1030 <init_alphaTables@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1040 <decode_rle_sample32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exported_decode_rle_sample32>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <init_alphaTables@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <decode_rle_sample32@plt>

LLVM IR (-O0):
define void @exported_decode_rle_sample32(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 (...) @init_alphaTables()
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i32 @decode_rle_sample32(i8* %14, i32 %15, i32 %16, i8* %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @exported_decode_rle_sample32(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 (...) @init_alphaTables()
%8 = tail call i32 @decode_rle_sample32(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
unsigned long long nfallN(unsigned long long);
unsigned long long nraiseN(unsigned long long);
unsigned long long calc(unsigned long long n) {
  return nraiseN(n) + nfallN(n) - 9;
}


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nraiseN@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nfallN@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
sub    $0x9,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <nraiseN@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <nfallN@plt>
add    %r14,%rax
add    $0xfffffffffffffff7,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @calc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @nraiseN(i64 %3)
%5 = load i64, i64* %2
%6 = call i64 @nfallN(i64 %5)
%7 = add i64 %4, %6
%8 = sub i64 %7, 9
ret i64 %8
}

LLVM IR (-O2):
define i64 @calc(i64 %0) {
%2 = tail call i64 @nraiseN(i64 %0)
%3 = tail call i64 @nfallN(i64 %0)
%4 = add i64 %2, -9
%5 = add i64 %4, %3
ret i64 %5
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ B115200;
int /*<<< orphan*/ B19200;
int /*<<< orphan*/ B9600;
speed_t transfer_baud_rate(uint16_t int_baud_rate) {
  switch (int_baud_rate) {
  case 9600:
    return B9600;
    break;
  case 19200:
    return B19200;
    break;
  default:
    return B115200;
    break;
  }
}


x86 assembly (clang, -O0):
<transfer_baud_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2580,%eax
je     1130 <transfer_baud_rate+0x30>
jmp    111d <transfer_baud_rate+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x4b00,%eax
je     1141 <transfer_baud_rate+0x41>
jmp    1152 <transfer_baud_rate+0x52>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <transfer_baud_rate+0x5e>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <transfer_baud_rate+0x5e>
mov    0x2e77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_baud_rate>:
cmp    $0x4b00,%edi
jne    1119 <transfer_baud_rate+0x19>
mov    0x2ee1(%rip),%rax
cmp    $0x2580,%edi
je     1128 <transfer_baud_rate+0x28>
jmp    112f <transfer_baud_rate+0x2f>
mov    0x2eb0(%rip),%rax
cmp    $0x2580,%edi
jne    112f <transfer_baud_rate+0x2f>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@B9600 = global i32 0
@B19200 = global i32 0
@B115200 = global i32 0
define i32 @transfer_baud_rate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 9600, label %5
i32 19200, label %7
]
5: ; preds = %1
%6 = load i32, i32* @B9600
store i32 %6, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* @B19200
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @B115200
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %7, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@B9600 = global i32 0
@B19200 = global i32 0
@B115200 = global i32 0
define i32 @transfer_baud_rate(i32 %0) {
%2 = icmp eq i32 %0, 19200
%3 = icmp eq i32 %0, 9600
%4 = load i32, i32* @B9600
%5 = load i32, i32* @B19200
%6 = load i32, i32* @B115200
%7 = select i1 %2, i32 %5, i32 %6
%8 = select i1 %3, i32 %4, i32 %7
ret i32 %8
}
void right_encoder_pin_config(void) {}


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

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

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

LLVM IR (-O2):
define void @right_encoder_pin_config() {
ret void
}
void __attribute__((constructor)) myInit() {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @myInit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetLpoClockFreq();
uint32_t CLOCK_SYS_GetEwmFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetLpoClockFreq();
}


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

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

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

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetEwmFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetLpoClockFreq()
ret i32 %2
}
int main() {
  volatile struct {
    struct s {
      int ii;
      float fp[4];
    } XYZ;
    int i;
    int j;
  } ABC;
  while (1) {
    ABC.i = 4;
    ABC.XYZ.fp[2] = 3.14;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
movl   $0x4,-0x8(%rsp)
movl   $0x4048f5c3,-0x4(%rsp)
40
jmp    1100 <main>

LLVM IR (-O0):
%struct.anon = type { %struct.s, i32, i32 }
%struct.s = type { i32, [4 x float] }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
store volatile i32 4, i32* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%6 = getelementptr inbounds %struct.s, %struct.s* %5, i32 0, i32 1
%7 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 0, i64 2
store volatile float 0x40091EB860000000, float* %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
store volatile i32 4, i32* %2
store volatile float 0x40091EB860000000, float* %1
br label %5
}
/* Variables and functions */
void *dynarr_get(void **arr, size_t index) {
  size_t size = *((size_t *)arr[0]);
  return (index >= size) ? NULL : arr[index + 1];
}


x86 assembly (clang, -O0):
<dynarr_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1133 <dynarr_get+0x33>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1144 <dynarr_get+0x44>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynarr_get>:
mov    (%rdi),%rax
cmp    %rsi,(%rax)
jbe    110e <dynarr_get+0xe>
mov    0x8(%rdi,%rsi,8),%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @dynarr_get(i8** nocapture %0, i64 %1) {
%3 = bitcast i8** %0 to i64**
%4 = load i64*, i64** %3
%5 = load i64, i64* %4
%6 = icmp ugt i64 %5, %1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = add nuw i64 %1, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
br label %11
11: ; preds = %2, %7
%12 = phi i8* [ %10, %7 ], [ null, %2 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ CloseWin46();
void closewin() { CloseWin46(); }


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

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

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

LLVM IR (-O2):
define void @closewin() {
%1 = tail call i32 (...) @CloseWin46()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, char *, int);
void send_cmd_d2(int cmd_code, double arg1, double arg2) {
  double dbuf[2];
  dbuf[0] = arg1;
  dbuf[1] = arg2;
  send_cmd(cmd_code, (char *)dbuf, 2 * sizeof(double));
}


x86 assembly (clang, -O0):
<send_cmd_d2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1030 <send_cmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_d2>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <send_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @send_cmd_d2(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca [2 x double]
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
store double %8, double* %9
%10 = load double, double* %6
%11 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
store double %10, double* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%14 = bitcast double* %13 to i8*
%15 = call i32 @send_cmd(i32 %12, i8* %14, i32 16)
ret void
}

LLVM IR (-O2):
define void @send_cmd_d2(i32 %0, double %1, double %2) {
%4 = alloca [2 x double]
%5 = bitcast [2 x double]* %4 to i8*
%6 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
store double %1, double* %6
%7 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
store double %2, double* %7
%8 = call i32 @send_cmd(i32 %0, i8* %5, i32 16)
ret void
}
execle(f, a, s) char *f, *a, *s;
{ ; }


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

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

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

LLVM IR (-O2):
define i32 @execle(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
void packLong(const void *data, unsigned long value) {
  ((unsigned char *)data)[0] = (unsigned char)(value >> 24);
  ((unsigned char *)data)[1] = (unsigned char)(value >> 16);
  ((unsigned char *)data)[2] = (unsigned char)(value >> 8);
  ((unsigned char *)data)[3] = (unsigned char)value;
}


x86 assembly (clang, -O0):
<packLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packLong>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @packLong(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void outportsm(unsigned short port, unsigned char *data, unsigned long size) {
  asm volatile("rep outsw" : "+S"(data), "+c"(size) : "d"(port));
}


x86 assembly (clang, -O0):
<outportsm>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x2(%rbp),%dx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportsm>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outportsm(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i16, i16* %4
%10 = call { i8*, i64 } asm sideeffect "rep outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outportsm(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}