xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long time_us(void) {
  long ret;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  ret = 1000000L * tv.tv_sec + tv.tv_usec;
  return ret;
}


x86 assembly (clang, -O0):
<time_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @time_us() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
store i64 %9, i64* %1
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @time_us() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
int file_remove_action(const char *filename, struct stat *statbuf,
                       void *userdata, int depth) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @file_remove_action(i8* %0, %struct.stat* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @file_remove_action(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Type definitions */
struct ps_summary_info {
  int dummy;
};
struct ps_summary_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ obus_event_get_info(int /*<<< orphan*/);
int /*<<< orphan*/ ps_summary_const_obus_event(struct ps_summary_event const *);
const struct ps_summary_info *
ps_summary_event_get_info(const struct ps_summary_event *event) {
  return (const struct ps_summary_info *)obus_event_get_info(
      ps_summary_const_obus_event(event));
}


x86 assembly (clang, -O0):
<ps_summary_event_get_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ps_summary_const_obus_event@plt>
mov    %eax,%edi
call   1030 <obus_event_get_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_summary_event_get_info>:
push   %rax
call   1040 <ps_summary_const_obus_event@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <obus_event_get_info@plt>

LLVM IR (-O0):
%struct.ps_summary_info = type { i32 }
%struct.ps_summary_event = type { i32 }
define %struct.ps_summary_info* @ps_summary_event_get_info(%struct.ps_summary_event* %0) {
%2 = alloca %struct.ps_summary_event*
store %struct.ps_summary_event* %0, %struct.ps_summary_event** %2
%3 = load %struct.ps_summary_event*, %struct.ps_summary_event** %2
%4 = call i32 @ps_summary_const_obus_event(%struct.ps_summary_event* %3)
%5 = call i64 @obus_event_get_info(i32 %4)
%6 = inttoptr i64 %5 to %struct.ps_summary_info*
ret %struct.ps_summary_info* %6
}

LLVM IR (-O2):
%struct.ps_summary_info = type { i32 }
%struct.ps_summary_event = type { i32 }
define %struct.ps_summary_info* @ps_summary_event_get_info(%struct.ps_summary_event* %0) {
%2 = tail call i32 @ps_summary_const_obus_event(%struct.ps_summary_event* %0)
%3 = tail call i64 @obus_event_get_info(i32 %2)
%4 = inttoptr i64 %3 to %struct.ps_summary_info*
ret %struct.ps_summary_info* %4
}
void platform_init(void) {}


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

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

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

LLVM IR (-O2):
define void @platform_init() {
ret void
}
/* Variables and functions */
int findN(unsigned int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned int a[] = {1, 2, 5, 6, 2, 0, 0, 0};
  printf("N = %d", findN(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <findN@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <findN@plt>
lea    0xed6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 1, i32 2, i32 5, i32 6, i32 2, i32 0, i32 0, i32 0]
@.str = [7 x i8] c"N = %d\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @findN(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_task_section() { write("json-task.json", "\"task\": [\n", NULL); }


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

x86 assembly (clang, -O2):
<init_task_section>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [11 x i8] c"\22task\22: [\0A\00"
define void @init_task_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bn_sqr_normal(unsigned long *, unsigned long *, int,
                                 unsigned long *);
void bn_sqr_comba4(unsigned long *r, unsigned long *a) {
  unsigned long t[8];
  bn_sqr_normal(r, a, 4, t);
}


x86 assembly (clang, -O0):
<bn_sqr_comba4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rcx
mov    $0x4,%edx
call   1030 <bn_sqr_normal@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_sqr_comba4>:
sub    $0x48,%rsp
mov    %rsp,%rcx
mov    $0x4,%edx
call   1030 <bn_sqr_normal@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @bn_sqr_comba4(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [8 x i64]
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = load i64*, i64** %4
%8 = getelementptr inbounds [8 x i64], [8 x i64]* %5, i64 0, i64 0
%9 = call i32 @bn_sqr_normal(i64* %6, i64* %7, i32 4, i64* %8)
ret void
}

LLVM IR (-O2):
define void @bn_sqr_comba4(i64* %0, i64* %1) {
%3 = alloca [8 x i64]
%4 = bitcast [8 x i64]* %3 to i8*
%5 = getelementptr inbounds [8 x i64], [8 x i64]* %3, i64 0, i64 0
%6 = call i32 @bn_sqr_normal(i64* %0, i64* %1, i32 4, i64* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ McuSleepC__McuPowerState__update();
void HplAtm128UartP__McuPowerState__update(void) {
  McuSleepC__McuPowerState__update();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128UartP__McuPowerState__update() {
%1 = tail call i32 (...) @McuSleepC__McuPowerState__update()
ret void
}
void lfds700_misc_library_cleanup(void) { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @lfds700_misc_library_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void phClose(int *m_hSocket) {
  if (*m_hSocket != -1) {
    close(*m_hSocket);
    *m_hSocket = -1;
  }
}


x86 assembly (clang, -O0):
<phClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     113e <phClose+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phClose>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
cmp    $0xffffffff,%edi
je     1126 <phClose+0x16>
call   1030 <close@plt>
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @phClose(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
store i32 -1, i32* %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos3i(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void RasterPos3i(GLint x, GLint y, GLint z) { glRasterPos3i(x, y, z); }


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

x86 assembly (clang, -O2):
<RasterPos3i>:
jmp    1030 <glRasterPos3i@plt>

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

LLVM IR (-O2):
define void @RasterPos3i(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glRasterPos3i(i32 %0, i32 %1, i32 %2)
ret void
}
double francs(double unite) {
  const double euros = 655.96;
  double francs = 0;
  francs = euros * unite;
  return francs;
}


x86 assembly (clang, -O0):
<francs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<francs>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @francs(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 6.559600e+02, double* %3
store double 0.000000e+00, double* %4
%5 = load double, double* %2
%6 = fmul double 6.559600e+02, %5
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @francs(double %0) {
%2 = fmul double %0, 6.559600e+02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ random_doubles(int, double *);
void generate_directions(int nbt, int dim, double *dirs) {
  random_doubles(nbt * dim, dirs);
}


x86 assembly (clang, -O0):
<generate_directions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <random_doubles@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_directions>:
imul   %esi,%edi
mov    %rdx,%rsi
jmp    1030 <random_doubles@plt>

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

LLVM IR (-O2):
define void @generate_directions(i32 %0, i32 %1, double* %2) {
%4 = mul nsw i32 %1, %0
%5 = tail call i32 @random_doubles(i32 %4, double* %2)
ret void
}
short scanint(char **ptr) {
  short val;
  if (*(*ptr) & 1) {
    val = ((*(unsigned short *)*ptr) >> 1) - 0x4000;
    *ptr += 2;
  } else {
    val = ((*(unsigned char *)*ptr) >> 1) - 0x40;
    *ptr += 1;
  }
  return val;
}


x86 assembly (clang, -O0):
<scanint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1147 <scanint+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl (%rax),%eax
sar    $0x1,%eax
sub    $0x4000,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
jmp    1169 <scanint+0x69>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
sar    $0x1,%eax
sub    $0x40,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanint>:
mov    (%rdi),%rcx
movzbl (%rcx),%eax
test   $0x1,%al
jne    1119 <scanint+0x19>
movzwl %ax,%eax
shr    %eax
add    $0xffffffc0,%eax
mov    $0x1,%edx
jmp    1128 <scanint+0x28>
movzwl (%rcx),%eax
shr    %eax
add    $0xffffc000,%eax
mov    $0x2,%edx
add    %rdx,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define signext i16 @scanint(i8** %0) {
%2 = alloca i8**
%3 = alloca i16
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to i16*
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 1
%17 = sub nsw i32 %16, 16384
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8* %21, i8** %19
br label %33
22: ; preds = %1
%23 = load i8**, i8*** %2
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = ashr i32 %26, 1
%28 = sub nsw i32 %27, 64
%29 = trunc i32 %28 to i16
store i16 %29, i16* %3
%30 = load i8**, i8*** %2
%31 = load i8*, i8** %30
%32 = getelementptr inbounds i8, i8* %31, i64 1
store i8* %32, i8** %30
br label %33
33: ; preds = %22, %10
%34 = load i16, i16* %3
ret i16 %34
}

LLVM IR (-O2):
define signext i16 @scanint(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = and i8 %3, 1
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = bitcast i8* %2 to i16*
%8 = load i16, i16* %7
%9 = lshr i16 %8, 1
%10 = add nsw i16 %9, -16384
br label %15
11: ; preds = %1
%12 = lshr i8 %3, 1
%13 = zext i8 %12 to i16
%14 = add nsw i16 %13, -64
br label %15
15: ; preds = %11, %6
%16 = phi i64 [ 1, %11 ], [ 2, %6 ]
%17 = phi i16 [ %14, %11 ], [ %10, %6 ]
%18 = getelementptr inbounds i8, i8* %2, i64 %16
store i8* %18, i8** %0
ret i16 %17
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  short width;
};
struct TYPE_4__ {
  TYPE_1__ max_bounds;
};
typedef TYPE_2__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_max_bounds_width(void *_p, short _v) {
  ((XFontStruct *)_p)->max_bounds.width = (short)_v;
}


x86 assembly (clang, -O0):
<set_XFontStruct_max_bounds_width>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontStruct_max_bounds_width>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XFontStruct_max_bounds_width(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
int test_imm_C9uint32_reg(unsigned int val) {
  return ((val) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9uint32_reg(i32 %0) {
%2 = and i32 %0, 201
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ message_body;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ send_status(int /*<<< orphan*/ *, int, char const *, int);
void send_response(FILE *client, int code, const char *reason_phrase,
                   const char *message_body) {
  send_status(client, code, reason_phrase, sizeof(message_body));
}


x86 assembly (clang, -O0):
<send_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <send_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response>:
mov    $0x8,%ecx
jmp    1030 <send_status@plt>

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

LLVM IR (-O2):
define void @send_response(i32* %0, i32 %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @send_status(i32* %0, i32 %1, i8* %2, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void MPURegionEnable(unsigned long ulRegion) {
  DEBUG_ASSERT(ulRegion < 8);
  (*((volatile unsigned long *)(0xE000ED98))) = ulRegion;
  (*((volatile unsigned long *)(0xE000EDA0))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x8,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0xe000ed98,%eax
mov    %rcx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0xe000eda0,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionEnable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x8,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xe000eda0,%eax
mov    %rbx,-0x8(%rax)
orq    $0x1,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @MPURegionEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 8
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
store volatile i64 %7, i64* inttoptr (i64 3758157208 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%9 = or i64 %8, 1
store volatile i64 %9, i64* inttoptr (i64 3758157216 to i64*)
ret void
}

LLVM IR (-O2):
define void @MPURegionEnable(i64 %0) {
%2 = icmp ult i64 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
store volatile i64 %0, i64* inttoptr (i64 3758157208 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%6 = or i64 %5, 1
store volatile i64 %6, i64* inttoptr (i64 3758157216 to i64*)
ret void
}
void pci_disable_ats(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_disable_ats(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ info(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void error_die(char *err) {
  info("%s (errno = %d : %s): Shutting down\n", err, errno, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<error_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe92(%rip),%rdi
call   1050 <info@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<error_die>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1040 <strerror@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <info@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"%s (errno = %d : %s): Shutting down\0A\00"
@errno = global i32 0
define void @error_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @info(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s (errno = %d : %s): Shutting down\0A\00"
@errno = global i32 0
define void @error_die(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @info(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ircproto_parse_message(int /*<<< orphan*/, char **, char **,
                                          int *, char **);
int /*<<< orphan*/ sock_readline();
void ircproto_read_message(char **prefix, char **cmd, int *ncmd,
                           char **params) {
  ircproto_parse_message(sock_readline(), prefix, cmd, ncmd, params);
}


x86 assembly (clang, -O0):
<ircproto_read_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <sock_readline@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <ircproto_parse_message@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ircproto_read_message>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <sock_readline@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <ircproto_parse_message@plt>

LLVM IR (-O0):
define void @ircproto_read_message(i8** %0, i8** %1, i32* %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i8**
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i8** %3, i8*** %8
%9 = call i32 (...) @sock_readline()
%10 = load i8**, i8*** %5
%11 = load i8**, i8*** %6
%12 = load i32*, i32** %7
%13 = load i8**, i8*** %8
%14 = call i32 @ircproto_parse_message(i32 %9, i8** %10, i8** %11, i32* %12, i8** %13)
ret void
}

LLVM IR (-O2):
define void @ircproto_read_message(i8** %0, i8** %1, i32* %2, i8** %3) {
%5 = tail call i32 (...) @sock_readline()
%6 = tail call i32 @ircproto_parse_message(i32 %5, i8** %0, i8** %1, i32* %2, i8** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float libra;
  printf("Libra: ");
  scanf("%f", &libra);
  printf("Kg: %.2f", libra * 0.45);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeae(%rip),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Libra: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [9 x i8] c"Kg: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double %6, 4.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Libra: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [9 x i8] c"Kg: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 4.500000e-01
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void Imprimindo_Valores_Array(int *Ptr) {
  int i = 0;
  for (; i < 50000; i++)
    printf("\n [%d] = %d ", i, *(Ptr + i));
}


x86 assembly (clang, -O0):
<Imprimindo_Valores_Array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc350,-0xc(%rbp)
jge    1158 <Imprimindo_Valores_Array+0x48>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <Imprimindo_Valores_Array+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Imprimindo_Valores_Array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xedf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0xc350,%rbx
jne    1130 <Imprimindo_Valores_Array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"\0A [%d] = %d \00"
define void @Imprimindo_Valores_Array(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = trunc i64 %3 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %5)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 50000
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
float floorf(float);
void vec3_floor(float *dst) {
  dst[0] = floorf(dst[0]);
  dst[1] = floorf(dst[1]);
  dst[2] = floorf(dst[2]);
}


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

x86 assembly (clang, -O2):
<vec3_floor>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <floorf@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x4(%rbx)
movss  0x8(%rbx),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vec3_floor(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = call float @llvm.floor.f32(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.floor.f32(float %11)
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = call float @llvm.floor.f32(float %17)
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @vec3_floor(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @llvm.floor.f32(float %2)
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.floor.f32(float %5)
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.floor.f32(float %8)
store float %9, float* %7
ret void
}
/* Variables and functions */
int strlen(char *);
void Debright(char *s) {
  char *p = s + strlen(s);
  while (p > s && *--p == ' ')
    *p = 0;
}


x86 assembly (clang, -O0):
<Debright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jbe    116c <Debright+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117c <Debright+0x6c>
jmp    1188 <Debright+0x78>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    113d <Debright+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Debright>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1143 <Debright+0x33>
mov    %eax,%eax
add    %rbx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x20,-0x1(%rax)
jne    1143 <Debright+0x33>
movb   $0x0,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
ja     1130 <Debright+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @Debright(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %21, %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = icmp ugt i8* %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br label %19
19: ; preds = %13, %9
%20 = phi i1 [ false, %9 ], [ %18, %13 ]
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = load i8*, i8** %3
store i8 0, i8* %22
br label %9
23: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @Debright(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
br label %7
7: ; preds = %4, %12
%8 = phi i8* [ %9, %12 ], [ %6, %4 ]
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %12, label %14
12: ; preds = %7
store i8 0, i8* %9
%13 = icmp ugt i8* %9, %0
br i1 %13, label %7, label %14
14: ; preds = %7, %12, %1
ret void
}
unsigned int I2CDataCountGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x98)))));
}


x86 assembly (clang, -O0):
<I2CDataCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x98,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CDataCountGet>:
add    $0x98,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CDataCountGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 152
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @I2CDataCountGet(i32 %0) {
%2 = add i32 %0, 152
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ nn_node_putchar(char);
void nn_node_indent(int indent) {
  int i;
  for (i = 0; i != indent * 4; ++i)
    nn_node_putchar(' ');
}


x86 assembly (clang, -O0):
<nn_node_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
je     114b <nn_node_indent+0x3b>
mov    $0x20,%edi
call   1030 <nn_node_putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <nn_node_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_node_indent>:
push   %rbx
test   %edi,%edi
je     112f <nn_node_indent+0x1f>
mov    %edi,%ebx
shl    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <nn_node_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <nn_node_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @nn_node_indent(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @nn_node_putchar(i8 signext 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_69(void) {
  { a_0_55(((((42)))), "; ?"); }
}


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

x86 assembly (clang, -O2):
<a_0_69>:
lea    0xee9(%rip),%rsi
mov    $0x2a,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"; ?\00"
define void @a_0_69() {
%1 = call i32 @a_0_55(i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"; ?\00"
define void @a_0_69() {
%1 = tail call i32 @a_0_55(i32 42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f434(int *);
int f435(int *p) { return f434(p); }


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

x86 assembly (clang, -O2):
<f435>:
jmp    1030 <f434@plt>

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

LLVM IR (-O2):
define i32 @f435(i32* %0) {
%2 = tail call i32 @f434(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ acc_device_default;
int /*<<< orphan*/ acc_shutdown(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "CheCKpOInT\n");
  acc_shutdown(acc_device_default);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <acc_shutdown@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <acc_shutdown@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
@acc_device_default = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @acc_device_default
%6 = tail call i32 @acc_shutdown(i32 %5)
ret i32 0
}
/* Variables and functions */
int count(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int dig;
  printf("Enter number:");
  scanf(" %d", &dig);
  printf("%d", count(dig));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <count@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Enter number:\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @count(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ peakbandwidth_server();
int main(int argc, char *argv[]) {
  peakbandwidth_server();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <peakbandwidth_server@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @peakbandwidth_server()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @peakbandwidth_server()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_direct_drive();
scalar_t__ get_toggle_rc_mode_btn();
int /*<<< orphan*/ wait10Msec(int);
void handle_rc_mode_btn() {
  while (get_toggle_rc_mode_btn()) {
    wait10Msec(1);
  }
  do_direct_drive();
}


x86 assembly (clang, -O0):
<handle_rc_mode_btn>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <handle_rc_mode_btn+0x9>
mov    $0x0,%al
call   1030 <get_toggle_rc_mode_btn@plt>
cmp    $0x0,%rax
je     1159 <handle_rc_mode_btn+0x29>
mov    $0x1,%edi
call   1040 <wait10Msec@plt>
jmp    1139 <handle_rc_mode_btn+0x9>
mov    $0x0,%al
call   1050 <do_direct_drive@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_rc_mode_btn>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_toggle_rc_mode_btn@plt>
test   %rax,%rax
je     1158 <handle_rc_mode_btn+0x28>
mov    $0x1,%edi
call   1040 <wait10Msec@plt>
jmp    1140 <handle_rc_mode_btn+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1050 <do_direct_drive@plt>

LLVM IR (-O0):
define void @handle_rc_mode_btn() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @get_toggle_rc_mode_btn()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @wait10Msec(i32 1)
br label %1
6: ; preds = %1
%7 = call i32 (...) @do_direct_drive()
ret void
}

LLVM IR (-O2):
define void @handle_rc_mode_btn() {
%1 = tail call i64 (...) @get_toggle_rc_mode_btn()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 @wait10Msec(i32 1)
%5 = tail call i64 (...) @get_toggle_rc_mode_btn()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
%8 = tail call i32 (...) @do_direct_drive()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void safe_close(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<safe_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <safe_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_close>:
test   %edi,%edi
js     1119 <safe_close+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @safe_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}