xunge/DecIR huggingface dataset:
void EthernetDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000010;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~(0x00000001);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~(0x00000001);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<EthernetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetDisable>:
orq    $0x10,0x8(%rdi)
andq   $0xfffffffffffffffe,0xc(%rdi)
andq   $0xfffffffffffffffe,0x8(%rdi)
orq    $0x10,0x8(%rdi)
ret

LLVM IR (-O0):
define void @EthernetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 12
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -2
store volatile i64 %12, i64* %10
%13 = load i64, i64* %2
%14 = add i64 %13, 8
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = and i64 %16, -2
store volatile i64 %17, i64* %15
%18 = load i64, i64* %2
%19 = add i64 %18, 8
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = or i64 %21, 16
store volatile i64 %22, i64* %20
ret void
}

LLVM IR (-O2):
define void @EthernetDisable(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
%6 = add i64 %0, 12
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -2
store volatile i64 %9, i64* %7
%10 = load volatile i64, i64* %3
%11 = and i64 %10, -2
store volatile i64 %11, i64* %3
%12 = load volatile i64, i64* %3
%13 = or i64 %12, 16
store volatile i64 %13, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
int ft_strlen(char const *);
scalar_t__ malloc(int);
char *ft_strdup(const char *s1) {
  int i;
  char *s2;
  i = ft_strlen(s1) + 1;
  s2 = (char *)malloc(sizeof(*s2) * i);
  if (s2) {
    *s2 = '\0';
    ft_strcpy(s2, s1);
  }
  return (s2);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <ft_strdup+0x4d>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <ft_strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115a <ft_strdup+0x2a>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @ft_strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %1
%17 = load i8*, i8** %4
store i8 0, i8* %17
%18 = load i8*, i8** %4
%19 = load i8*, i8** %2
%20 = call i32 @ft_strcpy(i8* %18, i8* %19)
br label %21
21: ; preds = %16, %1
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
store i8 0, i8* %5
%8 = tail call i32 @ft_strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
long long int longlongint_ignoring_unsignedlonglong(long long int x,
                                                    unsigned long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longlongint_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
void displayFunc(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glFlush();
}


x86 assembly (clang, -O0):
<displayFunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayFunc>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @displayFunc() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @displayFunc() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glFlush()
ret void
}
void sample_decoded_detailed(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @sample_decoded_detailed(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
struct xdispline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlinsert(struct xdispline *, int);
int /*<<< orphan*/ wl_dldraw(struct xdispline *);
void wl_dlinsert(struct xdispline *line, int k) {
  dlinsert(line, k);
  wl_dldraw(line);
}


x86 assembly (clang, -O0):
<wl_dlinsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <dlinsert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wl_dldraw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_dlinsert>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dlinsert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <wl_dldraw@plt>

LLVM IR (-O0):
%struct.xdispline = type { i32 }
define void @wl_dlinsert(%struct.xdispline* %0, i32 %1) {
%3 = alloca %struct.xdispline*
%4 = alloca i32
store %struct.xdispline* %0, %struct.xdispline** %3
store i32 %1, i32* %4
%5 = load %struct.xdispline*, %struct.xdispline** %3
%6 = load i32, i32* %4
%7 = call i32 @dlinsert(%struct.xdispline* %5, i32 %6)
%8 = load %struct.xdispline*, %struct.xdispline** %3
%9 = call i32 @wl_dldraw(%struct.xdispline* %8)
ret void
}

LLVM IR (-O2):
%struct.xdispline = type { i32 }
define void @wl_dlinsert(%struct.xdispline* %0, i32 %1) {
%3 = tail call i32 @dlinsert(%struct.xdispline* %0, i32 %1)
%4 = tail call i32 @wl_dldraw(%struct.xdispline* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  return _mm_cmpeq_epi32(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cmpeq_epi32@plt>

LLVM IR (-O0):
define i32 @test(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 = call i32 @_mm_cmpeq_epi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_epi32(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct kvm_cpuid2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KVM_SET_CPUID2;
int ioctl(int, int /*<<< orphan*/, struct kvm_cpuid2 const *);
int kvm_set_cpuid2(int fd, const struct kvm_cpuid2 *cpuid) {
  return ioctl(fd, KVM_SET_CPUID2, cpuid);
}


x86 assembly (clang, -O0):
<kvm_set_cpuid2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_set_cpuid2>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.kvm_cpuid2 = type { i32 }
@KVM_SET_CPUID2 = global i32 0
define i32 @kvm_set_cpuid2(i32 %0, %struct.kvm_cpuid2* %1) {
%3 = alloca i32
%4 = alloca %struct.kvm_cpuid2*
store i32 %0, i32* %3
store %struct.kvm_cpuid2* %1, %struct.kvm_cpuid2** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KVM_SET_CPUID2
%7 = load %struct.kvm_cpuid2*, %struct.kvm_cpuid2** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.kvm_cpuid2* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.kvm_cpuid2 = type { i32 }
@KVM_SET_CPUID2 = global i32 0
define i32 @kvm_set_cpuid2(i32 %0, %struct.kvm_cpuid2* %1) {
%3 = load i32, i32* @KVM_SET_CPUID2
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.kvm_cpuid2* %1)
ret i32 %4
}
unsigned short log2_bsr(register unsigned short x) {
  unsigned short result;
  if (x == 0)
    return 0;
  asm("bsr   %1, %0        ;" : "=r"(result) : "r"(x));
  return result;
}


x86 assembly (clang, -O0):
<log2_bsr>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x0,%eax
jne    1123 <log2_bsr+0x23>
movw   $0x0,-0x2(%rbp)
jmp    1137 <log2_bsr+0x37>
mov    -0x4(%rbp),%ax
bsr    %ax,%ax
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_bsr>:
test   %edi,%edi
je     1109 <log2_bsr+0x9>
bsr    %di,%ax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i16 @log2_bsr(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i16 0, i16* %2
br label %13
9: ; preds = %1
%10 = load i16, i16* %3
%11 = call i16 asm "bsr $1, $0 ;", "=r,r,~{dirflag},~{fpsr},~{flags}"(i16 %10)
store i16 %11, i16* %4
%12 = load i16, i16* %4
store i16 %12, i16* %2
br label %13
13: ; preds = %9, %8
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @log2_bsr(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i16 asm "bsr $1, $0 ;", "=r,r,~{dirflag},~{fpsr},~{flags}"(i16 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i16 [ %4, %3 ], [ 0, %1 ]
ret i16 %6
}
/* Variables and functions */
unsigned int sqlUnsigned(char *);
char *strchr(char *, char);
int sqlUnsignedComma(char **pS) {
  char *s = *pS;
  char *e = strchr(s, ',');
  unsigned ret;
  *e++ = 0;
  *pS = e;
  ret = sqlUnsigned(s);
  return ret;
}


x86 assembly (clang, -O0):
<sqlUnsignedComma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <sqlUnsigned@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlUnsignedComma>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sqlUnsigned@plt>

LLVM IR (-O0):
define i32 @sqlUnsignedComma(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %2
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 44)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 0, i8* %10
%12 = load i8*, i8** %4
%13 = load i8**, i8*** %2
store i8* %12, i8** %13
%14 = load i8*, i8** %3
%15 = call i32 @sqlUnsigned(i8* %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @sqlUnsignedComma(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
store i8* %4, i8** %0
%5 = tail call i32 @sqlUnsigned(i8* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ begin(int /*<<< orphan*/);
int /*<<< orphan*/ end(int);
int main(int argc, const char *argv[]) {
  begin(0);
  end(1);
  end(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <begin@plt>
mov    $0x1,%edi
call   1030 <end@plt>
mov    $0x1,%edi
call   1030 <end@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @begin(i32 0)
%4 = tail call i32 @end(i32 1)
%5 = tail call i32 @end(i32 1)
ret i32 0
}
int cairo_code_draw_reel_get_height() { return 381; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_reel_get_height() {
ret i32 381
}

LLVM IR (-O2):
define i32 @cairo_code_draw_reel_get_height() {
ret i32 381
}
h() { return 2; }


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

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

LLVM IR (-O0):
define i32 @h() {
ret i32 2
}

LLVM IR (-O2):
define i32 @h() {
ret i32 2
}
/* Variables and functions */
int resta(int, int);
int main(int argc, char *argv[]) {
  int num;
  int result = resta(num, 5);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   1030 <resta@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%esi
jmp    1030 <resta@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @resta(i32 undef, i32 5)
ret i32 %3
}
/* Variables and functions */
int system(char const *);
int /*<<< orphan*/ trace(int, char *, char const *);
extern int execcmd(const char *cmd) {
  trace(3, "execcmd: cmd=%s\n", cmd);
  return system(cmd);
}


x86 assembly (clang, -O0):
<execcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
lea    0xec4(%rip),%rsi
call   1040 <trace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execcmd>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x3,%edi
mov    %rbx,%rdx
call   1040 <trace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"execcmd: cmd=%s\0A\00"
define i32 @execcmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @trace(i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @system(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"execcmd: cmd=%s\0A\00"
define i32 @execcmd(i8* %0) {
%2 = tail call i32 @trace(i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @system(i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void end_ani_gif(FILE *fp) { fputc(';', fp); }


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

x86 assembly (clang, -O2):
<end_ani_gif>:
mov    %rdi,%rsi
mov    $0x3b,%edi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @end_ani_gif(i32* nocapture %0) {
%2 = tail call i32 @fputc(i8 signext 59, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_storel_epi64(int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ const);
void xx_storel_64(void *const a, const __m128i v) {
  _mm_storel_epi64((__m128i *)a, v);
}


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

x86 assembly (clang, -O2):
<xx_storel_64>:
jmp    1030 <_mm_storel_epi64@plt>

LLVM IR (-O0):
define void @xx_storel_64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @_mm_storel_epi64(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @xx_storel_64(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @_mm_storel_epi64(i32* %3, i32 %1)
ret void
}
void c_func_2_(int *n) { *n = 1; }


x86 assembly (clang, -O0):
<c_func_2_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_func_2_>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @c_func_2_(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int machdep_sys_open(char *, int, int);
int machdep_sys_creat(char *path, int mode) {
  return (machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
}


x86 assembly (clang, -O0):
<machdep_sys_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ec5(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <machdep_sys_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_creat>:
mov    0x2eb1(%rip),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <machdep_sys_open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @machdep_sys_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_WRONLY
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @machdep_sys_open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @machdep_sys_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @machdep_sys_open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
void _cpu_int_enable() { __asm__("sti"); }


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

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

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

LLVM IR (-O2):
define void @_cpu_int_enable() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int lourenco(int x) { return x * 10; }


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

x86 assembly (clang, -O2):
<lourenco>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @lourenco(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 10
ret i32 %4
}

LLVM IR (-O2):
define i32 @lourenco(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ oor_start();
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  oor_start();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <oor_start@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @oor_start()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @oor_start()
ret i32 0
}
void gdk_colormap_alloc_colors() {}


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

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

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

LLVM IR (-O2):
define void @gdk_colormap_alloc_colors() {
ret void
}
/* Variables and functions */
int mylibA();
int mylibB();
int main(void) { return mylibA() + mylibB(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <mylibA@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <mylibB@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mylibA()
%3 = call i32 (...) @mylibB()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mylibA()
%2 = tail call i32 (...) @mylibB()
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mysql_library_end();
void am_mysql_library_end(void) { mysql_library_end(); }


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

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

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

LLVM IR (-O2):
define void @am_mysql_library_end() {
%1 = tail call i32 (...) @mysql_library_end()
ret void
}
void autonomous7() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ vprintf(char *, int /*<<< orphan*/);
void uninitvar_vprintf(char *Format, va_list Arg) {
  char *format1, *format2;
  va_list arg1, arg2;
  (void)vprintf(format1, arg1);
  (void)vprintf(format2, Arg);
  (void)vprintf(Format, Arg);
  (void)vprintf(Format, arg2);
}


x86 assembly (clang, -O0):
<uninitvar_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1030 <vprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_vprintf>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <vprintf@plt>
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <vprintf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <vprintf@plt>

LLVM IR (-O0):
define void @uninitvar_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = call i32 @vprintf(i8* %9, i32 %10)
%12 = load i8*, i8** %6
%13 = load i32, i32* %4
%14 = call i32 @vprintf(i8* %12, i32 %13)
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = call i32 @vprintf(i8* %15, i32 %16)
%18 = load i8*, i8** %3
%19 = load i32, i32* %8
%20 = call i32 @vprintf(i8* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vprintf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @vprintf(i8* undef, i32 undef)
%4 = tail call i32 @vprintf(i8* undef, i32 %1)
%5 = tail call i32 @vprintf(i8* %0, i32 %1)
%6 = tail call i32 @vprintf(i8* %0, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yyerror(const char *str) { fprintf(stderr, "error: %s\n", str); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define void @yyerror(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 ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int main(void) {
  ft_putstr("w0l0l0");
  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 <ft_putstr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"w0l0l0\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"w0l0l0\00"
define i32 @main() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void register_page_bootmem_info_node(struct pglist_data *pgdat) {}


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

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

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

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @register_page_bootmem_info_node(%struct.pglist_data* nocapture %0) {
ret void
}
unsigned int get_project(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @get_project() {
ret i32 0
}

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

/* Variables and functions */
uint16_t normalize_opentx(int16_t value) {
  return (uint16_t)(((500 * value) / 32767) + 1500);
}


x86 assembly (clang, -O0):
<normalize_opentx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x1f4,-0x4(%rbp),%eax
mov    $0x7fff,%ecx
cltd
idiv   %ecx
add    $0x5dc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_opentx>:
imul   $0x1f4,%edi,%eax
cltq
imul   $0xffffffff80010003,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
sar    $0xe,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x5dc,%eax
ret

LLVM IR (-O0):
define i32 @normalize_opentx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 500, %3
%5 = sdiv i32 %4, 32767
%6 = add nsw i32 %5, 1500
ret i32 %6
}

LLVM IR (-O2):
define i32 @normalize_opentx(i32 %0) {
%2 = mul nsw i32 %0, 500
%3 = sdiv i32 %2, 32767
%4 = add nsw i32 %3, 1500
ret i32 %4
}
/* Variables and functions */
int atoh(char);
int atoo(char o) {
  if ((o >= '0') && (o <= '7'))
    return atoh(o);
  return -1;
}


x86 assembly (clang, -O0):
<atoo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1149 <atoo+0x39>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
jg     1149 <atoo+0x39>
movsbl -0x5(%rbp),%edi
call   1030 <atoh@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <atoo+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoo>:
mov    %edi,%eax
and    $0xf8,%al
cmp    $0x30,%al
jne    1121 <atoo+0x11>
movsbl %dil,%edi
jmp    1030 <atoh@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @atoo(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 55
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %3
%13 = call i32 @atoh(i8 signext %12)
store i32 %13, i32* %2
br label %15
14: ; preds = %7, %1
store i32 -1, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @atoo(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @atoh(i8 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ WEXITSTATUS(int);
int /*<<< orphan*/ WIFEXITED(int);
int system(char *);
int enable_pullup() {
  int status;
  status = system("gpio -g mode "
                  "4"
                  " up");
  if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<enable_pullup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <WIFEXITED@plt>
cmp    $0x0,%eax
je     116a <enable_pullup+0x3a>
mov    -0x8(%rbp),%edi
call   1040 <WEXITSTATUS@plt>
cmp    $0x0,%rax
je     1176 <enable_pullup+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <enable_pullup+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_pullup>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <WIFEXITED@plt>
test   %eax,%eax
je     1158 <enable_pullup+0x28>
mov    %ebx,%edi
call   1040 <WEXITSTATUS@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"gpio -g mode 4 up\00"
define i32 @enable_pullup() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @WIFEXITED(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i64 @WEXITSTATUS(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %0
store i32 -1, i32* %1
br label %13
12: ; preds = %7
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"gpio -g mode 4 up\00"
define i32 @enable_pullup() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WIFEXITED(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i64 @WEXITSTATUS(i32 %1)
%6 = icmp ne i64 %5, 0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ -1, %0 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *, int);
void func() {
  int answer = 86 >> 2;
  printf("Answer: %d", answer);
  fork();
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x15,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x15,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fork@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Answer: %d\00"
define void @func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 21)
%2 = tail call i32 (...) @fork()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int realopen(char const *, int, int /*<<< orphan*/);
scalar_t__ strncmp(char const *, char *, int);
int open(__const char *__file, int __oflag, mode_t __mode) {
  if (strncmp(__file, "/dev/dvb/adapter", 16) == 0)
    __oflag |= (010000 | 020000);
  printf("flags: %04x", __oflag);
  return realopen(__file, __oflag, __mode);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x10,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116c <open+0x3c>
mov    -0xc(%rbp),%eax
or     $0x3000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <realopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
lea    0xeba(%rip),%rsi
mov    $0x10,%edx
call   1030 <strncmp@plt>
mov    %ebx,%ebp
or     $0x3000,%ebp
test   %rax,%rax
cmovne %ebx,%ebp
lea    0xeac(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <realopen@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/dvb/adapter\00"
@.str.1 = [12 x i8] c"flags: %04x\00"
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = or i32 %11, 12288
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %3
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @realopen(i8* %16, i32 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/dvb/adapter\00"
@.str.1 = [12 x i8] c"flags: %04x\00"
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%5 = icmp eq i64 %4, 0
%6 = or i32 %1, 12288
%7 = select i1 %5, i32 %6, i32 %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @realopen(i8* %0, i32 %7, i32 %2)
ret i32 %9
}
/* Variables and functions */
int isatty(int);
int posix_isatty(int fd) { return isatty(fd); }


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

x86 assembly (clang, -O2):
<posix_isatty>:
jmp    1030 <isatty@plt>

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

LLVM IR (-O2):
define i32 @posix_isatty(i32 %0) {
%2 = tail call i32 @isatty(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int recv(int, char *, int, int /*<<< orphan*/);
void read_fd(int fd) {
  char c;
  while (recv(fd, &c, 1, 0) == 1)
    putchar(c);
}


x86 assembly (clang, -O0):
<read_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x1,%eax
jne    1155 <read_fd+0x35>
movsbl -0x5(%rbp),%edi
call   1040 <putchar@plt>
jmp    112b <read_fd+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fd>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x1,%eax
jne    1170 <read_fd+0x50>
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl 0x7(%rsp),%edi
call   1040 <putchar@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x1,%eax
je     1150 <read_fd+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @read_fd(i32 %0) {
%2 = alloca i8
%3 = call i32 @recv(i32 %0, i8* %2, i32 1, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = load i8, i8* %2
%7 = call i32 @putchar(i8 signext %6)
%8 = call i32 @recv(i32 %0, i8* %2, i32 1, i32 0)
%9 = icmp eq i32 %8, 1
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
void log_err(const char *fmt, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @log_err(i8* nocapture %0, ...) {
ret void
}
int config_CARDREADER_SMARGO(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_CARDREADER_SMARGO() {
ret i32 0
}

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

/* Variables and functions */
int spatialdb_init(int /*<<< orphan*/ *, char const **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/);
int /*<<< orphan*/ spatialdb_spatialite4_schema();
int sqlite3_gpkg_spl4_init(sqlite3 *db, const char **pzErrMsg,
                           const sqlite3_api_routines *pThunk) {
  return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite4_schema());
}


x86 assembly (clang, -O0):
<sqlite3_gpkg_spl4_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <spatialdb_spatialite4_schema@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <spatialdb_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_gpkg_spl4_init>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <spatialdb_spatialite4_schema@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <spatialdb_init@plt>

LLVM IR (-O0):
define i32 @sqlite3_gpkg_spl4_init(i32* %0, i8** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @spatialdb_spatialite4_schema()
%11 = call i32 @spatialdb_init(i32* %7, i8** %8, i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sqlite3_gpkg_spl4_init(i32* %0, i8** %1, i32* %2) {
%4 = tail call i32 (...) @spatialdb_spatialite4_schema()
%5 = tail call i32 @spatialdb_init(i32* %0, i8** %1, i32* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ faterror(char *);
int looping;
writeerror() {
  static looping;
  if (looping)
    exit(2);
  looping = 1;
  faterror("write error");
}


x86 assembly (clang, -O0):
<writeerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f05(%rip)
je     113f <writeerror+0x1f>
mov    $0x2,%edi
call   1040 <exit@plt>
movl   $0x1,0x2eeb(%rip)
lea    0xeb0(%rip),%rdi
call   1030 <faterror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeerror>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
je     113e <writeerror+0x1e>
movb   $0x1,0x2f03(%rip)
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <faterror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@writeerror.looping = internal global i32 0
@.str = [12 x i8] c"write error\00"
@looping = global i32 0
define i32 @writeerror() {
%1 = alloca i32
%2 = load i32, i32* @writeerror.looping
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 2)
unreachable
6: ; preds = %0
store i32 1, i32* @writeerror.looping
%7 = call i32 @faterror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@writeerror.looping = internal unnamed_addr global i1 false
@.str = [12 x i8] c"write error\00"
@looping = global i32 0
define i32 @writeerror() {
%1 = load i1, i1* @writeerror.looping
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 @exit(i32 2)
unreachable
4: ; preds = %0
store i1 true, i1* @writeerror.looping
%5 = tail call i32 @faterror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int get_dig(int val, int l2radix, int idx) {
  return (val >> (l2radix * idx)) & ((1 << l2radix) - 1);
}


x86 assembly (clang, -O0):
<get_dig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dig>:
mov    %edx,%ecx
imul   %esi,%ecx
sar    %cl,%edi
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_dig(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = mul nsw i32 %8, %9
%11 = ashr i32 %7, %10
%12 = load i32, i32* %5
%13 = shl i32 1, %12
%14 = sub nsw i32 %13, 1
%15 = and i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_dig(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = ashr i32 %0, %4
%6 = shl nsw i32 -1, %1
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}