xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nand_init();
int nand_read(unsigned int, unsigned int, unsigned int);
int copy2ddr(unsigned int nand_start, unsigned int ddr_start,
             unsigned int len) {
  int ret;
  nand_init();
  ret = nand_read(nand_start, ddr_start, len);
  return ret;
}


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

x86 assembly (clang, -O2):
<copy2ddr>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <nand_init@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <nand_read@plt>

LLVM IR (-O0):
define i32 @copy2ddr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @nand_init()
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @nand_read(i32 %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @copy2ddr(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @nand_init()
%5 = tail call i32 @nand_read(i32 %0, i32 %1, i32 %2)
ret i32 %5
}
void fn_test3(void) {
  int a = 0;
  a++;
}


x86 assembly (clang, -O0):
<fn_test3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn_test3() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @fn_test3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_item(void *item) { printf("%d->", (int)item); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%d->\00"
define void @print_item(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d->\00"
define void @print_item(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(long, int);
void ptrace_event_proot(int event) { syscall((long)350, event); }


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

x86 assembly (clang, -O2):
<ptrace_event_proot>:
mov    %edi,%esi
mov    $0x15e,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @ptrace_event_proot(i32 %0) {
%2 = tail call i32 @syscall(i64 350, i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void get_time(struct timeval *tv) { gettimeofday(tv, NULL); }


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @get_time(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @get_time(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_datetime(char *);
int main(void) {
  char buffer[36];
  get_datetime(buffer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <get_datetime@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [36 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_datetime(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [36 x i8]
%2 = getelementptr inbounds [36 x i8], [36 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_datetime(i8* %2)
ret i32 0
}
int intel_msic_check_battery_health(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_msic_check_battery_health() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnPROTO(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0014, data);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edx
mov    $0x14,%esi
jmp    1030 <w5100_writeSn_byte@plt>

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

LLVM IR (-O2):
define void @w5100_writeSnPROTO(i32 %0, i32 %1) {
%3 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 20, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parse_ipv6(uint8_t *packet, int len) { printf("ipv6 TODO\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"ipv6 TODO\0A\00"
define void @parse_ipv6(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"ipv6 TODO\00"
define void @parse_ipv6(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
int gmx_idle_rec(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gmx_idle_rec() {
ret i32 0
}
double glbChiZero(int exp, int rule, int n_params, double *x, double *errors,
                  void *user_data) {
  return 0.0;
}


x86 assembly (clang, -O0):
<glbChiZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glbChiZero>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @glbChiZero(i32 %0, i32 %1, i32 %2, double* %3, double* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
store i8* %5, i8** %12
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @glbChiZero(i32 %0, i32 %1, i32 %2, double* nocapture readnone %3, double* nocapture readnone %4, i8* nocapture readnone %5) {
ret double 0.000000e+00
}
/* Type definitions */
struct Ann {
  int dummy;
};

/* Variables and functions */
struct Ann *AnnCreateNet(int, int *);
struct Ann *AnnCreateNet3(int iunits, int hunits, int ounits) {
  int units[3];
  units[0] = ounits;
  units[1] = hunits;
  units[2] = iunits;
  return AnnCreateNet(3, units);
}


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

x86 assembly (clang, -O2):
<AnnCreateNet3>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edi,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x3,%edi
call   1030 <AnnCreateNet@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.Ann = type { i32 }
define %struct.Ann* @AnnCreateNet3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 %12, i32* %13
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%15 = call %struct.Ann* @AnnCreateNet(i32 3, i32* %14)
ret %struct.Ann* %15
}

LLVM IR (-O2):
%struct.Ann = type { i32 }
define %struct.Ann* @AnnCreateNet3(i32 %0, i32 %1, i32 %2) {
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %4 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %2, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %0, i32* %8
%9 = call %struct.Ann* @AnnCreateNet(i32 3, i32* %6)
ret %struct.Ann* %9
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_nexttowardf();
scalar_t__ nexttowardf(float, long double);
void test_nexttowardf(float f, long double x) {
  if (nexttowardf(f, x) != nexttowardf(f, x))
    link_failure_nexttowardf();
}


x86 assembly (clang, -O0):
<test_nexttowardf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttowardf@plt>
mov    %rax,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nexttowardf@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1172 <test_nexttowardf+0x52>
mov    $0x0,%al
call   1040 <link_failure_nexttowardf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttowardf>:
push   %rbx
sub    $0x20,%rsp
movss  %xmm0,0x10(%rsp)
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <nexttowardf@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <nexttowardf@plt>
cmp    %rax,%rbx
jne    115d <test_nexttowardf+0x3d>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_nexttowardf@plt>

LLVM IR (-O0):
define void @test_nexttowardf(float %0, x86_fp80 %1) {
%3 = alloca float
%4 = alloca x86_fp80
store float %0, float* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load float, float* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @nexttowardf(float %5, x86_fp80 %6)
%8 = load float, float* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @nexttowardf(float %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_nexttowardf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_nexttowardf(float %0, x86_fp80 %1) {
%3 = tail call i64 @nexttowardf(float %0, x86_fp80 %1)
%4 = tail call i64 @nexttowardf(float %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_nexttowardf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ my_blink();
int /*<<< orphan*/ rcc_init();
void startup(void) {
  rcc_init();
  led_init();
  my_blink();
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rcc_init@plt>
mov    $0x0,%al
call   1040 <led_init@plt>
mov    $0x0,%al
call   1050 <my_blink@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1030 <rcc_init@plt>
xor    %eax,%eax
call   1040 <led_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <my_blink@plt>

LLVM IR (-O0):
define void @startup() {
%1 = call i32 (...) @rcc_init()
%2 = call i32 (...) @led_init()
%3 = call i32 (...) @my_blink()
ret void
}

LLVM IR (-O2):
define void @startup() {
%1 = tail call i32 (...) @rcc_init()
%2 = tail call i32 (...) @led_init()
%3 = tail call i32 (...) @my_blink()
ret void
}
int test_imm_94uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x94 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_94uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 148
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(5, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_target_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_target_solutions_to_container>:
mov    $0x5,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_target_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 5, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 5, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void module_cpu_load(char *s, char *conky) {
  sprintf(s, "%sCPU %02d%%", s, atoi(conky));
}


x86 assembly (clang, -O0):
<module_cpu_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea6(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_cpu_load>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <atoi@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%sCPU %02d%%\00"
define void @module_cpu_load(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%sCPU %02d%%\00"
define void @module_cpu_load(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %1)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
unsigned xrop3_8_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D & stk3;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


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

x86 assembly (clang, -O2):
<xrop3_8_1_0>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_8_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Type definitions */
typedef int time_t;
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, struct timezone *);
time_t time(time_t *t) {
  struct timeval tt;
  if (gettimeofday(&tt, (struct timezone *)0) < 0)
    return (-1);
  if (t)
    *t = (time_t)tt.tv_sec;
  return (tt.tv_sec);
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    113f <time+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <time+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1153 <time+0x43>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1136 <time+0x26>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     113b <time+0x2b>
mov    %eax,(%rbx)
jmp    113b <time+0x2b>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @gettimeofday(%struct.timeval* %2, %struct.timezone* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = icmp eq i32* %0, null
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
br i1 %7, label %11, label %10
10: ; preds = %6
store i32 %9, i32* %0
br label %11
11: ; preds = %6, %10, %1
%12 = phi i32 [ -1, %1 ], [ %9, %10 ], [ %9, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ CS(int);
int /*<<< orphan*/ DC(int);
int /*<<< orphan*/ LCD_out(unsigned char);
void oled_write_c(unsigned char out_command) {
  DC(0);
  CS(0);
  LCD_out(out_command);
  CS(1);
  DC(1);
}


x86 assembly (clang, -O0):
<oled_write_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
movzbl -0x1(%rbp),%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
call   1030 <DC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_write_c>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
mov    %ebx,%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <DC@plt>

LLVM IR (-O0):
define void @oled_write_c(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @DC(i32 0)
%4 = call i32 @CS(i32 0)
%5 = load i8, i8* %2
%6 = call i32 @LCD_out(i8 zeroext %5)
%7 = call i32 @CS(i32 1)
%8 = call i32 @DC(i32 1)
ret void
}

LLVM IR (-O2):
define void @oled_write_c(i8 zeroext %0) {
%2 = tail call i32 @DC(i32 0)
%3 = tail call i32 @CS(i32 0)
%4 = tail call i32 @LCD_out(i8 zeroext %0)
%5 = tail call i32 @CS(i32 1)
%6 = tail call i32 @DC(i32 1)
ret void
}
void Sys_LeaveCriticalSection(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @Sys_LeaveCriticalSection(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int ENXIO;
int pm8921_regulate_input_voltage(int voltage) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_regulate_input_voltage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_regulate_input_voltage>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_regulate_input_voltage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_regulate_input_voltage(i32 %0) {
%2 = load i32, i32* @ENXIO
%3 = sub nsw i32 0, %2
ret i32 %3
}
void ff_hevc_put_hevc_uni_pel_pixels8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels8_12_sse4() {
ret void
}
plural(num, string) int num;
char *string;
{
  printi(num);
  prints(string);
  if (num != 1)
    printch('s');
}


x86 assembly (clang, -O0):
<plural>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <printi@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <prints@plt>
cmpl   $0x1,-0x8(%rbp)
je     116a <plural+0x3a>
mov    $0x73,%edi
mov    $0x0,%al
call   1050 <printch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plural>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <printi@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <prints@plt>
cmp    $0x1,%ebp
je     115a <plural+0x2a>
mov    $0x73,%edi
xor    %eax,%eax
call   1050 <printch@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @plural(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = call i32 (i32, ...) bitcast (i32 (...)* @printi to i32 (i32, ...)*)(i32 %6)
%8 = load i8*, i8** %5
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* %8)
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i32, ...) bitcast (i32 (...)* @printch to i32 (i32, ...)*)(i32 115)
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @plural(i32 %0, i8* %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @printi to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @prints to i32 (i8*, ...)*)(i8* %1)
%5 = icmp eq i32 %0, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @printch to i32 (i32, ...)*)(i32 115)
br label %8
8: ; preds = %6, %2
ret i32 undef
}
int isfloatchar(const char c) {
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case '+':
  case '-':
  case '.':
  case 'e':
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<isfloatchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2b,%eax
je     1158 <isfloatchar+0x58>
jmp    111f <isfloatchar+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd3,%eax
sub    $0x2,%eax
jb     1158 <isfloatchar+0x58>
jmp    1133 <isfloatchar+0x33>
mov    -0xc(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     1158 <isfloatchar+0x58>
jmp    1147 <isfloatchar+0x47>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
jne    1164 <isfloatchar+0x64>
jmp    1158 <isfloatchar+0x58>
movl   $0x0,-0x4(%rbp)
jmp    116b <isfloatchar+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfloatchar>:
xor    %eax,%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
jae    110b <isfloatchar+0xb>
ret
add    $0xffffffd5,%edi
cmp    $0x3a,%edi
ja     1123 <isfloatchar+0x23>
movabs $0x40000000000000d,%rcx
bt     %rdi,%rcx
jb     110a <isfloatchar+0xa>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @isfloatchar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
i32 43, label %6
i32 45, label %6
i32 46, label %6
i32 101, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isfloatchar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 48, label %4
i32 49, label %4
i32 50, label %4
i32 51, label %4
i32 52, label %4
i32 53, label %4
i32 54, label %4
i32 55, label %4
i32 56, label %4
i32 57, label %4
i32 43, label %4
i32 45, label %4
i32 46, label %4
i32 101, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ -1, %3 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %5
}
/* Variables and functions */
void printf() {}


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

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

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

LLVM IR (-O2):
define void @printf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_palette(int /*<<< orphan*/, int, unsigned char *);
void init_palette(void) {
  static unsigned char table_rgb[16 * 3] = {
      0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00,
      0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
      0xc6, 0xc6, 0xc6, 0x84, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84, 0x84, 0x00,
      0x00, 0x00, 0x84, 0x84, 0x00, 0x84, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84};
  set_palette(0, 15, table_rgb);
}


x86 assembly (clang, -O0):
<init_palette>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xf,%esi
lea    0x2f0e(%rip),%rdx
call   1030 <set_palette@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_palette>:
lea    0x2f19(%rip),%rdx
xor    %edi,%edi
mov    $0xf,%esi
jmp    1030 <set_palette@plt>

LLVM IR (-O0):
@init_palette.table_rgb = internal global [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = call i32 @set_palette(i32 0, i32 15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @init_palette.table_rgb, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@init_palette.table_rgb = internal global [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = tail call i32 @set_palette(i32 0, i32 15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @init_palette.table_rgb, i64 0, i64 0))
ret void
}
void Msp430AlarmC__2__Msp430Timer__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__2__Msp430Timer__overflow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main01() {
  int a = 10;
  int b = 3;
  int c = a % b;
  printf("c = %d\n", c);
  a += 5;
  a = a + 1;
  a += 1;
  a++;
  a = a - 1;
  a -= 1;
  a--;
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"c = %d\0A\00"
define i32 @main01() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 10, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 5
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %1
%21 = load i32, i32* %1
%22 = add nsw i32 %21, -1
store i32 %22, i32* %1
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"c = %d\0A\00"
define i32 @main01() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put_crlf();
int /*<<< orphan*/ putchp(int /*<<< orphan*/);
void putln(const char *s) {
  for (; *s; putchp(*s++))
    ;
  put_crlf();
}


x86 assembly (clang, -O0):
<putln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <putln+0x3a>
jmp    113e <putln+0x1e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1040 <putchp@plt>
jmp    112c <putln+0xc>
mov    $0x0,%al
call   1030 <put_crlf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putln>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <putln+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <putchp@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <putln+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <put_crlf@plt>

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

LLVM IR (-O2):
define void @putln(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchp(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (...) @put_crlf()
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
char *replace(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *intReplaceF(char *text, char *from, int to, char *form) {
  char *buffer = (char *)calloc(16, sizeof(char));
  sprintf(buffer, form, to);
  return replace(text, from, buffer);
}


x86 assembly (clang, -O0):
<intReplaceF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <replace@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intReplaceF>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r12
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <replace@plt>

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

LLVM IR (-O2):
define i8* @intReplaceF(i8* %0, i8* %1, i32 %2, i8* nocapture %3) {
%5 = tail call i64 @calloc(i32 16, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) %3, i32 %2)
%8 = tail call i8* @replace(i8* %0, i8* %1, i8* %6)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int list[], int idx) {
  int i;
  for (i = 0; i < idx; i++)
    printf("%d ", list[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int chdir(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
void chdir_source() {
  int ret = chdir("source");
  if (ret != 0) {
    printf("chdir failed: %s\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<chdir_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <chdir@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     118c <chdir_source+0x4c>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir_source>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <chdir@plt>
test   %eax,%eax
jne    1153 <chdir_source+0x13>
pop    %rax
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"source\00"
@.str.1 = [18 x i8] c"chdir failed: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @chdir_source() {
%1 = alloca i32
%2 = call i32 @chdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"source\00"
@.str.1 = [18 x i8] c"chdir failed: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @chdir_source() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void cvt_u8ALPHA_u8ALPHA(const uint8_t *src, uint8_t *dest, int w) {
  memcpy(dest, src, w * 1);
}


x86 assembly (clang, -O0):
<cvt_u8ALPHA_u8ALPHA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x0,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_u8ALPHA_u8ALPHA>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @cvt_u8ALPHA_u8ALPHA(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** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 1
%11 = call i32 @memcpy(i32* %7, i32* %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @cvt_u8ALPHA_u8ALPHA(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %2)
ret void
}
/* Variables and functions */
int UINT_MAX;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int);
void printUsage(char prog[]) {
  printf("Usage: %s -i <int between %u-%u> -s <string>\n", prog, 0, UINT_MAX);
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
lea    0xec0(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
lea    0xecc(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: %s -i <int between %u-%u> -s <string>\0A\00"
@UINT_MAX = global i32 0
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @UINT_MAX
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: %s -i <int between %u-%u> -s <string>\0A\00"
@UINT_MAX = global i32 0
define void @printUsage(i8* %0) {
%2 = load i32, i32* @UINT_MAX
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void __attribute__((weak)) tim1_brk_tim9_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim1_brk_tim9_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim1_brk_tim9_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim1_brk_tim9_isr = [18 x i8] c"tim1_brk_tim9_isr\00"
define weak void @tim1_brk_tim9_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim1_brk_tim9_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim1_brk_tim9_isr = [18 x i8] c"tim1_brk_tim9_isr\00"
define weak void @tim1_brk_tim9_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.tim1_brk_tim9_isr, i64 0, i64 0))
ret void
}