xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ GET_FLOAT_WORD(scalar_t__, float);
int __signbitf(float x) {
  int32_t hx;
  GET_FLOAT_WORD(hx, x);
  return hx < 0;
}


x86 assembly (clang, -O0):
<__signbitf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
call   1030 <GET_FLOAT_WORD@plt>
cmpq   $0x0,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__signbitf>:
push   %rax
call   1030 <GET_FLOAT_WORD@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__signbitf(float %0) {
%2 = alloca float
%3 = alloca i64
store float %0, float* %2
%4 = load i64, i64* %3
%5 = load float, float* %2
%6 = call i32 @GET_FLOAT_WORD(i64 %4, float %5)
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__signbitf(float %0) {
%2 = tail call i32 @GET_FLOAT_WORD(i64 undef, float %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi16(int /*<<< orphan*/, int);
__m128i test_mm_srai_epi16_1(__m128i A) { return _mm_srai_epi16(A, -1); }


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

x86 assembly (clang, -O2):
<test_mm_srai_epi16_1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_srai_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_srai_epi16_1(i32 %0) {
%2 = tail call i32 @_mm_srai_epi16(i32 %0, i32 -1)
ret i32 %2
}
int ungetChar(char **s) { return *(--(*s)); }


x86 assembly (clang, -O0):
<ungetChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,(%rcx)
movsbl -0x1(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetChar>:
mov    (%rdi),%rax
lea    -0x1(%rax),%rcx
mov    %rcx,(%rdi)
movsbl -0x1(%rax),%eax
ret

LLVM IR (-O0):
define i32 @ungetChar(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i32 -1
store i8* %5, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ungetChar(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 -1
store i8* %3, i8** %0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void sighandler(int sig) {
  printf("SIGINT (%d) cuaght, will exit the program..... bye\n", sig);
  exit(0);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"SIGINT (%d) cuaght, will exit the program..... bye\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"SIGINT (%d) cuaght, will exit the program..... bye\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int netstring_write_string(char *, char **, int *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int netstring_write_int(int i, char **dst, int *dst_len) {
  char buf[64];
  sprintf(buf, "%i", i);
  return netstring_write_string(buf, dst, dst_len);
}


x86 assembly (clang, -O0):
<netstring_write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <netstring_write_string@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netstring_write_int>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xec8(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <netstring_write_string@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @netstring_write_int(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [64 x i8]
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%12 = load i8**, i8*** %5
%13 = load i32*, i32** %6
%14 = call i32 @netstring_write_string(i8* %11, i8** %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @netstring_write_int(i32 %0, i8** %1, i32* %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @netstring_write_string(i8* %5, i8** %1, i32* %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void *map(int id) {
  void *addr = shmat(id, NULL, 0);
  if (addr == (void *)-1) {
    perror("No se pudo mapear la memoria");
    exit(-1);
  }
  return addr;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x10(%rbp)
jne    1174 <map+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
je     1142 <map+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"No se pudo mapear la memoria\00"
define i8* @map(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @shmat(i32 %4, i32* null, i32 0)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, inttoptr (i64 -1 to i8*)
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"No se pudo mapear la memoria\00"
define i8* @map(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i32* null, i32 0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
void manipulate(char *s) { *s = 'b'; }


x86 assembly (clang, -O0):
<manipulate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x62,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<manipulate>:
movb   $0x62,(%rdi)
ret

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

LLVM IR (-O2):
define void @manipulate(i8* nocapture writeonly %0) {
store i8 98, i8* %0
ret void
}
void d_storeuw(unsigned char **ptr, unsigned short data) {
  *(*ptr)++ = (data & 0xff00) >> 8;
  *(*ptr)++ = (data & 0x00ff) >> 0;
}


x86 assembly (clang, -O0):
<d_storeuw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_storeuw>:
mov    %esi,%eax
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %ah,(%rcx)
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @d_storeuw(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
store i8** %0, i8*** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = ashr i32 %15, 0
%17 = trunc i32 %16 to i8
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @d_storeuw(i8** nocapture %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %0
store i8 %4, i8* %5
%7 = trunc i16 %1 to i8
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void m() { puts("Account created."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Account created.\00"
define void @m() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Account created.\00"
define void @m() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x0e() {
  Assert_real((isalnum(14) == 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_isalnum.c",
              75, ("isalnum should be 0 for 0x0e"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x0e>:
push   %rax
mov    $0xe,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x0e\00"
define void @t_isalnum_0x0e() {
%1 = call i64 @isalnum(i32 14)
%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 75, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x0e\00"
define void @t_isalnum_0x0e() {
%1 = tail call i64 @isalnum(i32 14)
%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 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gs_end_scene();
void render_display_end() { gs_end_scene(); }


x86 assembly (clang, -O0):
<render_display_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gs_end_scene@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_display_end>:
xor    %eax,%eax
jmp    1030 <gs_end_scene@plt>

LLVM IR (-O0):
define void @render_display_end() {
%1 = call i32 (...) @gs_end_scene()
ret void
}

LLVM IR (-O2):
define void @render_display_end() {
%1 = tail call i32 (...) @gs_end_scene()
ret void
}
/* Variables and functions */
long double floorl(long double);
long double test2l(long double x) { return floorl(x); }


x86 assembly (clang, -O0):
<test2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <floorl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <floorl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.floor.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test2l(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.floor.f80(x86_fp80 %0)
ret x86_fp80 %2
}
int gc314WaitForData(int filedes, int channel) {
  int retval;
  int status = 0;
  int chan = 0;
  chan = channel;
  return chan;
}


x86 assembly (clang, -O0):
<gc314WaitForData>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gc314WaitForData(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int sumArray(int values[], size_t count) {}


x86 assembly (clang, -O0):
<sumArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sumArray(i32* nocapture readnone %0, i64 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ReleaseAudio300(unsigned long);
void releaseaudio(unsigned long id) { ReleaseAudio300(id); }


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

x86 assembly (clang, -O2):
<releaseaudio>:
jmp    1030 <ReleaseAudio300@plt>

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

LLVM IR (-O2):
define void @releaseaudio(i64 %0) {
%2 = tail call i32 @ReleaseAudio300(i64 %0)
ret void
}
int fun1045() { return 1045; }


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

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

LLVM IR (-O0):
define i32 @fun1045() {
ret i32 1045
}

LLVM IR (-O2):
define i32 @fun1045() {
ret i32 1045
}
/* Variables and functions */
int maxArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int h[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  printf("%d\n", maxArea(h, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <maxArea@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <maxArea@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.h = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @maxArea(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.h = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxArea(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
scalar_t__ pool_alloc(struct pool *, size_t);
char *pool_dupstr(struct pool *p, const char *start, const char *end) {
  size_t sz = end - start;
  char *str = (char *)pool_alloc(p, sz + 1);
  memcpy(str, start, sz);
  str[sz] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<pool_dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
call   1030 <pool_alloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_dupstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
sub    %rsi,%rbx
lea    0x1(%rbx),%rsi
call   1030 <pool_alloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.pool = type { i32 }
define i8* @pool_dupstr(%struct.pool* %0, i8* %1, i8* %2) {
%4 = alloca %struct.pool*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store %struct.pool* %0, %struct.pool** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
store i64 %13, i64* %7
%14 = load %struct.pool*, %struct.pool** %4
%15 = load i64, i64* %7
%16 = add i64 %15, 1
%17 = call i64 @pool_alloc(%struct.pool* %14, i64 %16)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %8
%19 = load i8*, i8** %8
%20 = load i8*, i8** %5
%21 = load i64, i64* %7
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i8*, i8** %8
%24 = load i64, i64* %7
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8 0, i8* %25
%26 = load i8*, i8** %8
ret i8* %26
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i8* @pool_dupstr(%struct.pool* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sub i64 %4, %5
%7 = add i64 %6, 1
%8 = tail call i64 @pool_alloc(%struct.pool* %0, i64 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %1, i64 %6)
%11 = getelementptr inbounds i8, i8* %9, i64 %6
store i8 0, i8* %11
ret i8* %9
}
/* Variables and functions */
int vdb_printf(char *, float, float, float, float, float, float, float, float,
               float);
__attribute__((weak)) int vdb_triangle(float x0, float y0, float z0, float x1,
                                       float y1, float z1, float x2, float y2,
                                       float z2) {
  return vdb_printf("t %f %f %f %f %f %f %f %f %f\n", x0, y0, z0, x1, y1, z1,
                    x2, y2, z2);
}


x86 assembly (clang, -O0):
<vdb_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
movss  -0x1c(%rbp),%xmm6
movss  -0x20(%rbp),%xmm7
movss  0x10(%rbp),%xmm8
lea    0xe85(%rip),%rdi
movss  %xmm8,(%rsp)
call   1030 <vdb_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"t %f %f %f %f %f %f %f %f %f\0A\00"
define weak i32 @vdb_triangle(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %10
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %13
%23 = load float, float* %14
%24 = load float, float* %15
%25 = load float, float* %16
%26 = load float, float* %17
%27 = load float, float* %18
%28 = call i32 @vdb_printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %19, float %20, float %21, float %22, float %23, float %24, float %25, float %26, float %27)
ret i32 %28
}

LLVM IR (-O2):
@.str = [30 x i8] c"t %f %f %f %f %f %f %f %f %f\0A\00"
define weak i32 @vdb_triangle(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = tail call i32 @vdb_printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8)
ret i32 %10
}
int test_imm_4Cuint16_reg(unsigned short val) {
  return ((val) & (-0x4C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Cuint16_reg>:
test   $0xffb4,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -76
%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_4Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -76
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ iso2pc_size(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void iso2pc(char *buffer) { iso2pc_size(buffer, strlen(buffer)); }


x86 assembly (clang, -O0):
<iso2pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <iso2pc_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso2pc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <iso2pc_size@plt>

LLVM IR (-O0):
define void @iso2pc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @iso2pc_size(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @iso2pc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @iso2pc_size(i8* %0, i32 %2)
ret void
}
void ff_hevc_put_hevc_uni_qpel_hv4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv4_10_sse4() {
ret void
}
void stringTrim(char *str) {
  char *pTmp = str;
  while (*str != '\0') {
    if (*str != ' ') {
      *pTmp = *str;
      pTmp++;
    }
    str++;
  }
  *pTmp = '\0';
}


x86 assembly (clang, -O0):
<stringTrim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <stringTrim+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1148 <stringTrim+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <stringTrim+0x10>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringTrim>:
mov    %rdi,%rax
jmp    1114 <stringTrim+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x20,%cl
je     1110 <stringTrim+0x10>
test   %cl,%cl
je     1128 <stringTrim+0x28>
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1110 <stringTrim+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define void @stringTrim(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %8
]
6: ; preds = %2
store i8 %5, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void badconv(const char *ch) {
  (void)fprintf(stderr, ("hexdump: bad conversion character %%%s.\n"), ch);
  exit(1);
}


x86 assembly (clang, -O0):
<badconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badconv>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"hexdump: bad conversion character %%%s.\0A\00"
define void @badconv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"hexdump: bad conversion character %%%s.\0A\00"
define void @badconv(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int S_IRWXG;
int S_IRWXO;
int S_IRWXU;
int open(char *, int, int);
int processOutfile(char *str) {
  return open(str, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
}


x86 assembly (clang, -O0):
<processOutfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    0x2e8e(%rip),%rax
or     (%rax),%edx
mov    0x2e9d(%rip),%rax
or     (%rax),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processOutfile>:
mov    0x2ea1(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ead(%rip),%rax
or     (%rax),%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @processOutfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRWXU
%8 = load i32, i32* @S_IRWXG
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRWXO
%11 = or i32 %9, %10
%12 = call i32 @open(i8* %3, i32 %6, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IRWXO = global i32 0
define i32 @processOutfile(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRWXU
%6 = load i32, i32* @S_IRWXG
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRWXO
%9 = or i32 %7, %8
%10 = tail call i32 @open(i8* %0, i32 %4, i32 %9)
ret i32 %10
}
void RTLockValidatorClassCreateUnique(void) {}


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

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

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

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

/* Variables and functions */
int myfgetc(int /*<<< orphan*/ *);
int getc(FILE *stream) { return myfgetc(stream); }


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

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <myfgetc@plt>

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

LLVM IR (-O2):
define i32 @getc(i32* %0) {
%2 = tail call i32 @myfgetc(i32* %0)
ret i32 %2
}
/* Type definitions */
struct evbuffer {
  int dummy;
};
typedef int /*<<< orphan*/ ev_ssize_t;

/* Variables and functions */
unsigned char *evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size) {
  (void)buf;
  (void)size;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i8* @evbuffer_pullup(%struct.evbuffer* %0, i32 %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i32
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i32 %1, i32* %4
%5 = load %struct.evbuffer*, %struct.evbuffer** %3
%6 = load i32, i32* %4
ret i8* null
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define noalias i8* @evbuffer_pullup(%struct.evbuffer* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
size_t eembed_diy_strnlen(const char *str, size_t buf_size) {
  size_t i;
  for (i = 0; i < buf_size; ++i) {
    if (str[i] == '\0') {
      return i;
    }
  }
  return buf_size;
}


x86 assembly (clang, -O0):
<eembed_diy_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115a <eembed_diy_strnlen+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1144 <eembed_diy_strnlen+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <eembed_diy_strnlen+0x62>
jmp    1149 <eembed_diy_strnlen+0x49>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <eembed_diy_strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_diy_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <eembed_diy_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <eembed_diy_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <eembed_diy_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @eembed_diy_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void BME_BFI_B(volatile uint8_t *addr,
                                        register uint8_t wdata, uint8_t bit,
                                        uint8_t width) {
  *(volatile uint8_t *)((uint32_t)addr | (1 << 28) | (bit << 23) |
                        ((width - 1) << 19)) = wdata;
}


x86 assembly (clang, -O0):
<BME_BFI_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0x10000000,%eax
mov    -0x10(%rbp),%edx
shl    $0x17,%edx
or     %edx,%eax
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
shl    $0x13,%edx
or     %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_BFI_B>:
shl    $0x17,%edx
shl    $0x13,%ecx
add    $0xfff80000,%ecx
or     %edi,%edx
or     %ecx,%edx
movslq %edx,%rax
or     $0x10000000,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @BME_BFI_B(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32*, i32** %5
%11 = ptrtoint i32* %10 to i32
%12 = or i32 %11, 268435456
%13 = load i32, i32* %7
%14 = shl i32 %13, 23
%15 = or i32 %12, %14
%16 = load i32, i32* %8
%17 = sub nsw i32 %16, 1
%18 = shl i32 %17, 19
%19 = or i32 %15, %18
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %9, i32* %21
ret void
}

LLVM IR (-O2):
define void @BME_BFI_B(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = shl i32 %2, 23
%8 = shl i32 %3, 19
%9 = add i32 %8, -524288
%10 = or i32 %7, %6
%11 = or i32 %10, %9
%12 = or i32 %11, 268435456
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %1, i32* %14
ret void
}
__attribute__((always_)) void __change_bit(int nr,
                                           volatile unsigned long *addr) {
  asm volatile("btc %1,%0" : "+m"(*(volatile long *)(addr)) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<__change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__change_bit>:
btc    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btc $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_signal(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int rfm9xw_cond_signal(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  int result;
  pthread_mutex_lock(mutex);
  result = pthread_cond_signal(cond);
  pthread_mutex_unlock(mutex);
  return result;
}


x86 assembly (clang, -O0):
<rfm9xw_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_signal@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfm9xw_cond_signal>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %r14,%rdi
call   1030 <pthread_cond_signal@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rfm9xw_cond_signal(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @pthread_cond_signal(i32* %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = call i32 @pthread_mutex_unlock(i32* %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @rfm9xw_cond_signal(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
%4 = tail call i32 @pthread_cond_signal(i32* %0)
%5 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printu(unsigned int n, unsigned int b) {
  unsigned int a;
  a = n / b;
  if (a != 0) {
    printu(a, b);
  }
  putchar("0123456789ABCDEF"[n % b]);
}


x86 assembly (clang, -O0):
<printu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <printu+0x2e>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <printu@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
mov    %eax,%ecx
lea    0xe9f(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printu>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cmp    %edi,%esi
ja     113a <printu+0x1a>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <printu@plt>
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
lea    0xeb9(%rip),%rax
movsbl (%rdx,%rax,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @printu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = udiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = urem i32 %15, %16
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @putchar(i8 signext %20)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @printu(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = udiv i32 %0, %1
tail call void @printu(i32 %5, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = urem i32 %0, %1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @putchar(i8 signext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("1. In C, lowercase letters are significant.\n");
  printf("2. main() is where the program begins.\n");
  printf("3. Opening and closing brackets enclose the program statements in"
         "a routine.\n");
  printf("4. All program statements are terminated by a semicolon.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
call   1030 <printf@plt>
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"1. In C, lowercase letters are significant.\0A\00"
@.str.1 = [40 x i8] c"2. main() is where the program begins.\0A\00"
@.str.2 = [77 x i8] c"3. Opening and closing brackets enclose the program statements ina routine.\0A\00"
@.str.3 = [58 x i8] c"4. All program statements are terminated by a semicolon.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [44 x i8] c"1. In C, lowercase letters are significant.\00"
@str.4 = [39 x i8] c"2. main() is where the program begins.\00"
@str.5 = [76 x i8] c"3. Opening and closing brackets enclose the program statements ina routine.\00"
@str.6 = [57 x i8] c"4. All program statements are terminated by a semicolon.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, int, int /*<<< orphan*/);
int fd_set_offset(int fd, int offset) { return lseek(fd, offset, SEEK_SET); }


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

x86 assembly (clang, -O2):
<fd_set_offset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @fd_set_offset(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 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fd_set_offset(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
void Hal_hook_wr_sgnbfield_bitb(void) {}


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

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

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

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