xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prompt();
int /*<<< orphan*/ stdout;
void procSignal(int iSigNo) {
  printf("\n");
  (void)fflush(stdout);
  prompt();
}


x86 assembly (clang, -O0):
<procSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <prompt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procSignal>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <prompt@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
define void @procSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @prompt()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @procSignal(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 (...) @prompt()
ret void
}
/* Variables and functions */
size_t __ht_next_fold_hash(size_t hash, int M) {
  size_t k = (1 << ((sizeof(size_t) * 8) - M - 1));
  return (hash + k) & ~(k - 1);
}


x86 assembly (clang, -O0):
<__ht_next_fold_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x40,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ht_next_fold_hash>:
mov    $0x3f,%cl
sub    %sil,%cl
mov    $0x1,%eax
shl    %cl,%eax
cltq
lea    (%rdi,%rax,1),%rcx
neg    %rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__ht_next_fold_hash(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = sub i64 64, %7
%9 = sub i64 %8, 1
%10 = trunc i64 %9 to i32
%11 = shl i32 1, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %5
%13 = load i64, i64* %3
%14 = load i64, i64* %5
%15 = add i64 %13, %14
%16 = load i64, i64* %5
%17 = sub i64 %16, 1
%18 = xor i64 %17, -1
%19 = and i64 %15, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @__ht_next_fold_hash(i64 %0, i32 %1) {
%3 = sub i32 63, %1
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = add i64 %5, %0
%7 = sub nsw i64 0, %5
%8 = and i64 %6, %7
ret i64 %8
}
int test_imm_2Eint16_reg(short val) {
  return ((val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 46
%6 = icmp ne i32 %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_2Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 46
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int zero();
void test4() {
  volatile int v = 44 / zero();
  (void)v;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <zero@plt>
mov    %eax,%ecx
mov    $0x2c,%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
xor    %eax,%eax
call   1030 <zero@plt>
mov    %eax,%ecx
mov    $0x2c,%eax
xor    %edx,%edx
idiv   %ecx
mov    %eax,0x4(%rsp)
mov    0x4(%rsp),%eax
pop    %rax
ret

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32
%2 = call i32 (...) @zero()
%3 = sdiv i32 44, %2
store volatile i32 %3, i32* %1
%4 = load volatile i32, i32* %1
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @zero()
%4 = sdiv i32 44, %3
store volatile i32 %4, i32* %1
%5 = load volatile i32, i32* %1
ret void
}
/* Variables and functions */
int CCutil_lprand();
short shortrand(short maxs) {
  int s = CCutil_lprand() % maxs;
  if (CCutil_lprand() % 1)
    s = -s;
  return (short)s;
}


x86 assembly (clang, -O0):
<shortrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <CCutil_lprand@plt>
movswl -0x2(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1030 <CCutil_lprand@plt>
mov    $0x1,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1150 <shortrand+0x40>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortrand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <CCutil_lprand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <CCutil_lprand@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @shortrand(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = call i32 (...) @CCutil_lprand()
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = srem i32 %4, %6
store i32 %7, i32* %3
%8 = call i32 (...) @CCutil_lprand()
%9 = srem i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @shortrand(i16 signext %0) {
%2 = tail call i32 (...) @CCutil_lprand()
%3 = tail call i32 (...) @CCutil_lprand()
%4 = sext i16 %0 to i32
%5 = srem i32 %2, %4
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Variables and functions */
int RAND_poll();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void random_stir(void) {
  if (RAND_poll() != 1) {
    fprintf(stderr, "RAND_poll failed\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<random_stir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <RAND_poll@plt>
cmp    $0x1,%eax
je     1160 <random_stir+0x30>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_stir>:
push   %rax
xor    %eax,%eax
call   1050 <RAND_poll@plt>
cmp    $0x1,%eax
jne    113f <random_stir+0xf>
pop    %rax
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"RAND_poll failed\0A\00"
define void @random_stir() {
%1 = call i32 (...) @RAND_poll()
%2 = icmp ne i32 %1, 1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"RAND_poll failed\0A\00"
define void @random_stir() {
%1 = tail call i32 (...) @RAND_poll()
%2 = icmp eq i32 %1, 1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *get_mount_by_mount_point(char const *);
int fuse_is_in_mounted_dir(const char path[]) {
  return get_mount_by_mount_point(path) != NULL;
}


x86 assembly (clang, -O0):
<fuse_is_in_mounted_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_mount_by_mount_point@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_is_in_mounted_dir>:
push   %rax
call   1030 <get_mount_by_mount_point@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fuse_is_in_mounted_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @get_mount_by_mount_point(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fuse_is_in_mounted_dir(i8* %0) {
%2 = tail call i32* @get_mount_by_mount_point(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void __DELETE_java_lang_Short(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_Short(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_Short(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int INHERENT_ptrace() { return 1; }


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

x86 assembly (clang, -O2):
<INHERENT_ptrace>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @INHERENT_ptrace() {
ret i32 1
}

LLVM IR (-O2):
define i32 @INHERENT_ptrace() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char const *);
int setenv(char const *, char const *, int);
void xsetenv(const char *name, const char *value, int overwrite) {
  if (setenv(name, value, overwrite) == -1)
    fatal_error("Unable to set variable `%s'\n", name);
}


x86 assembly (clang, -O0):
<xsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <setenv@plt>
cmp    $0xffffffff,%eax
jne    115c <xsetenv+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <fatal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsetenv>:
push   %rbx
mov    %rdi,%rbx
call   1030 <setenv@plt>
cmp    $0xffffffff,%eax
je     1130 <xsetenv+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fatal_error@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Unable to set variable `%s'\0A\00"
define void @xsetenv(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @setenv(i8* %7, i8* %8, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = call i32 @fatal_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Unable to set variable `%s'\0A\00"
define void @xsetenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fatal_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3
ret void
}
int test_imm_C7uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 57
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t popcnt64(uint64_t x) {
  __asm__("popcnt %1, %0" : "=r"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @popcnt64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "popcnt $1, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @popcnt64(i8* readnone %0) {
%2 = tail call i8* asm "popcnt $1, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int main(void) {
  int a = 5;
  *(&a + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 5, i32* %1
%2 = getelementptr inbounds i32, i32* %1, i64 1
%3 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void om_html_close_title(FILE *fp) { (void)fp; }


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

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

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

LLVM IR (-O2):
define void @om_html_close_title(i32* nocapture %0) {
ret void
}
double stb_linear_remap(double x, double x_min, double x_max, double out_min,
                        double out_max) {
  return ((out_min) + ((((x) - (x_min)) / (float)((x_max) - (x_min)))) *
                          (float)((out_max) - (out_min)));
}


x86 assembly (clang, -O0):
<stb_linear_remap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
cvtsd2ss %xmm2,%xmm2
cvtss2sd %xmm2,%xmm2
divsd  %xmm2,%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
cvtsd2ss %xmm2,%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_linear_remap>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm3,%xmm4
xorps  %xmm2,%xmm2
cvtsd2ss %xmm4,%xmm2
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @stb_linear_remap(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %9
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fsub double %12, %13
%15 = load double, double* %8
%16 = load double, double* %7
%17 = fsub double %15, %16
%18 = fptrunc double %17 to float
%19 = fpext float %18 to double
%20 = fdiv double %14, %19
%21 = load double, double* %10
%22 = load double, double* %9
%23 = fsub double %21, %22
%24 = fptrunc double %23 to float
%25 = fpext float %24 to double
%26 = call double @llvm.fmuladd.f64(double %20, double %25, double %11)
ret double %26
}

LLVM IR (-O2):
define double @stb_linear_remap(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %2, %1
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = fdiv double %6, %9
%11 = fsub double %4, %3
%12 = fptrunc double %11 to float
%13 = fpext float %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %10, double %13, double %3)
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail(char const *, int, char *, int);
void assert_int_not_equal_(const char *file, int line, int ex, int ac) {
  if (ex == ac) {
    assert_fail(file, line, "Expected not <%d> but was", ex);
  }
}


x86 assembly (clang, -O0):
<assert_int_not_equal_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1147 <assert_int_not_equal_+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xebe(%rip),%rdx
call   1030 <assert_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_int_not_equal_>:
cmp    %ecx,%edx
jne    1124 <assert_int_not_equal_+0x14>
mov    %edx,%eax
lea    0xee3(%rip),%rdx
mov    %eax,%ecx
jmp    1030 <assert_fail@plt>
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Expected not <%d> but was\00"
define void @assert_int_not_equal_(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @assert_fail(i8* %13, i32 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Expected not <%d> but was\00"
define void @assert_int_not_equal_(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @assert_fail(i8* %0, i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ switch_led(int, int, int *);
int main(void) {
  (*(volatile unsigned long *)(0xE01FC000 + 0x000)) = 2;
  int led0_marker = 0;
  int led1_marker = 0;
  init();
  while (1) {
    switch_led((1 << 16), (1 << 1), &led0_marker);
    switch_led((1 << 17), (1 << 2), &led1_marker);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x10000,%edi
mov    $0x2,%esi
lea    -0x8(%rbp),%rdx
call   1030 <switch_led@plt>
mov    $0x20000,%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <switch_led@plt>
jmp    1150 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
xor    %eax,%eax
call   1040 <init@plt>
lea    0x4(%rsp),%r14
mov    %rsp,%rbx
xchg   %ax,%ax
mov    $0x10000,%edi
mov    $0x2,%esi
mov    %r14,%rdx
call   1030 <switch_led@plt>
mov    $0x20000,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <switch_led@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @init()
br label %5
5: ; preds = %0, %5
%6 = call i32 @switch_led(i32 65536, i32 2, i32* %2)
%7 = call i32 @switch_led(i32 131072, i32 4, i32* %3)
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (...) @init()
br label %6
6: ; preds = %6, %0
%7 = call i32 @switch_led(i32 65536, i32 2, i32* %1)
%8 = call i32 @switch_led(i32 131072, i32 4, i32* %2)
br label %6
}
void macosxCGS_unused(void) {}


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

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

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

LLVM IR (-O2):
define void @macosxCGS_unused() {
ret void
}
double opr_hbar(struct lifo *stack) { return 1.0545726691251E-34; }


x86 assembly (clang, -O0):
<opr_hbar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_hbar(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x38E185A7F2D7FA6D
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_hbar(%struct.lifo* nocapture readnone %0) {
ret double 0x38E185A7F2D7FA6D
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t nbytes) {
  void *nptr = realloc(ptr, nbytes);
  if (nptr == NULL) {
    abort();
  }
  return nptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <xrealloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *str = malloc(256);
  strcpy(str, "Hello World");
  reverse(str);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 256)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @reverse(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @reverse(i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showusage() {
  printf("si446x [options]\n");
  printf("-m tx/rx: tx or rx mode\n");
  printf("-h : Help\n");
}


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

x86 assembly (clang, -O2):
<showusage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"si446x [options]\0A\00"
@.str.1 = [25 x i8] c"-m tx/rx: tx or rx mode\0A\00"
@.str.2 = [11 x i8] c"-h : Help\0A\00"
define void @showusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"si446x [options]\00"
@str.3 = [24 x i8] c"-m tx/rx: tx or rx mode\00"
@str.4 = [10 x i8] c"-h : Help\00"
define void @showusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
double Uglue(double, double, double);
double dPhi_dPhi_Uglue(double Phi, double T, double mu) {
  return Uglue(Phi, T, mu);
}


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

x86 assembly (clang, -O2):
<dPhi_dPhi_Uglue>:
jmp    1030 <Uglue@plt>

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

LLVM IR (-O2):
define double @dPhi_dPhi_Uglue(double %0, double %1, double %2) {
%4 = tail call double @Uglue(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void NMI_disable() { outb(0x70, inb(0x70) | 0x80); }


x86 assembly (clang, -O0):
<NMI_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
call   1040 <inb@plt>
mov    %eax,%esi
or     $0x80,%esi
mov    $0x70,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMI_disable>:
push   %rax
mov    $0x70,%edi
call   1040 <inb@plt>
or     $0x80,%eax
mov    $0x70,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @NMI_disable() {
%1 = call i32 @inb(i32 112)
%2 = or i32 %1, 128
%3 = call i32 @outb(i32 112, i32 %2)
ret void
}

LLVM IR (-O2):
define void @NMI_disable() {
%1 = tail call i32 @inb(i32 112)
%2 = or i32 %1, 128
%3 = tail call i32 @outb(i32 112, i32 %2)
ret void
}
void limpiarvar(char aux[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    aux[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<limpiarvar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <limpiarvar+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <limpiarvar+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpiarvar>:
test   %esi,%esi
jle    1122 <limpiarvar+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @limpiarvar(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_ptr(void *x) { assert_or_panic(x == (void *)0xdeadbeefL); }


x86 assembly (clang, -O0):
<c_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xdeadbeef,%eax
cmp    %rax,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert_or_panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ptr>:
mov    $0xdeadbeef,%ecx
xor    %eax,%eax
cmp    %rcx,%rdi
sete   %al
mov    %eax,%edi
jmp    1030 <assert_or_panic@plt>

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

LLVM IR (-O2):
define void @c_ptr(i8* readnone %0) {
%2 = icmp eq i8* %0, inttoptr (i64 3735928559 to i8*)
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert_or_panic(i32 %3)
ret void
}
/* Type definitions */
struct sockaddr {
  int /*<<< orphan*/ sa_family;
};

/* Variables and functions */
char *getFamilyName(int /*<<< orphan*/);
int /*<<< orphan*/ getsockname(int, struct sockaddr *, size_t *);
char *getSocketFamilyfromFD(int __fd) {
  struct sockaddr sa;
  size_t len;
  getsockname(__fd, &sa, &len);
  return getFamilyName(sa.sa_family);
}


x86 assembly (clang, -O0):
<getSocketFamilyfromFD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <getsockname@plt>
mov    -0x8(%rbp),%edi
call   1030 <getFamilyName@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSocketFamilyfromFD>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <getsockname@plt>
mov    0x8(%rsp),%edi
call   1030 <getFamilyName@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i8* @getSocketFamilyfromFD(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @getsockname(i32 %5, %struct.sockaddr* %3, i64* %4)
%7 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i8* @getFamilyName(i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i8* @getSocketFamilyfromFD(i32 %0) {
%2 = alloca %struct.sockaddr
%3 = alloca i64
%4 = bitcast %struct.sockaddr* %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32 @getsockname(i32 %0, %struct.sockaddr* %2, i64* %3)
%7 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i8* @getFamilyName(i32 %8)
ret i8* %9
}
void timer_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @timer_stop() {
ret void
}
/* Variables and functions */
int get_addr_family(char const *);
scalar_t__ inet_pton(int, char const *, void *);
int get_netaddr(const char *ip_str, void *ip) {
  int family;
  family = get_addr_family(ip_str);
  if (inet_pton(family, ip_str, ip) <= 0)
    return -1;
  return family;
}


x86 assembly (clang, -O0):
<get_netaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_addr_family@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <inet_pton@plt>
cmp    $0x0,%rax
jg     1162 <get_netaddr+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <get_netaddr+0x48>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_netaddr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <get_addr_family@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <inet_pton@plt>
test   %rax,%rax
mov    $0xffffffff,%eax
cmovg  %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_netaddr(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i32 @get_addr_family(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i64 @inet_pton(i32 %9, i8* %10, i8* %11)
%13 = icmp sle i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_netaddr(i8* %0, i8* %1) {
%3 = tail call i32 @get_addr_family(i8* %0)
%4 = tail call i64 @inet_pton(i32 %3, i8* %0, i8* %1)
%5 = icmp slt i64 %4, 1
%6 = select i1 %5, i32 -1, i32 %3
ret i32 %6
}
/* Variables and functions */
double FPop();
int /*<<< orphan*/ Push(int);
void pFZLESS() { Push(FPop() < 0.0 ? -1 : 0); }


x86 assembly (clang, -O0):
<pFZLESS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <FPop@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
xor    %edi,%edi
mov    $0xffffffff,%eax
ucomisd %xmm1,%xmm0
cmova  %eax,%edi
call   1030 <Push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pFZLESS>:
push   %rax
xor    %eax,%eax
call   1040 <FPop@plt>
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
neg    %edi
pop    %rax
jmp    1030 <Push@plt>

LLVM IR (-O0):
define void @pFZLESS() {
%1 = call double (...) @FPop()
%2 = fcmp olt double %1, 0.000000e+00
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 -1, i32 0
%5 = call i32 @Push(i32 %4)
ret void
}

LLVM IR (-O2):
define void @pFZLESS() {
%1 = tail call double (...) @FPop()
%2 = fcmp olt double %1, 0.000000e+00
%3 = sext i1 %2 to i32
%4 = tail call i32 @Push(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ __ptsname_r(int, char *, int);
int revoke(char *);
int unlockpt(int fd) {
  char buf[1024];
  if (__ptsname_r(fd, buf, sizeof(buf)))
    return -1;
  return revoke(buf);
}


x86 assembly (clang, -O0):
<unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1030 <__ptsname_r@plt>
cmp    $0x0,%rax
je     1158 <unlockpt+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <unlockpt+0x47>
lea    -0x410(%rbp),%rdi
call   1040 <revoke@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockpt>:
sub    $0x408,%rsp
mov    %rsp,%rsi
mov    $0x400,%edx
call   1030 <__ptsname_r@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1149 <unlockpt+0x29>
add    $0x408,%rsp
ret
mov    %rsp,%rdi
call   1040 <revoke@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define i32 @unlockpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = call i64 @__ptsname_r(i32 %5, i8* %6, i32 1024)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%12 = call i32 @revoke(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @unlockpt(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i64 @__ptsname_r(i32 %0, i8* %3, i32 1024)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @revoke(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
ret i32 %9
}
void inicio(int tab[3][3]) {
  int i, j;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      tab[i][j] = 0;
}


x86 assembly (clang, -O0):
<inicio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1165 <inicio+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1152 <inicio+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <inicio+0x20>
jmp    1157 <inicio+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <inicio+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicio>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @inicio([3 x i32]* nocapture writeonly %0) {
%2 = bitcast [3 x i32]* %0 to i8*
ret void
}
void vsub(double *sub, double *v1, double *v2) {
  sub[0] = v1[0] - v2[0];
  sub[1] = v1[1] - v2[1];
  sub[2] = v1[2] - v2[2];
}


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

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

LLVM IR (-O0):
define void @vsub(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** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @vsub(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
void gtk_vbox_get_type() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
off_t lseek(int fd, off_t offset, int whence) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lseek(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* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ local_irq_restore(unsigned long);
int /*<<< orphan*/ local_irq_save(unsigned long);
void atomic_clear_mask(unsigned long mask, unsigned long *addr) {
  unsigned long flags = 0;
  local_irq_save(flags);
  *addr &= ~mask;
  local_irq_restore(flags);
}


x86 assembly (clang, -O0):
<atomic_clear_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <local_irq_save@plt>
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x10(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1040 <local_irq_restore@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_clear_mask>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <local_irq_save@plt>
not    %rbx
and    %rbx,(%r14)
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <local_irq_restore@plt>

LLVM IR (-O0):
define void @atomic_clear_mask(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
store i64 %0, i64* %3
store i64* %1, i64** %4
store i64 0, i64* %5
%6 = load i64, i64* %5
%7 = call i32 @local_irq_save(i64 %6)
%8 = load i64, i64* %3
%9 = xor i64 %8, -1
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = and i64 %11, %9
store i64 %12, i64* %10
%13 = load i64, i64* %5
%14 = call i32 @local_irq_restore(i64 %13)
ret void
}

LLVM IR (-O2):
define void @atomic_clear_mask(i64 %0, i64* nocapture %1) {
%3 = tail call i32 @local_irq_save(i64 0)
%4 = xor i64 %0, -1
%5 = load i64, i64* %1
%6 = and i64 %5, %4
store i64 %6, i64* %1
%7 = tail call i32 @local_irq_restore(i64 0)
ret void
}
int isLengthChar(int c) {
  switch (c) {
  case 'h':
  case 'l':
  case 'L':
  case 'z':
  case 'j':
  case 't':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isLengthChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4c,%eax
je     1170 <isLengthChar+0x70>
jmp    111b <isLengthChar+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
je     1170 <isLengthChar+0x70>
jmp    112c <isLengthChar+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x6a,%eax
je     1170 <isLengthChar+0x70>
jmp    113d <isLengthChar+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x6c,%eax
je     1170 <isLengthChar+0x70>
jmp    114e <isLengthChar+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x74,%eax
je     1170 <isLengthChar+0x70>
jmp    115f <isLengthChar+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x7a,%eax
jne    117c <isLengthChar+0x7c>
jmp    1170 <isLengthChar+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1183 <isLengthChar+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLengthChar>:
add    $0xffffffb4,%edi
cmp    $0x2e,%edi
ja     111e <isLengthChar+0x1e>
mov    $0x1,%eax
movabs $0x410150000001,%rcx
bt     %rdi,%rcx
jae    111e <isLengthChar+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isLengthChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 104, label %5
i32 108, label %5
i32 76, label %5
i32 122, label %5
i32 106, label %5
i32 116, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isLengthChar(i32 %0) {
switch i32 %0, label %2 [
i32 104, label %3
i32 108, label %3
i32 76, label %3
i32 122, label %3
i32 106, label %3
i32 116, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}