xunge/DecIR huggingface dataset:
void check_root() {
  check_zero(geteuid(), "geteuid()",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/veltzer/demos-linux/refs/heads/master/"
             "src/include/security_utils.h",
             __FUNCTION__, 36,
             "you are not root, maybe you should try sudo(1)?");
}


x86 assembly (clang, -O0):
<check_root>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf65(%rip),%rcx
mov    $0x24,%r8d
lea    0xf63(%rip),%r9
mov    $0x0,%al
call   1040 <check_zero@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_root>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
lea    0xed1(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xf6a(%rip),%rcx
lea    0xf6e(%rip),%r9
mov    %eax,%edi
mov    $0x24,%r8d
xor    %eax,%eax
pop    %r11
jmp    1040 <check_zero@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"geteuid()\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/veltzer/demos-linux/refs/heads/master/src/include/security_utils.h\00"
@__FUNCTION__.check_root = [11 x i8] c"check_root\00"
@.str.2 = [48 x i8] c"you are not root, maybe you should try sudo(1)?\00"
define void @check_root() {
%1 = call i32 (...) @geteuid()
%2 = call i32 (i32, i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @check_zero to i32 (i32, i8*, i8*, i8*, i32, i8*, ...)*)(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.check_root, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"geteuid()\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/veltzer/demos-linux/refs/heads/master/src/include/security_utils.h\00"
@__FUNCTION__.check_root = [11 x i8] c"check_root\00"
@.str.2 = [48 x i8] c"you are not root, maybe you should try sudo(1)?\00"
define void @check_root() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (i32, i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @check_zero to i32 (i32, i8*, i8*, i8*, i32, i8*, ...)*)(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.check_root, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int fun281() { return 281; }


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

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

LLVM IR (-O0):
define i32 @fun281() {
ret i32 281
}

LLVM IR (-O2):
define i32 @fun281() {
ret i32 281
}
/* Variables and functions */
int /*<<< orphan*/ dailyWeather2(int, double *, double *, int, int, int);
void dailyWeather2_R(int *nSites, double latitudes[], double longitudes[],
                     int *year, int *month, int *type) {
  dailyWeather2(*nSites, latitudes, longitudes, *year, *month, *type);
}


x86 assembly (clang, -O0):
<dailyWeather2_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
call   1030 <dailyWeather2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dailyWeather2_R>:
mov    (%rdi),%edi
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
jmp    1030 <dailyWeather2@plt>

LLVM IR (-O0):
define void @dailyWeather2_R(i32* %0, double* %1, double* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store double* %1, double** %8
store double* %2, double** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load double*, double** %8
%16 = load double*, double** %9
%17 = load i32*, i32** %10
%18 = load i32, i32* %17
%19 = load i32*, i32** %11
%20 = load i32, i32* %19
%21 = load i32*, i32** %12
%22 = load i32, i32* %21
%23 = call i32 @dailyWeather2(i32 %14, double* %15, double* %16, i32 %18, i32 %20, i32 %22)
ret void
}

LLVM IR (-O2):
define void @dailyWeather2_R(i32* nocapture %0, double* %1, double* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = tail call i32 @dailyWeather2(i32 %7, double* %1, double* %2, i32 %8, i32 %9, i32 %10)
ret void
}
void test_no_clause() {
  int i;
#pragma omp parallel master taskloop
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel master taskloop
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
int indx(int n, int m) { return (m + n * (n + 1) / 2); }


x86 assembly (clang, -O0):
<indx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indx>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @indx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @indx(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = mul nsw i32 %3, %0
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %5, %1
ret i32 %6
}
int pwc_write(unsigned short offset, unsigned int data, unsigned int mask) {
  return 0;
}


x86 assembly (clang, -O0):
<pwc_write>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pwc_write(i16 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i32
store i16 %0, i16* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @pwc_write(i16 zeroext %0, i32 %1, i32 %2) {
ret i32 0
}
unsigned int ScaleColor8to6(const unsigned char color) {
  return ((unsigned int)(((color) & ~0x03) >> 2));
}


x86 assembly (clang, -O0):
<ScaleColor8to6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfffffffc,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleColor8to6>:
shr    $0x2,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @ScaleColor8to6(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -4
%6 = ashr i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ScaleColor8to6(i8 zeroext %0) {
%2 = lshr i8 %0, 2
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void null_scroll_message(const char *message) {
  printf("scroll: %s\n", message);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"scroll: %s\0A\00"
define void @null_scroll_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"scroll: %s\0A\00"
define void @null_scroll_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_3Auint8_reg(unsigned char val) {
  return ((val) & (-0x3A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_3Auint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -58
%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_3Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -58
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ETIME;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void do_timeout(int n) { exit(ETIME); }


x86 assembly (clang, -O0):
<do_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<do_timeout>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@ETIME = global i32 0
define void @do_timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ETIME
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@ETIME = global i32 0
define void @do_timeout(i32 %0) {
%2 = load i32, i32* @ETIME
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ addbc();
int /*<<< orphan*/ doublereg();
int /*<<< orphan*/ ldbc();
void fivereg(void) {
  ldbc();
  doublereg();
  doublereg();
  addbc();
}


x86 assembly (clang, -O0):
<fivereg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ldbc@plt>
mov    $0x0,%al
call   1050 <doublereg@plt>
mov    $0x0,%al
call   1050 <doublereg@plt>
mov    $0x0,%al
call   1040 <addbc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fivereg>:
push   %rax
xor    %eax,%eax
call   1030 <ldbc@plt>
xor    %eax,%eax
call   1050 <doublereg@plt>
xor    %eax,%eax
call   1050 <doublereg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <addbc@plt>

LLVM IR (-O0):
define void @fivereg() {
%1 = call i32 (...) @ldbc()
%2 = call i32 (...) @doublereg()
%3 = call i32 (...) @doublereg()
%4 = call i32 (...) @addbc()
ret void
}

LLVM IR (-O2):
define void @fivereg() {
%1 = tail call i32 (...) @ldbc()
%2 = tail call i32 (...) @doublereg()
%3 = tail call i32 (...) @doublereg()
%4 = tail call i32 (...) @addbc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *dlsym(void *, char const *);
int /*<<< orphan*/ printf(char *, char const *, void *);
void *resolve(void *lib, const char *name) {
  void *sym;
  sym = dlsym(lib, name);
  printf("[D] Symbol %s is at %p\n", name, sym);
  assert(sym);
  return sym;
}


x86 assembly (clang, -O0):
<resolve>:
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   1050 <dlsym@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <dlsym@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"[D] Symbol %s is at %p\0A\00"
define i8* @resolve(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @dlsym(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = call i32 @assert(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [24 x i8] c"[D] Symbol %s is at %p\0A\00"
define i8* @resolve(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = tail call i32 @assert(i8* %3)
ret i8* %3
}
int dientes(float grados) {
  float grad = 360 / 300;
  int x2 = (grados / (360 / 300)) * 100;
  int dnt2 = x2 / 100;
  return dnt2;
}


x86 assembly (clang, -O0):
<dientes>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee1(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dientes>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dientes(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
store float 1.000000e+00, float* %3
%6 = load float, float* %2
%7 = fdiv float %6, 1.000000e+00
%8 = fmul float %7, 1.000000e+02
%9 = fptosi float %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 100
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @dientes(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = fptosi float %2 to i32
%4 = sdiv i32 %3, 100
ret i32 %4
}
/* Type definitions */
struct dthr_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ dthr_eventq_to_runq(struct dthr_event *, int /*<<< orphan*/);
int /*<<< orphan*/ dthr_thread_yield();
void dthr_event_broadcast(struct dthr_event *event) {
  ;
  ;
  dthr_eventq_to_runq(event, UINT_MAX);
  dthr_thread_yield();
  ;
  ;
}


x86 assembly (clang, -O0):
<dthr_event_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <dthr_eventq_to_runq@plt>
mov    $0x0,%al
call   1030 <dthr_thread_yield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dthr_event_broadcast>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <dthr_eventq_to_runq@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <dthr_thread_yield@plt>

LLVM IR (-O0):
%struct.dthr_event = type { i32 }
@UINT_MAX = global i32 0
define void @dthr_event_broadcast(%struct.dthr_event* %0) {
%2 = alloca %struct.dthr_event*
store %struct.dthr_event* %0, %struct.dthr_event** %2
%3 = load %struct.dthr_event*, %struct.dthr_event** %2
%4 = load i32, i32* @UINT_MAX
%5 = call i32 @dthr_eventq_to_runq(%struct.dthr_event* %3, i32 %4)
%6 = call i32 (...) @dthr_thread_yield()
ret void
}

LLVM IR (-O2):
%struct.dthr_event = type { i32 }
@UINT_MAX = global i32 0
define void @dthr_event_broadcast(%struct.dthr_event* %0) {
%2 = load i32, i32* @UINT_MAX
%3 = tail call i32 @dthr_eventq_to_runq(%struct.dthr_event* %0, i32 %2)
%4 = tail call i32 (...) @dthr_thread_yield()
ret void
}
__attribute__((visibility("default"))) void inscount(void) {}


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

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

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

LLVM IR (-O2):
define void @inscount() {
ret void
}
void foo594(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo594(i32 %0) {
ret void
}
int compare_int(void *num1, void *num2) {
  int key1, key2;
  key1 = *(int *)num1;
  key2 = *(int *)num2;
  if (key1 < key2)
    return -1;
  if (key1 == key2)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare_int+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare_int+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compare_int+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare_int+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void OTAloopHandler() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @led_disable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int file_exists(char *filename) {
  if (access(filename, F_OK) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <file_exists+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <file_exists+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i64 @access(i8* %4, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void debug(const char *ss) { printf("DEBUG: %s\n", ss); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"DEBUG: %s\0A\00"
define void @debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void blank_line(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<blank_line>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @blank_line() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void ClearLock(char *sLockname) { unlink(sLockname); }


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

x86 assembly (clang, -O2):
<ClearLock>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @ClearLock(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) {
  return 200;
}


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

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

LLVM IR (-O0):
define weak i32 @get_tapping_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 200
}

LLVM IR (-O2):
define weak i32 @get_tapping_term(i32 %0) {
ret i32 200
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long, long);
char *util_print_time(long int t) {
  static char s[40];
  (void)sprintf(s, "%ld.%02ld sec", t / 1000, (t % 1000) / 10);
  return s;
}


x86 assembly (clang, -O0):
<util_print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0x2ee9(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_print_time>:
push   %rbx
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%edi
movswl %di,%eax
imul   $0x6667,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x12,%eax
add    %ecx,%eax
movslq %eax,%rcx
lea    0x2eec(%rip),%rbx
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02ld sec\00"
define i8* @util_print_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 1000
%5 = load i64, i64* %2
%6 = srem i64 %5, 1000
%7 = sdiv i64 %6, 10
%8 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %7)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}

LLVM IR (-O2):
@util_print_time.s = internal global [40 x i8] zeroinitializer
@.str = [14 x i8] c"%ld.%02ld sec\00"
define i8* @util_print_time(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = srem i64 %0, 1000
%4 = trunc i64 %3 to i16
%5 = sdiv i16 %4, 10
%6 = sext i16 %5 to i64
%7 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %6)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @util_print_time.s, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ utfstr;

/* Variables and functions */
char *strstr(char const *, char *);
int /*<<< orphan*/ utf8_encode(char *, int, unsigned long);
char *dstrchr(const char *str, unsigned long code) {
  char utfstr[8] = {0};
  utf8_encode(utfstr, sizeof(utfstr), code);
  return strstr(str, utfstr);
}


x86 assembly (clang, -O0):
<dstrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <strstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dstrchr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <utf8_encode@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dstrchr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = bitcast [8 x i8]* %5 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = call i32 @utf8_encode(i8* %7, i32 8, i64 %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%12 = call i8* @strstr(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @dstrchr(i8* %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @utf8_encode(i8* %4, i32 8, i64 %1)
%6 = call i8* @strstr(i8* dereferenceable(1) %0, i8* %4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SafeFree(void *pOld) {
  if (pOld) {
    free(pOld);
  }
}


x86 assembly (clang, -O0):
<SafeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <SafeFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeFree>:
test   %rdi,%rdi
je     111a <SafeFree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @SafeFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
float __llvm_amdgcn_rcp_f32(float);
float __frcp_rd(float x) { return __llvm_amdgcn_rcp_f32(x); }


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

x86 assembly (clang, -O2):
<__frcp_rd>:
jmp    1030 <__llvm_amdgcn_rcp_f32@plt>

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

LLVM IR (-O2):
define float @__frcp_rd(float %0) {
%2 = tail call float @__llvm_amdgcn_rcp_f32(float %0)
ret float %2
}
int _max(int a, int b) { return ((a) > (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void USART3_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @USART3_IRQHandler() {
ret void
}
/* Variables and functions */
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *xmalloc(scalar_t__);
char *ints_to_str(int a, int b) {
  char *s = xmalloc(snprintf(NULL, 0, "%d%d", a, b) + 1);
  sprintf(s, "%d%d", a, b);
  return s;
}


x86 assembly (clang, -O0):
<ints_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe88(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ints_to_str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%ebp
lea    0xebd(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %r15d,%r8d
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
define i8* @ints_to_str(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i8* @ints_to_str(i32 %0, i32 %1) {
%3 = tail call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ OPM_err(int);
void OPP_err(int n) { OPM_err(n); }


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

x86 assembly (clang, -O2):
<OPP_err>:
jmp    1030 <OPM_err@plt>

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

LLVM IR (-O2):
define void @OPP_err(i32 %0) {
%2 = tail call i32 @OPM_err(i32 %0)
ret void
}
void openout(oname) char *oname;
{}


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

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

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

LLVM IR (-O2):
define void @openout(i8* nocapture %0) {
ret void
}
void bar(a) int a;
{}


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

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

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

LLVM IR (-O2):
define void @bar(i32 %0) {
ret void
}
void INT_Excep_PERIB_INTB207(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB207() {
ret void
}
/* Variables and functions */
void *calloc(size_t, int);
void *mempool_zalloc(size_t size) { return calloc(size, 1); }


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

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

LLVM IR (-O0):
define i8* @mempool_zalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @calloc(i64 %3, i32 1)
ret i8* %4
}

LLVM IR (-O2):
define i8* @mempool_zalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
double gen_rand32();
double genrand_real(double min, double max) {
  return gen_rand32() * ((max - min) / 4294967295.0) + min;
}


x86 assembly (clang, -O0):
<genrand_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gen_rand32@plt>
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <gen_rand32@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
divsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @genrand_real(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @gen_rand32()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = fdiv double %8, 0x41EFFFFFFFE00000
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %5, double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @genrand_real(double %0, double %1) {
%3 = tail call double (...) @gen_rand32()
%4 = fsub double %1, %0
%5 = fdiv double %4, 0x41EFFFFFFFE00000
%6 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %0)
ret double %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(int);
bool SSIBusy(uint32_t ui32Base) {
  ASSERT(_SSIBaseValid(ui32Base));
  return (((*((volatile uint32_t *)(ui32Base + 0x0000000C))) & 0x00000010)
              ? true
              : false);
}


x86 assembly (clang, -O0):
<SSIBusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%edx
and    $0x10,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIBusy>:
push   %rbx
mov    %edi,%ebx
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
mov    0xc(%rax),%eax
shr    $0x4,%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SSIBusy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_SSIBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 12
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 16
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
define i32 @SSIBusy(i32 %0) {
%2 = tail call i32 @_SSIBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = lshr i32 %7, 4
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
_Bool isgraph(unsigned char);
_Bool dns_isgraph(unsigned char c) { return isgraph(c); }


x86 assembly (clang, -O0):
<dns_isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isgraph@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_isgraph>:
jmp    1030 <isgraph@plt>

LLVM IR (-O0):
define zeroext i1 @dns_isgraph(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i1 @isgraph(i8 zeroext %3)
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @dns_isgraph(i8 zeroext %0) {
%2 = tail call zeroext i1 @isgraph(i8 zeroext %0)
ret i1 %2
}
int ignore_telopt(struct session *ses, int cplen, unsigned char *cpsrc) {
  return cplen;
}


x86 assembly (clang, -O0):
<ignore_telopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_telopt>:
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.session = type opaque
define i32 @ignore_telopt(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
ret i32 %7
}

LLVM IR (-O2):
%struct.session = type opaque
define i32 @ignore_telopt(%struct.session* nocapture readnone %0, i32 returned %1, i8* nocapture readnone %2) {
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M102_f(char *s) {
  debug("M102_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M102_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M102_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M102_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M102_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M102_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M102_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
float __ocml_sqrt_rte_f32(float);
float __fsqrt_rn(float x) { return __ocml_sqrt_rte_f32(x); }


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

x86 assembly (clang, -O2):
<__fsqrt_rn>:
jmp    1030 <__ocml_sqrt_rte_f32@plt>

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

LLVM IR (-O2):
define float @__fsqrt_rn(float %0) {
%2 = tail call float @__ocml_sqrt_rte_f32(float %0)
ret float %2
}
int attb_read_val(void) {}


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

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

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

LLVM IR (-O2):
define i32 @attb_read_val() {
ret i32 undef
}
void testDummy(void) {}


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

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

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

LLVM IR (-O2):
define void @testDummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ strv_clear(char **);
char **strv_free(char **l) {
  strv_clear(l);
  free(l);
  return NULL;
}


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

x86 assembly (clang, -O2):
<strv_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strv_clear@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8** @strv_free(i8** %0) {
%2 = tail call i32 @strv_clear(i8** %0)
%3 = tail call i32 @free(i8** %0)
ret i8** null
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int read(int, float *, size_t);
int read_wavfile_float_mono(int fd, float *outbuf, size_t outsize) {
  ssize_t bytes_read = read(fd, outbuf, outsize * sizeof(float));
  return bytes_read;
}


x86 assembly (clang, -O0):
<read_wavfile_float_mono>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_wavfile_float_mono>:
shl    $0x2,%rdx
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @read_wavfile_float_mono(i32 %0, float* %1, i64 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load float*, float** %5
%10 = load i64, i64* %6
%11 = mul i64 %10, 4
%12 = call i32 @read(i32 %8, float* %9, i64 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @read_wavfile_float_mono(i32 %0, float* nocapture %1, i64 %2) {
%4 = shl i64 %2, 2
%5 = tail call i32 @read(i32 %0, float* %1, i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MON_4;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_4() { return nl_langinfo(MON_4); }


x86 assembly (clang, -O0):
<langinfo_mon_4>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_4>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_4 = global i32 0
define i8* @langinfo_mon_4() {
%1 = load i32, i32* @MON_4
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_4 = global i32 0
define i8* @langinfo_mon_4() {
%1 = load i32, i32* @MON_4
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
void CompilerWriteFence() { asm volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @CompilerWriteFence() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}