xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIOCSIFADDR;
int /*<<< orphan*/ do_ip_set(char *, int /*<<< orphan*/, char *);
void do_ip_addr_set(char *p) { do_ip_set(p, SIOCSIFADDR, "address"); }


x86 assembly (clang, -O0):
<do_ip_addr_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
call   1030 <do_ip_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ip_addr_set>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdx
jmp    1030 <do_ip_set@plt>

LLVM IR (-O0):
@SIOCSIFADDR = global i32 0
@.str = [8 x i8] c"address\00"
define void @do_ip_addr_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @SIOCSIFADDR
%5 = call i32 @do_ip_set(i8* %3, i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIOCSIFADDR = global i32 0
@.str = [8 x i8] c"address\00"
define void @do_ip_addr_set(i8* %0) {
%2 = load i32, i32* @SIOCSIFADDR
%3 = tail call i32 @do_ip_set(i8* %0, i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetOptions(char byBoardNum, long dwWidth, long dwHeight,
                 long dwPixelDepth, long dwTimeOut, long dwChannels) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvSetOptions>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetOptions(i8 signext %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i8
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i8 %0, i8* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetOptions(i8 signext %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ stdscr;
void setup() {
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  curs_set(0);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %edi,%edi
pop    %rax
jmp    1070 <curs_set@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @setup() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = call i32 @keypad(i32 %4, i32 %5)
%7 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @setup() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 @curs_set(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ansi_load() { printf("%c[u", 0x1B); }


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

x86 assembly (clang, -O2):
<ansi_load>:
lea    0xee9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c[u\00"
define void @ansi_load() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c[u\00"
define void @ansi_load() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
void imem() {}


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

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

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

LLVM IR (-O2):
define void @imem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xf1() {
  Assert_real((ispunct(241) == 0),
              "/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/ctype/test_ispunct.c",
              1210, ("ispunct should be 0 for 0xf1"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xf1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf1,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4ba,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xf1>:
push   %rax
mov    $0xf1,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ba,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf1\00"
define void @t_ispunct_0xf1() {
%1 = call i64 @ispunct(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xf1\00"
define void @t_ispunct_0xf1() {
%1 = tail call i64 @ispunct(i32 241)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1210, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void clear_leds() {
  static unsigned char *leds = (unsigned char *)0xd00003;
  *leds = 0xFF;
}


x86 assembly (clang, -O0):
<clear_leds>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
movb   $0xff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_leds>:
movb   $0xff,0xd00003
ff
ret

LLVM IR (-O0):
@clear_leds.leds = internal global i8* inttoptr (i64 13631491 to i8*)
define void @clear_leds() {
%1 = load i8*, i8** @clear_leds.leds
store i8 -1, i8* %1
ret void
}

LLVM IR (-O2):
define void @clear_leds() {
store i8 -1, i8* inttoptr (i64 13631491 to i8*)
ret void
}
void ft_strclr(char *s) {
  int i;
  i = 0;
  if (!s)
    return;
  while (s[i])
    i++;
  while (i + 1 > 0) {
    s[i] = '\0';
    i--;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111f <ft_strclr+0x1f>
jmp    1172 <ft_strclr+0x72>
jmp    1124 <ft_strclr+0x24>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1144 <ft_strclr+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ft_strclr+0x24>
jmp    1149 <ft_strclr+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jle    1172 <ft_strclr+0x72>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <ft_strclr+0x49>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     114b <ft_strclr+0x3b>
push   %rax
mov    $0xffffffffffffffff,%rdx
nopl   (%rax)
cmpb   $0x0,0x1(%rdi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_strclr+0x10>
mov    %edx,%eax
xor    %ecx,%ecx
test   %edx,%edx
cmovs  %edx,%ecx
sub    %ecx,%edx
sub    %rdx,%rax
add    %rax,%rdi
add    $0x1,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %18, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = and i64 %4, 4294967295
%12 = call i32 @llvm.smin.i32(i32 %10, i32 0)
%13 = sub i32 %10, %12
%14 = zext i32 %13 to i64
%15 = sub nsw i64 %11, %14
%16 = getelementptr i8, i8* %0, i64 %15
%17 = add nuw nsw i64 %14, 1
br label %18
18: ; preds = %9, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_int8(char *str, int8_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(int8_t), true);
}


x86 assembly (clang, -O0):
<try_parse_int8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_int8>:
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_int8(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 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_int8(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 1)
ret i32 %4
}
/* Type definitions */
typedef float int32_t;

/* Variables and functions */
float INT32_MAX;
float INT32_MIN;
int32_t ConvertSampleFloatToInt32(float sample) {
  float value = 2147483648.0f * sample;
  if (value <= INT32_MIN) {
    return INT32_MIN;
  } else if (value >= INT32_MAX) {
    return INT32_MAX;
  } else {
    return (int32_t)value;
  }
}


x86 assembly (clang, -O0):
<ConvertSampleFloatToInt32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
mov    0x2eb1(%rip),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jb     1149 <ConvertSampleFloatToInt32+0x49>
mov    0x2e9d(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117d <ConvertSampleFloatToInt32+0x7d>
movss  -0xc(%rbp),%xmm0
mov    0x2e8b(%rip),%rax
ucomiss (%rax),%xmm0
jb     1173 <ConvertSampleFloatToInt32+0x73>
mov    0x2e7b(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    117d <ConvertSampleFloatToInt32+0x7d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertSampleFloatToInt32>:
mulss  0xef8(%rip),%xmm0
mov    0x2ec9(%rip),%rax
movss  (%rax),%xmm1
mov    0x2ec6(%rip),%rax
movss  (%rax),%xmm2
movaps %xmm2,%xmm3
cmpless %xmm0,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
cmpnless %xmm1,%xmm0
andps  %xmm0,%xmm3
andnps %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
@INT32_MIN = global float 0.000000e+00
@INT32_MAX = global float 0.000000e+00
define float @ConvertSampleFloatToInt32(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fmul float 0x41E0000000000000, %5
store float %6, float* %4
%7 = load float, float* %4
%8 = load float, float* @INT32_MIN
%9 = fcmp ole float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load float, float* @INT32_MIN
store float %11, float* %2
br label %20
12: ; preds = %1
%13 = load float, float* %4
%14 = load float, float* @INT32_MAX
%15 = fcmp oge float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* @INT32_MAX
store float %17, float* %2
br label %20
18: ; preds = %12
%19 = load float, float* %4
store float %19, float* %2
br label %20
20: ; preds = %18, %16, %10
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
@INT32_MIN = global float 0.000000e+00
@INT32_MAX = global float 0.000000e+00
define float @ConvertSampleFloatToInt32(float %0) {
%2 = fmul float %0, 0x41E0000000000000
%3 = load float, float* @INT32_MIN
%4 = fcmp ugt float %2, %3
%5 = load float, float* @INT32_MAX
%6 = fcmp oge float %2, %5
%7 = select i1 %6, float %5, float %2
%8 = select i1 %4, float %7, float %3
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ gln_styled_char(int, char);
void gln_standout_char(char c) { gln_styled_char((1), c); }


x86 assembly (clang, -O0):
<gln_standout_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gln_styled_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gln_standout_char>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <gln_styled_char@plt>

LLVM IR (-O0):
define void @gln_standout_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @gln_styled_char(i32 1, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @gln_standout_char(i8 signext %0) {
%2 = tail call i32 @gln_styled_char(i32 1, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_free(int);
int /*<<< orphan*/ gpio_set_value(int, int /*<<< orphan*/);
void module_led_exit(void) {
  gpio_set_value(5, 0);
  gpio_free(5);
}


x86 assembly (clang, -O0):
<module_led_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %esi,%esi
call   1040 <gpio_set_value@plt>
mov    $0x5,%edi
call   1030 <gpio_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_led_exit>:
push   %rax
mov    $0x5,%edi
xor    %esi,%esi
call   1040 <gpio_set_value@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <gpio_free@plt>

LLVM IR (-O0):
define void @module_led_exit() {
%1 = call i32 @gpio_set_value(i32 5, i32 0)
%2 = call i32 @gpio_free(i32 5)
ret void
}

LLVM IR (-O2):
define void @module_led_exit() {
%1 = tail call i32 @gpio_set_value(i32 5, i32 0)
%2 = tail call i32 @gpio_free(i32 5)
ret void
}
unsigned short ip_fast_csum(unsigned char *buff, int wlen) { return 0; }


x86 assembly (clang, -O0):
<ip_fast_csum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @ip_fast_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @ip_fast_csum(i8* nocapture readnone %0, i32 %1) {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ ScuExec(int);
void ScuDspStep(void) { ScuExec(1); }


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

x86 assembly (clang, -O2):
<ScuDspStep>:
mov    $0x1,%edi
jmp    1030 <ScuExec@plt>

LLVM IR (-O0):
define void @ScuDspStep() {
%1 = call i32 @ScuExec(i32 1)
ret void
}

LLVM IR (-O2):
define void @ScuDspStep() {
%1 = tail call i32 @ScuExec(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
char *strstr(const char *a, const char *b) {
  const char *res = a;
  for (; *res != '\0'; res++) {
    if (strcmp(res, b) == 0) {
      return (char *)res;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <strstr+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115c <strstr+0x4c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <strstr+0x6a>
jmp    1161 <strstr+0x51>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <strstr+0x18>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113a <strstr+0x2a>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113c <strstr+0x2c>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <strstr+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = tail call i64 @strcmp(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %6, %5 ]
ret i8* %14
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ reuse_null_size();
int /*<<< orphan*/ reuse_out_of_mem();
void *xrealloc(void *ptr, size_t size) {
  if (ptr == NULL && size == 0)
    reuse_null_size();
  ptr = realloc(ptr, size);
  if (ptr == NULL)
    reuse_out_of_mem();
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <xrealloc+0x2d>
cmpq   $0x0,-0x10(%rbp)
jne    115d <xrealloc+0x2d>
mov    $0x0,%al
call   1030 <reuse_null_size@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1180 <xrealloc+0x50>
mov    $0x0,%al
call   1050 <reuse_out_of_mem@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
jne    114b <xrealloc+0x1b>
test   %r14,%r14
jne    114b <xrealloc+0x1b>
xor    %eax,%eax
call   1030 <reuse_null_size@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1165 <xrealloc+0x35>
xor    %eax,%eax
call   1050 <reuse_out_of_mem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @reuse_null_size()
br label %8
8: ; preds = %6, %2
%9 = tail call i8* @realloc(i8* %0, i64 %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @reuse_out_of_mem()
br label %13
13: ; preds = %11, %8
ret i8* %9
}
void INT_Excep_TPU4_TGI4A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU4_TGI4A() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blank_template_creation_test();
int /*<<< orphan*/ condition_template_creation_test();
int /*<<< orphan*/ dst_and_src_template_creation_test();
int /*<<< orphan*/ dst_template_creation_test();
int /*<<< orphan*/ rp_template_creation_test();
int /*<<< orphan*/ src_template_creation_test();
int main(int argc, const char *argv[]) {
  blank_template_creation_test();
  rp_template_creation_test();
  dst_template_creation_test();
  src_template_creation_test();
  dst_and_src_template_creation_test();
  condition_template_creation_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <blank_template_creation_test@plt>
mov    $0x0,%al
call   1060 <rp_template_creation_test@plt>
mov    $0x0,%al
call   1050 <dst_template_creation_test@plt>
mov    $0x0,%al
call   1080 <src_template_creation_test@plt>
mov    $0x0,%al
call   1040 <dst_and_src_template_creation_test@plt>
mov    $0x0,%al
call   1030 <condition_template_creation_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <blank_template_creation_test@plt>
xor    %eax,%eax
call   1060 <rp_template_creation_test@plt>
xor    %eax,%eax
call   1050 <dst_template_creation_test@plt>
xor    %eax,%eax
call   1080 <src_template_creation_test@plt>
xor    %eax,%eax
call   1040 <dst_and_src_template_creation_test@plt>
xor    %eax,%eax
call   1030 <condition_template_creation_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @blank_template_creation_test()
%7 = call i32 (...) @rp_template_creation_test()
%8 = call i32 (...) @dst_template_creation_test()
%9 = call i32 (...) @src_template_creation_test()
%10 = call i32 (...) @dst_and_src_template_creation_test()
%11 = call i32 (...) @condition_template_creation_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @blank_template_creation_test()
%4 = tail call i32 (...) @rp_template_creation_test()
%5 = tail call i32 (...) @dst_template_creation_test()
%6 = tail call i32 (...) @src_template_creation_test()
%7 = tail call i32 (...) @dst_and_src_template_creation_test()
%8 = tail call i32 (...) @condition_template_creation_test()
ret i32 0
}
/* Variables and functions */
double CalcDistance(double, float, float);
double pbhypotenuse_distance(double lng1, double lat1, double lng2,
                             double lat2) {
  double latitude = lat1 * 3600;
  float delta_lon = (lng1 - lng2) * 3600;
  float delta_lat = (lat1 - lat2) * 3600;
  return CalcDistance(latitude, delta_lon, delta_lat);
}


x86 assembly (clang, -O0):
<pbhypotenuse_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xecc(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
movss  -0x30(%rbp),%xmm2
call   1030 <CalcDistance@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbhypotenuse_distance>:
movsd  0xee8(%rip),%xmm6
movapd %xmm1,%xmm4
mulsd  %xmm6,%xmm4
subsd  %xmm2,%xmm0
mulsd  %xmm6,%xmm0
cvtsd2ss %xmm0,%xmm5
subsd  %xmm3,%xmm1
mulsd  %xmm6,%xmm1
xorps  %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm2
movapd %xmm4,%xmm0
movaps %xmm5,%xmm1
jmp    1030 <CalcDistance@plt>

LLVM IR (-O0):
define double @pbhypotenuse_distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca float
%11 = alloca float
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* %6
%13 = fmul double %12, 3.600000e+03
store double %13, double* %9
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fmul double %16, 3.600000e+03
%18 = fptrunc double %17 to float
store float %18, float* %10
%19 = load double, double* %6
%20 = load double, double* %8
%21 = fsub double %19, %20
%22 = fmul double %21, 3.600000e+03
%23 = fptrunc double %22 to float
store float %23, float* %11
%24 = load double, double* %9
%25 = load float, float* %10
%26 = load float, float* %11
%27 = call double @CalcDistance(double %24, float %25, float %26)
ret double %27
}

LLVM IR (-O2):
define double @pbhypotenuse_distance(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, 3.600000e+03
%6 = fsub double %0, %2
%7 = fmul double %6, 3.600000e+03
%8 = fptrunc double %7 to float
%9 = fsub double %1, %3
%10 = fmul double %9, 3.600000e+03
%11 = fptrunc double %10 to float
%12 = tail call double @CalcDistance(double %5, float %8, float %11)
ret double %12
}
int main(void) {
  puts("Physical memory usage data:\n");
  __asm__("int $0x82" ::"a"(0x06));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x6,%eax
int    $0x82
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x6,%eax
int    $0x82
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Physical memory usage data:\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Physical memory usage data:\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect "int $$0x82", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 6)
ret i32 0
}
void neural_layer_softmax_update(const struct Layer *l) { (void)l; }


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

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

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

LLVM IR (-O2):
%struct.Layer = type opaque
define void @neural_layer_softmax_update(%struct.Layer* nocapture %0) {
ret void
}
/* Variables and functions */
int __WORDSIZE;
int /*<<< orphan*/ memset(unsigned long *, int /*<<< orphan*/, int);
void bitmap_zero(unsigned long *dst, int nbits) {
  if (nbits <= __WORDSIZE)
    *dst = 0UL;
  else {
    int len = ((nbits + __WORDSIZE - 1) / __WORDSIZE) * sizeof(unsigned long);
    memset(dst, 0, len);
  }
}


x86 assembly (clang, -O0):
<bitmap_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%eax
jg     1141 <bitmap_zero+0x31>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
jmp    1171 <bitmap_zero+0x61>
mov    -0xc(%rbp),%eax
mov    0x2e9d(%rip),%rcx
add    (%rcx),%eax
sub    $0x1,%eax
mov    0x2e91(%rip),%rcx
cltd
idivl  (%rcx)
cltq
shl    $0x3,%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_zero>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
cmp    %esi,%ecx
jge    1134 <bitmap_zero+0x24>
lea    (%rsi,%rcx,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %ecx
lea    0x0(,%rax,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @bitmap_zero(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* @__WORDSIZE
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64*, i64** %3
store i64 0, i64* %10
br label %24
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* @__WORDSIZE
%14 = add nsw i32 %12, %13
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* @__WORDSIZE
%17 = sdiv i32 %15, %16
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
store i32 %20, i32* %5
%21 = load i64*, i64** %3
%22 = load i32, i32* %5
%23 = call i32 @memset(i64* %21, i32 0, i32 %22)
br label %24
24: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @bitmap_zero(i64* %0, i32 %1) {
%3 = load i32, i32* @__WORDSIZE
%4 = icmp slt i32 %3, %1
br i1 %4, label %6, label %5
5: ; preds = %2
store i64 0, i64* %0
br label %12
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = add i32 %7, %3
%9 = sdiv i32 %8, %3
%10 = shl i32 %9, 3
%11 = tail call i32 @memset(i64* %0, i32 0, i32 %10)
br label %12
12: ; preds = %6, %5
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t f(uint32_t n) {
  if (n == 1 || n == 2)
    return 2;
  else if (n == 3)
    return 4;
  else
    return (2 * f(n - 1) - f(n - 3));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <f+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <f+0x2b>
movl   $0x2,-0x4(%rbp)
jmp    1177 <f+0x67>
cmpl   $0x3,-0x8(%rbp)
jne    1151 <f+0x41>
movl   $0x4,-0x4(%rbp)
jmp    1177 <f+0x67>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x3,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    -0x1(%r14),%edi
mov    $0x2,%ebx
cmp    $0x2,%edi
jb     1147 <f+0x37>
mov    $0x4,%ebx
cmp    $0x3,%r14d
je     1147 <f+0x37>
call   1030 <f@plt>
mov    %eax,%ebx
add    %eax,%ebx
add    $0xfffffffd,%r14d
mov    %r14d,%edi
call   1030 <f@plt>
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 2, i32* %2
br label %23
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 3
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 4, i32* %2
br label %23
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = call i32 @f(i32 %16)
%18 = mul nsw i32 2, %17
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 3
%21 = call i32 @f(i32 %20)
%22 = sub nsw i32 %18, %21
store i32 %22, i32* %2
br label %23
23: ; preds = %14, %13, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 3
br i1 %5, label %6, label %8
6: ; preds = %1, %4, %8
%7 = phi i32 [ %13, %8 ], [ 2, %1 ], [ 4, %4 ]
ret i32 %7
8: ; preds = %4
%9 = tail call i32 @f(i32 %2)
%10 = shl nsw i32 %9, 1
%11 = add nsw i32 %0, -3
%12 = tail call i32 @f(i32 %11)
%13 = sub nsw i32 %10, %12
br label %6
}
/* Type definitions */
struct sysinfo {
  scalar_t__ freeswap;
  scalar_t__ totalswap;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
bool swap_active(void) {
  struct sysinfo info;
  sysinfo(&info);
  if (info.freeswap == info.totalswap)
    return false;
  else
    return true;
}


x86 assembly (clang, -O0):
<swap_active>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    113b <swap_active+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <swap_active+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_active>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <sysinfo@plt>
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmp    0x10(%rsp),%rcx
setne  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64, i64 }
define i32 @swap_active() {
%1 = alloca i32
%2 = alloca %struct.sysinfo
%3 = call i32 @sysinfo(%struct.sysinfo* %2)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.sysinfo = type { i64, i64 }
define i32 @swap_active() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp ne i64 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char *argv[]) {
  foo();
  return argc - 1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <foo@plt>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = add nsw i32 %0, -1
ret i32 %4
}
void int_enable(void) { return; }


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

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

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

LLVM IR (-O2):
define void @int_enable() {
ret void
}
/* Variables and functions */
int daylight;
int main() {
  int i = daylight;
  (void)i;
  return 0;
}


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

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

LLVM IR (-O0):
@daylight = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @daylight
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
@daylight = global i32 0
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close_loadingfiles();
int /*<<< orphan*/ findandjump(int, char *);
int /*<<< orphan*/ stdputstr(char *);
void xltoplevel(void) {
  close_loadingfiles();
  stdputstr("[ back to top level ]\n");
  findandjump(0x0040, "no top level");
}


x86 assembly (clang, -O0):
<xltoplevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <close_loadingfiles@plt>
lea    0xebe(%rip),%rdi
call   1030 <stdputstr@plt>
mov    $0x40,%edi
lea    0xec4(%rip),%rsi
call   1050 <findandjump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xltoplevel>:
push   %rax
xor    %eax,%eax
call   1040 <close_loadingfiles@plt>
lea    0xec1(%rip),%rdi
call   1030 <stdputstr@plt>
lea    0xecc(%rip),%rsi
mov    $0x40,%edi
pop    %rax
jmp    1050 <findandjump@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"[ back to top level ]\0A\00"
@.str.1 = [13 x i8] c"no top level\00"
define void @xltoplevel() {
%1 = call i32 (...) @close_loadingfiles()
%2 = call i32 @stdputstr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @findandjump(i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"[ back to top level ]\0A\00"
@.str.1 = [13 x i8] c"no top level\00"
define void @xltoplevel() {
%1 = tail call i32 (...) @close_loadingfiles()
%2 = tail call i32 @stdputstr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @findandjump(i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int __native_ctzll(unsigned long long);
unsigned char __builtin_BitScanForward64(unsigned long *index,
                                         unsigned long long mask) {
  unsigned int trailing_zeros;
  trailing_zeros = __native_ctzll((unsigned long long)mask);
  *index = trailing_zeros;
  return (unsigned char)(mask != 0);
}


x86 assembly (clang, -O0):
<__builtin_BitScanForward64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__native_ctzll@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__builtin_BitScanForward64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <__native_ctzll@plt>
mov    %eax,%eax
mov    %rax,(%r14)
test   %rbx,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define zeroext i8 @__builtin_BitScanForward64(i64* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @__native_ctzll(i64 %1)
%4 = zext i32 %3 to i64
store i64 %4, i64* %0
%5 = icmp ne i64 %1, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
void hoo_console_print(void *text) {}


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

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

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

LLVM IR (-O2):
define void @hoo_console_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ domathl();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  domathl();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <domathl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <domathl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @domathl()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @domathl()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
void set_XMapEvent_type(void *_p, int _v) { ((XMapEvent *)_p)->type = (int)_v; }


x86 assembly (clang, -O0):
<set_XMapEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @set_XMapEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t modSub(uint32_t a, uint32_t b, uint32_t m) {
  return (uint32_t)(((uint64_t)m + a - b) % m);
}


x86 assembly (clang, -O0):
<modSub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modSub>:
mov    %edx,%ecx
sub    %esi,%edi
lea    (%rdi,%rcx,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modSub(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* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = srem i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @modSub(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = add i32 %4, %2
%6 = srem i32 %5, %2
ret i32 %6
}
double getSign(double x) { return (double)((0 < x) - (x < 0)); }


x86 assembly (clang, -O0):
<getSign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @getSign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double 0.000000e+00, %3
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @getSign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}