xunge/DecIR huggingface dataset:
double Exyyz(double l, double m, double n) {
  return 0 * -0.03753 + l * n * 0.02719 - l * n * -0.00488;
}


x86 assembly (clang, -O0):
<Exyyz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeae(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exyyz>:
mulsd  %xmm2,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Exyyz(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %9, double 2.719000e-02, double -0.000000e+00)
%11 = load double, double* %4
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %14, double -4.880000e-03, double %10)
ret double %15
}

LLVM IR (-O2):
define double @Exyyz(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fmul double %4, 2.719000e-02
%6 = fneg double %4
%7 = tail call double @llvm.fmuladd.f64(double %6, double -4.880000e-03, double %5)
ret double %7
}
int fior(int a, int b) {
  int tmp;
  a = __builtin_bswap32(a);
  b = __builtin_bswap32(b);
  tmp = a != b;
  return tmp;
}


x86 assembly (clang, -O0):
<fior>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
bswap  %eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
bswap  %eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fior>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @fior(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @llvm.bswap.i32(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @llvm.bswap.i32(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @fior(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_187() {
  Assert_real((isqrt(187) == 13),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              940, ("Integer square root of 187 should be 13"));
}


x86 assembly (clang, -O0):
<t_sqrt_187>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbb,%edi
call   1030 <isqrt@plt>
cmp    $0xd,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3ac,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_187>:
push   %rax
mov    $0xbb,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xd,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 187 should be 13\00"
define void @t_sqrt_187() {
%1 = call i32 @isqrt(i32 187)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 187 should be 13\00"
define void @t_sqrt_187() {
%1 = tail call i32 @isqrt(i32 187)
%2 = icmp eq i32 %1, 13
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct resman {
  int dummy;
};

/* Variables and functions */
int add_resource(struct resman *, char const *, void *);
int find_resource(struct resman *, char const *);
int resman_add(struct resman *rman, const char *fname, void *data) {
  int ridx;
  if ((ridx = find_resource(rman, fname)) != -1) {
    return ridx;
  }
  return add_resource(rman, fname, data);
}


x86 assembly (clang, -O0):
<resman_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <find_resource@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     1158 <resman_add+0x38>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <resman_add+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <add_resource@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resman_add>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <find_resource@plt>
cmp    $0xffffffff,%eax
je     113e <resman_add+0x1e>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <add_resource@plt>

LLVM IR (-O0):
%struct.resman = type { i32 }
define i32 @resman_add(%struct.resman* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.resman*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.resman* %0, %struct.resman** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load %struct.resman*, %struct.resman** %5
%10 = load i8*, i8** %6
%11 = call i32 @find_resource(%struct.resman* %9, i8* %10)
store i32 %11, i32* %8
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* %8
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load %struct.resman*, %struct.resman** %5
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = call i32 @add_resource(%struct.resman* %16, i8* %17, i8* %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %13
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.resman = type { i32 }
define i32 @resman_add(%struct.resman* %0, i8* %1, i8* %2) {
%4 = tail call i32 @find_resource(%struct.resman* %0, i8* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @add_resource(%struct.resman* %0, i8* %1, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
/* Variables and functions */
int get(int *p, size_t i) { return (p[i >> 5] & 1 << (i & 0x1f)) != 0; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
mov    %rsi,%rcx
mov    %rsi,%rax
shr    $0x5,%rax
mov    (%rdi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = lshr i64 %6, 5
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = load i64, i64* %4
%11 = and i64 %10, 31
%12 = trunc i64 %11 to i32
%13 = shl i32 1, %12
%14 = and i32 %9, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @get(i32* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 5
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = trunc i64 %1 to i32
%7 = and i32 %6, 31
%8 = lshr i32 %5, %7
%9 = and i32 %8, 1
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int spi_xfer(int, void *, int *, int);
int ltc185x_xfer(uint8_t cmd, uint16_t *data) {
  int ret = -1;
  volatile uint16_t tmp_cmd = 0;
  tmp_cmd |= (cmd << 8);
  ret = spi_xfer(16, (void *)&tmp_cmd, data, 0x02);
  if (ret)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ltc185x_xfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x10,%edi
mov    $0x2,%ecx
call   1030 <spi_xfer@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116b <ltc185x_xfer+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <ltc185x_xfer+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltc185x_xfer>:
push   %rax
mov    %rsi,%rdx
movl   $0x0,0x4(%rsp)
shl    $0x8,%edi
or     %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x10,%edi
mov    $0x2,%ecx
call   1030 <spi_xfer@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ltc185x_xfer(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 -1, i32* %6
store volatile i32 0, i32* %7
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = load volatile i32, i32* %7
%11 = or i32 %10, %9
store volatile i32 %11, i32* %7
%12 = bitcast i32* %7 to i8*
%13 = load i32*, i32** %5
%14 = call i32 @spi_xfer(i32 16, i8* %12, i32* %13, i32 2)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ltc185x_xfer(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = shl i32 %0, 8
%6 = load volatile i32, i32* %3
%7 = or i32 %6, %5
store volatile i32 %7, i32* %3
%8 = call i32 @spi_xfer(i32 16, i8* %4, i32* %1, i32 2)
%9 = icmp ne i32 %8, 0
%10 = sext i1 %9 to i32
ret i32 %10
}
void brcms_led_unregister(struct brcms_info *wl) {}


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

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

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

LLVM IR (-O2):
%struct.brcms_info = type opaque
define void @brcms_led_unregister(%struct.brcms_info* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("usage: ncsvc -h host -c cookies -f cert_file [-l log_level] [-L "
         "log_level] [-U sign_in_url] [-p socks port]\n"
         "       ncsvc -v\n"
         "    log_level : 0 : Log Critical messages only\n"
         "                1 : Log Critital and Error messages\n"
         "                2 : Log Critital, Error and Warning messages\n"
         "                3 : Log Critital, Error, Warning and Info "
         "messages(default)\n"
         "                4 : Log All Verbose messages\n"
         "                5 : Log All messages\n");
}


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

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

LLVM IR (-O0):
@.str = [443 x i8] c"usage: ncsvc -h host -c cookies -f cert_file [-l log_level] [-L log_level] [-U sign_in_url] [-p socks port]\0A ncsvc -v\0A log_level : 0 : Log Critical messages only\0A 1 : Log Critital and Error messages\0A 2 : Log Critital, Error and Warning messages\0A 3 : Log Critital, Error, Warning and Info messages(default)\0A 4 : Log All Verbose messages\0A 5 : Log All messages\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([443 x i8], [443 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [442 x i8] c"usage: ncsvc -h host -c cookies -f cert_file [-l log_level] [-L log_level] [-U sign_in_url] [-p socks port]\0A ncsvc -v\0A log_level : 0 : Log Critical messages only\0A 1 : Log Critital and Error messages\0A 2 : Log Critital, Error and Warning messages\0A 3 : Log Critital, Error, Warning and Info messages(default)\0A 4 : Log All Verbose messages\0A 5 : Log All messages\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([442 x i8], [442 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assert(int /*<<< orphan*/, char *);
int /*<<< orphan*/ __ESBMC_is_zero_string(char const *);
int atoi_strabs(const char *nptr) {
__ESBMC_HIDE:;
  int res;
  __ESBMC_assert(__ESBMC_is_zero_string(nptr),
                 "zero-termination of argument of atoi");
  return res;
}


x86 assembly (clang, -O0):
<atoi_strabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__ESBMC_is_zero_string@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1030 <__ESBMC_assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_strabs>:
push   %rax
call   1040 <__ESBMC_is_zero_string@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <__ESBMC_assert@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"zero-termination of argument of atoi\00"
define i32 @atoi_strabs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1
%5 = load i8*, i8** %2
%6 = call i32 @__ESBMC_is_zero_string(i8* %5)
%7 = call i32 @__ESBMC_assert(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [37 x i8] c"zero-termination of argument of atoi\00"
define i32 @atoi_strabs(i8* %0) {
%2 = tail call i32 @__ESBMC_is_zero_string(i8* %0)
%3 = tail call i32 @__ESBMC_assert(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int parse_number(char *, int *, int /*<<< orphan*/);
int parse_num(char *arg, int *res) { return parse_number(arg, res, 0); }


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

x86 assembly (clang, -O2):
<parse_num>:
xor    %edx,%edx
jmp    1030 <parse_number@plt>

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

LLVM IR (-O2):
define i32 @parse_num(i8* %0, i32* %1) {
%3 = tail call i32 @parse_number(i8* %0, i32* %1, i32 0)
ret i32 %3
}
double conc_grad(double pos[3]) { return pos[0] + pos[1] - pos[2]; }


x86 assembly (clang, -O0):
<conc_grad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conc_grad>:
movsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
subsd  0x10(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @conc_grad(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = fadd double %5, %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = fsub double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @conc_grad(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fadd double %2, %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = fsub double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_strb(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_imm5_op(int);
void t16_strb_imm5() { arm_memio_strb(t16_memio_imm5_op(1)); }


x86 assembly (clang, -O0):
<t16_strb_imm5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_strb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_strb_imm5>:
push   %rax
mov    $0x1,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_strb@plt>

LLVM IR (-O0):
define void @t16_strb_imm5() {
%1 = call i32 @t16_memio_imm5_op(i32 1)
%2 = call i32 @arm_memio_strb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_strb_imm5() {
%1 = tail call i32 @t16_memio_imm5_op(i32 1)
%2 = tail call i32 @arm_memio_strb(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <name> <value> <file>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [33 x i8] c"Usage: %s <name> <value> <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [33 x i8] c"Usage: %s <name> <value> <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pic12_programregion(int, int, int);
int /*<<< orphan*/ pic12_standby();
int /*<<< orphan*/ pic12_write_config();
void pic12_program_end(int config) {
  pic12_programregion((0xFFFF), (1), (0xFFFF));
  pic12_standby();
  if (config)
    pic12_write_config();
}


x86 assembly (clang, -O0):
<pic12_program_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffff,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <pic12_programregion@plt>
mov    $0x0,%al
call   1050 <pic12_standby@plt>
cmpl   $0x0,-0x4(%rbp)
je     1164 <pic12_program_end+0x34>
mov    $0x0,%al
call   1040 <pic12_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic12_program_end>:
push   %rbx
mov    %edi,%ebx
mov    $0xffff,%edi
mov    $0x1,%esi
mov    $0xffff,%edx
call   1030 <pic12_programregion@plt>
xor    %eax,%eax
call   1050 <pic12_standby@plt>
test   %ebx,%ebx
je     115a <pic12_program_end+0x2a>
xor    %eax,%eax
pop    %rbx
jmp    1040 <pic12_write_config@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @pic12_program_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pic12_programregion(i32 65535, i32 1, i32 65535)
%4 = call i32 (...) @pic12_standby()
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @pic12_write_config()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @pic12_program_end(i32 %0) {
%2 = tail call i32 @pic12_programregion(i32 65535, i32 1, i32 65535)
%3 = tail call i32 (...) @pic12_standby()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @pic12_write_config()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_set_receive_memblock_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_set_receive_memblock_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"NOT IMPLEMENTED:pa_pstream_set_receive_memblock_callback\0A\00"
define i32 @pa_pstream_set_receive_memblock_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [57 x i8] c"NOT IMPLEMENTED:pa_pstream_set_receive_memblock_callback\00"
define i32 @pa_pstream_set_receive_memblock_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned short VIM_HIF_GetReg16(int);
void VIM_IPP_GetWindowSize(unsigned short *wWidth, unsigned short *wHeight) {
  *wWidth = VIM_HIF_GetReg16((0x1c00 + 0x006));
  *wHeight = VIM_HIF_GetReg16((0x1c00 + 0x008));
}


x86 assembly (clang, -O0):
<VIM_IPP_GetWindowSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1c06,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    $0x1c08,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_GetWindowSize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1c06,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%rbx)
mov    $0x1c08,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @VIM_IPP_GetWindowSize(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = call zeroext i16 @VIM_HIF_GetReg16(i32 7174)
%6 = load i16*, i16** %3
store i16 %5, i16* %6
%7 = call zeroext i16 @VIM_HIF_GetReg16(i32 7176)
%8 = load i16*, i16** %4
store i16 %7, i16* %8
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_GetWindowSize(i16* nocapture writeonly %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7174)
store i16 %3, i16* %0
%4 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7176)
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f0(int);
int g() {
  f0(1);
  return 10;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f0@plt>
mov    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    $0x1,%edi
call   1030 <f0@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 @f0(i32 1)
ret i32 10
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f0(i32 1)
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ get_header(void *);
void free_space(void **space) {
  free(get_header(*space));
  *space = NULL;
  return;
}


x86 assembly (clang, -O0):
<free_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <get_header@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <get_header@plt>
mov    %eax,%edi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_space(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @get_header(i8* %4)
%6 = call i32 @free(i32 %5)
%7 = load i8**, i8*** %2
store i8* null, i8** %7
ret void
}

LLVM IR (-O2):
define void @free_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @get_header(i8* %2)
%4 = tail call i32 @free(i32 %3)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
bool __ptr_oob(void *ptr, void *start, size_t size) {
  void *end = (void *)((unsigned long)start + size);
  return ptr > end || ptr < start;
}


x86 assembly (clang, -O0):
<__ptr_oob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
ja     113d <__ptr_oob+0x3d>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ptr_oob>:
add    %rsi,%rdx
cmp    %rdi,%rdx
setb   %al
cmp    %rsi,%rdi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__ptr_oob(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i64, i64* %6
%11 = add i64 %9, %10
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %4
%14 = load i8*, i8** %7
%15 = icmp ugt i8* %13, %14
br i1 %15, label %20, label %16
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = icmp ult i8* %17, %18
br label %20
20: ; preds = %16, %3
%21 = phi i1 [ true, %3 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @__ptr_oob(i8* readnone %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = add i64 %4, %2
%6 = inttoptr i64 %5 to i8*
%7 = icmp ult i8* %6, %0
%8 = icmp ult i8* %0, %1
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
int XTextWidth16() {}


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

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

LLVM IR (-O0):
define i32 @XTextWidth16() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XTextWidth16() {
ret i32 undef
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void tty_mode(int how) {
  static struct termios old_mode;
  if (how == 0) {
    tcgetattr(0, &old_mode);
  } else {
    tcsetattr(0, TCSANOW, &old_mode);
  }
}


x86 assembly (clang, -O0):
<tty_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <tty_mode+0x28>
xor    %edi,%edi
lea    0x2ef6(%rip),%rsi
call   1030 <tcgetattr@plt>
jmp    115f <tty_mode+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    0x2eda(%rip),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_mode>:
test   %edi,%edi
je     113b <tty_mode+0x1b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdx
xor    %edi,%edi
jmp    1040 <tcsetattr@plt>
lea    0x2ef2(%rip),%rsi
xor    %edi,%edi
jmp    1030 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@tty_mode.old_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.old_mode)
br label %10
7: ; preds = %1
%8 = load i32, i32* @TCSANOW
%9 = call i32 @tcsetattr(i32 0, i32 %8, %struct.termios* @tty_mode.old_mode)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@tty_mode.old_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.old_mode)
br label %8
5: ; preds = %1
%6 = load i32, i32* @TCSANOW
%7 = tail call i32 @tcsetattr(i32 0, i32 %6, %struct.termios* @tty_mode.old_mode)
br label %8
8: ; preds = %5, %3
ret void
}
int in(int n, int from, int to) { return n >= from && n <= to; }


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <in+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in(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 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
OP(ed, a4) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ dlsym(void *, char *);
int wsrep_check_iface_version(char *, char *);
int wsrep_check_version_symbol(void *dlh) {
  char **dlversion = NULL;
  dlversion = (char **)dlsym(dlh, "wsrep_interface_version");
  if (dlversion == NULL)
    return 0;
  return wsrep_check_iface_version(*dlversion, "31");
}


x86 assembly (clang, -O0):
<wsrep_check_version_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115f <wsrep_check_version_symbol+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1175 <wsrep_check_version_symbol+0x55>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xeab(%rip),%rsi
call   1030 <wsrep_check_iface_version@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsrep_check_version_symbol>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <dlsym@plt>
test   %rax,%rax
je     1142 <wsrep_check_version_symbol+0x22>
mov    (%rax),%rdi
lea    0xedc(%rip),%rsi
pop    %rax
jmp    1030 <wsrep_check_iface_version@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"wsrep_interface_version\00"
@.str.1 = [3 x i8] c"31\00"
define i32 @wsrep_check_version_symbol(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** null, i8*** %4
%5 = load i8*, i8** %3
%6 = call i64 @dlsym(i8* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %4
%8 = load i8**, i8*** %4
%9 = icmp eq i8** %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %15
11: ; preds = %1
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = call i32 @wsrep_check_iface_version(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"wsrep_interface_version\00"
@.str.1 = [3 x i8] c"31\00"
define i32 @wsrep_check_version_symbol(i8* %0) {
%2 = tail call i64 @dlsym(i8* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @wsrep_check_iface_version(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ BaroSensorHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void BaroSensorLogging() { UAVObjLogging(BaroSensorHandle()); }


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

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

LLVM IR (-O0):
define void @BaroSensorLogging() {
%1 = call i32 (...) @BaroSensorHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroSensorLogging() {
%1 = tail call i32 (...) @BaroSensorHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Hw_Led_Init();
int /*<<< orphan*/ Hw_PLL_Init();
int /*<<< orphan*/ Hw_Uart_Init();
void Hw_Init(void) {
  Hw_PLL_Init();
  (*(volatile unsigned long *)(0x40010800 + 0x0000)) = 0x33333333;
  (*(volatile unsigned long *)(0x40010800 + 0x0004)) = 0x333334B3;
  (*(volatile unsigned long *)(0x40010C00 + 0x0000)) = 0x33333333;
  (*(volatile unsigned long *)(0x40010C00 + 0x0004)) = 0x33333333;
  (*(volatile unsigned long *)(0x40011000 + 0x0004)) = 0x33444444;
  Hw_Uart_Init();
  Hw_Led_Init();
}


x86 assembly (clang, -O0):
<Hw_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <Hw_PLL_Init@plt>
mov    $0x40010800,%eax
movq   $0x33333333,(%rax)
mov    $0x40010804,%eax
movq   $0x333334b3,(%rax)
mov    $0x40010c00,%eax
movq   $0x33333333,(%rax)
mov    $0x40010c04,%eax
movq   $0x33333333,(%rax)
mov    $0x40011004,%eax
movq   $0x33444444,(%rax)
mov    $0x0,%al
call   1040 <Hw_Uart_Init@plt>
mov    $0x0,%al
call   1030 <Hw_Led_Init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hw_Init>:
push   %rax
xor    %eax,%eax
call   1050 <Hw_PLL_Init@plt>
movq   $0x33333333,0x40010800
40 33 33 33 33
movq   $0x333334b3,0x40010804
40 b3 34 33 33
movq   $0x33333333,0x40010c00
40 33 33 33 33
movq   $0x33333333,0x40010c04
40 33 33 33 33
movq   $0x33444444,0x40011004
40 44 44 44 33
xor    %eax,%eax
call   1040 <Hw_Uart_Init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Hw_Led_Init@plt>

LLVM IR (-O0):
define void @Hw_Init() {
%1 = call i32 (...) @Hw_PLL_Init()
store volatile i64 858993459, i64* inttoptr (i64 1073809408 to i64*)
store volatile i64 858993843, i64* inttoptr (i64 1073809412 to i64*)
store volatile i64 858993459, i64* inttoptr (i64 1073810432 to i64*)
store volatile i64 858993459, i64* inttoptr (i64 1073810436 to i64*)
store volatile i64 860111940, i64* inttoptr (i64 1073811460 to i64*)
%2 = call i32 (...) @Hw_Uart_Init()
%3 = call i32 (...) @Hw_Led_Init()
ret void
}

LLVM IR (-O2):
define void @Hw_Init() {
%1 = tail call i32 (...) @Hw_PLL_Init()
store volatile i64 858993459, i64* inttoptr (i64 1073809408 to i64*)
store volatile i64 858993843, i64* inttoptr (i64 1073809412 to i64*)
store volatile i64 858993459, i64* inttoptr (i64 1073810432 to i64*)
store volatile i64 858993459, i64* inttoptr (i64 1073810436 to i64*)
store volatile i64 860111940, i64* inttoptr (i64 1073811460 to i64*)
%2 = tail call i32 (...) @Hw_Uart_Init()
%3 = tail call i32 (...) @Hw_Led_Init()
ret void
}
void display_print(char *s) {}


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

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

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

LLVM IR (-O2):
define void @display_print(i8* nocapture %0) {
ret void
}
long int factorial(int n) {
  if (n <= 1) {
    return 1;
  } else
    return (n * factorial(n - 1));
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1154 <factorial+0x44>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <factorial+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <factorial+0x20>
ret

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

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = icmp ult i64 %6, 3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ waitTick(unsigned long);
void waitMs(unsigned long ms) { waitTick((ms * 300) / 1000); }


x86 assembly (clang, -O0):
<waitMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x12c,-0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
call   1030 <waitTick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitMs>:
imul   $0x12c,%rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%rdi
shr    $0x4,%rdi
jmp    1030 <waitTick@plt>

LLVM IR (-O0):
define void @waitMs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 300
%5 = udiv i64 %4, 1000
%6 = call i32 @waitTick(i64 %5)
ret void
}

LLVM IR (-O2):
define void @waitMs(i64 %0) {
%2 = mul i64 %0, 300
%3 = udiv i64 %2, 1000
%4 = tail call i32 @waitTick(i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void SysCtlIntDisable(uint32_t ui32Ints) {
  (*((volatile uint32_t *)(0x400FE054))) &= ~(ui32Ints);
}


x86 assembly (clang, -O0):
<SysCtlIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x400fe054,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x400fe054,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntDisable>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,0x400fe054
ret

LLVM IR (-O0):
define void @SysCtlIntDisable(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074782292 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074782292 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlIntDisable(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074782292 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074782292 to i32*)
ret void
}
__attribute__((always_)) long clamp_long(long a, long b, long c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp_long+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp_long+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp_long+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp_long+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_long>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamp_long(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int func(int auth, char *str) {
  char data[32];
  strcpy(data, str);
  if (auth == 1) {
    printf("Secret!\n");
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1167 <func+0x37>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
jmp    116e <func+0x3e>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
call   1030 <strcpy@plt>
cmp    $0x1,%ebx
jne    1156 <func+0x26>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Secret!\0A\00"
define i32 @func(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [32 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [8 x i8] c"Secret!\00"
define i32 @func(i32 %0, i8* %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %1)
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
9: ; preds = %2
%10 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ begin_server();
int /*<<< orphan*/ parse_options(int, char **);
int /*<<< orphan*/ server_run();
int /*<<< orphan*/ start_listen();
int main(int argc, char **argv) {
  parse_options(argc, argv);
  start_listen();
  begin_server();
  server_run();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_options@plt>
mov    $0x0,%al
call   1060 <start_listen@plt>
mov    $0x0,%al
call   1050 <begin_server@plt>
mov    $0x0,%al
call   1040 <server_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parse_options@plt>
xor    %eax,%eax
call   1060 <start_listen@plt>
xor    %eax,%eax
call   1050 <begin_server@plt>
xor    %eax,%eax
call   1040 <server_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @parse_options(i32 %5, i8** %6)
%8 = call i32 (...) @start_listen()
%9 = call i32 (...) @begin_server()
%10 = call i32 (...) @server_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @start_listen()
%5 = tail call i32 (...) @begin_server()
%6 = tail call i32 (...) @server_run()
ret i32 0
}
void task_exit() { ("task_exit"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"task_exit\00"
define void @task_exit() {
ret void
}

LLVM IR (-O2):
define void @task_exit() {
ret void
}