xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int fchownat(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/);
int chown(const char *path, uid_t owner, gid_t group) {
  return fchownat(AT_FDCWD, path, owner, group, 0);
}


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <fchownat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chown>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
xor    %r8d,%r8d
jmp    1030 <fchownat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @chown(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 i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fchownat(i32 %7, i8* %8, i32 %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @chown(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @fchownat(i32 %4, i8* %0, i32 %1, i32 %2, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ testBigEndin();
int main() {
  if (testBigEndin())
    printf("big\n");
  else
    printf("small\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <testBigEndin@plt>
cmp    $0x0,%rax
je     1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <main+0x3d>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"big\0A\00"
@.str.1 = [7 x i8] c"small\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @testBigEndin()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"small\00"
@str.2 = [4 x i8] c"big\00"
define i32 @main() {
%1 = tail call i64 (...) @testBigEndin()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
void g_cclosure_marshal_VOID__ENUM() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__ENUM() {
ret void
}
/* Type definitions */
struct CRYPTO_DH {
  int dummy;
};
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ DH_free(int /*<<< orphan*/ *);
void crypto_dh_free(struct CRYPTO_DH *crypto_dh) {
  DH *dh = ((DH *)(crypto_dh));
  if (dh != NULL)
    DH_free(dh);
}


x86 assembly (clang, -O0):
<crypto_dh_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <crypto_dh_free+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <DH_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.CRYPTO_DH = type { i32 }
define void @crypto_dh_free(%struct.CRYPTO_DH* %0) {
%2 = alloca %struct.CRYPTO_DH*
%3 = alloca i32*
store %struct.CRYPTO_DH* %0, %struct.CRYPTO_DH** %2
%4 = load %struct.CRYPTO_DH*, %struct.CRYPTO_DH** %2
%5 = bitcast %struct.CRYPTO_DH* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @DH_free(i32* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.CRYPTO_DH = type { i32 }
define void @crypto_dh_free(%struct.CRYPTO_DH* %0) {
%2 = icmp eq %struct.CRYPTO_DH* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = getelementptr %struct.CRYPTO_DH, %struct.CRYPTO_DH* %0, i64 0, i32 0
%5 = tail call i32 @DH_free(i32* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LinuxTask_WaitEvent(int);
void LinuxTask_Suspend(void) { LinuxTask_WaitEvent(0x0001); }


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

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

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

LLVM IR (-O2):
define void @LinuxTask_Suspend() {
%1 = tail call i32 @LinuxTask_WaitEvent(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void print_error(char *error_msg) { write(2, error_msg, strlen(error_msg)); }


x86 assembly (clang, -O0):
<print_error>:
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   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @print_error(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 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @print_error(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x8c() {
  Assert_real((isodigit(140) == 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_isodigit.c",
              705, ("isodigit should be 0 for 0x8c"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2c1,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8c\00"
define void @t_isodigit_0x8c() {
%1 = call i64 @isodigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8c\00"
define void @t_isodigit_0x8c() {
%1 = tail call i64 @isodigit(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(void) {
  unsigned char *pp;
  unsigned w_cnt;
  w_cnt += *pp;
  return w_cnt;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i32, i32* %2
%7 = add i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpd_pi32(int /*<<< orphan*/);
__m64 test17(__m128d a) { return _mm_cvtpd_pi32(a); }


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

x86 assembly (clang, -O2):
<test17>:
jmp    1030 <_mm_cvtpd_pi32@plt>

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

LLVM IR (-O2):
define i32 @test17(i32 %0) {
%2 = tail call i32 @_mm_cvtpd_pi32(i32 %0)
ret i32 %2
}
/* Variables and functions */
long f1(int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  long int ret;
  ret = f1(num);
  printf("%ld\n", ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <f1@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @f1(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_max(void) { IF_fct_2('M'); }


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

x86 assembly (clang, -O2):
<IF_max>:
mov    $0x4d,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_max() {
%1 = call i32 @IF_fct_2(i8 signext 77)
ret void
}

LLVM IR (-O2):
define void @IF_max() {
%1 = tail call i32 @IF_fct_2(i8 signext 77)
ret void
}
int f1(int x) { return ((~x) == 0); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct sigcontext {
  unsigned long oldmask;
};

/* Variables and functions */
unsigned long *sc_sigmask(void *sc_ptr) {
  struct sigcontext *sc = sc_ptr;
  return (&sc->oldmask);
}


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

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

LLVM IR (-O0):
%struct.sigcontext = type { i64 }
define i64* @sc_sigmask(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.sigcontext*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.sigcontext*
store %struct.sigcontext* %5, %struct.sigcontext** %3
%6 = load %struct.sigcontext*, %struct.sigcontext** %3
%7 = getelementptr inbounds %struct.sigcontext, %struct.sigcontext* %6, i32 0, i32 0
ret i64* %7
}

LLVM IR (-O2):
define i64* @sc_sigmask(i8* readnone %0) {
%2 = bitcast i8* %0 to i64*
ret i64* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int weirdsum(int x, int y) {
  int *ar2 = malloc(2 * sizeof(int));
  ar2[0] = x;
  ar2[1] = y;
  int r = ar2[0] + ar2[1];
  free(ar2);
  return r;
}


x86 assembly (clang, -O0):
<weirdsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weirdsum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
add    %ebp,%ebx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @weirdsum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32* @malloc(i32 8)
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
store i32 %20, i32* %6
%21 = load i32*, i32** %5
%22 = call i32 @free(i32* %21)
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @weirdsum(i32 %0, i32 %1) {
%3 = tail call i32* @malloc(i32 8)
store i32 %0, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %1, i32* %4
%5 = add nsw i32 %1, %0
%6 = tail call i32 @free(i32* %3)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t le32(char *c) {
  uint32_t v = 0;
  for (unsigned int i = 0; i < 4; i++) {
    v *= 0x100;
    v += (unsigned char)c[3 - i];
  }
  return v;
}


x86 assembly (clang, -O0):
<le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    114f <le32+0x4f>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
sub    -0x10(%rbp),%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <le32+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @le32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %4, 16
%9 = shl nuw nsw i32 %7, 8
%10 = or i32 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = shl nuw nsw i32 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int open(const char *url, int port) {
  printf("ftp::open() called!\n");
  printf("ftp::open: not yet implemented\n");
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"ftp::open() called!\0A\00"
@.str.1 = [32 x i8] c"ftp::open: not yet implemented\0A\00"
define i32 @open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str = [20 x i8] c"ftp::open() called!\00"
@str.2 = [31 x i8] c"ftp::open: not yet implemented\00"
define i32 @open(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_ET8EC3(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


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

x86 assembly (clang, -O2):
<SensorGetReg_ET8EC3>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

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

LLVM IR (-O2):
define void @SensorGetReg_ET8EC3(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long id_function() { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @id_function() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @id_function() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Meu segundo programa");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"Meu segundo programa\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ putchar(int /*<<< orphan*/);
void stink_3(void) {
  char string[] = "Is it supposed to smell like this..?";
  char *s = string;
  while (putchar(*s++))
    ;
}


x86 assembly (clang, -O0):
<stink_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x25,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
je     116b <stink_3+0x4b>
jmp    1145 <stink_3+0x25>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stink_3>:
push   %rbx
sub    $0x30,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x3f2e2e73696874,%rax
mov    %rax,0x1d(%rsp)
mov    $0x49,%edi
call   1030 <putchar@plt>
test   %rax,%rax
je     1161 <stink_3+0x51>
lea    0x1(%rsp),%rbx
nop
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <putchar@plt>
test   %rax,%rax
jne    1150 <stink_3+0x40>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.stink_3.string = [37 x i8] c"Is it supposed to smell like this..?\00"
define void @stink_3() {
%1 = alloca [37 x i8]
%2 = alloca i8*
%3 = bitcast [37 x i8]* %1 to i8*
%4 = getelementptr inbounds [37 x i8], [37 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
br label %5
5: ; preds = %12, %0
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = call i64 @putchar(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
@__const.stink_3.string = [37 x i8] c"Is it supposed to smell like this..?\00"
define void @stink_3() {
%1 = alloca [37 x i8]
%2 = getelementptr inbounds [37 x i8], [37 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @putchar(i32 73)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = getelementptr inbounds [37 x i8], [37 x i8]* %1, i64 0, i64 1
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %6, %5 ], [ %10, %7 ]
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %9 to i32
%12 = tail call i64 @putchar(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor4uiv(unsigned int *);
void Color4uiv(unsigned int v[4]) { glColor4uiv(v); }


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

x86 assembly (clang, -O2):
<Color4uiv>:
jmp    1030 <glColor4uiv@plt>

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

LLVM IR (-O2):
define void @Color4uiv(i32* %0) {
%2 = tail call i32 @glColor4uiv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mill_yield(char *);
void go_yield() { mill_yield(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @go_yield() {
%1 = call i32 @mill_yield(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @go_yield() {
%1 = tail call i32 @mill_yield(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void A() {
  static int i = 0;
  if (!i) {
    printf("%d", i++);
  } else {
    printf("%d", i);
  }
}


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1143 <A+0x33>
mov    0x2f05(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2efa(%rip)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <A+0x45>
mov    0x2ee3(%rip),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
mov    $0x1,%esi
cmpb   $0x0,0x2f10(%rip)
jne    1127 <A+0x17>
movb   $0x1,0x2f07(%rip)
xor    %esi,%esi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@A.i = internal global i32 0
@.str = [3 x i8] c"%d\00"
define void @A() {
%1 = load i32, i32* @A.i
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @A.i
%5 = add nsw i32 %4, 1
store i32 %5, i32* @A.i
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
7: ; preds = %0
%8 = load i32, i32* @A.i
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@A.i = internal unnamed_addr global i1 false
@.str = [3 x i8] c"%d\00"
define void @A() {
%1 = load i1, i1* @A.i
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @A.i
br label %3
3: ; preds = %0, %2
%4 = phi i32 [ 0, %2 ], [ 1, %0 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  int sum = 0;
  int i = 0;
  for (i = 0; i < 3; i++)
    sum = sum + a[i][i];
  printf("%d\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    1186 <main+0x66>
mov    -0x34(%rbp),%eax
movslq -0x38(%rbp),%rdx
lea    -0x30(%rbp),%rcx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
movslq -0x38(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1152 <main+0x32>
mov    -0x34(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [3 x [3 x i32]]* %1 to i8*
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %9, %16
store i32 %17, i32* %2
br label %18
18: ; preds = %8
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 15)
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char const *, char *);
char *strerror(int);
scalar_t__ symlink(char const *, char const *);
void symlink_or_die(const char *old, const char *new) {
  if (symlink(old, new) < 0) {
    int err = errno;
    printf("symlink(%s, %s) failed: %s\n", old, new, strerror(err));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<symlink_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <symlink@plt>
cmp    $0x0,%rax
jge    11ac <symlink_or_die+0x6c>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <strerror@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink_or_die>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <symlink@plt>
test   %rax,%rax
js     115c <symlink_or_die+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [28 x i8] c"symlink(%s, %s) failed: %s\0A\00"
define void @symlink_or_die(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @symlink(i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32, i32* @errno
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i8* @strerror(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [28 x i8] c"symlink(%s, %s) failed: %s\0A\00"
define void @symlink_or_die(i8* %0, i8* %1) {
%3 = tail call i64 @symlink(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret void
}
void gtk_target_list_unref() {}


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

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

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

LLVM IR (-O2):
define void @gtk_target_list_unref() {
ret void
}
void func3(int *a) {
  if (!a)
    return;
  *a = 300;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <func3+0x18>
jmp    1122 <func3+0x22>
mov    -0x8(%rbp),%rax
movl   $0x12c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
test   %rdi,%rdi
je     110b <func3+0xb>
movl   $0x12c,(%rdi)
ret

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

LLVM IR (-O2):
define void @func3(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i32 300, i32* %0
br label %4
4: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ Get32s(void *);
unsigned Get32u(void *Long) { return (unsigned)Get32s(Long) & 0xffffffff; }


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

x86 assembly (clang, -O2):
<Get32u>:
jmp    1030 <Get32s@plt>

LLVM IR (-O0):
define i32 @Get32u(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @Get32s(i8* %3)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @Get32u(i8* %0) {
%2 = tail call i64 @Get32s(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;
struct alarm {
  int dummy;
};

/* Variables and functions */
int alarm_to_min(struct alarm *);
int /*<<< orphan*/ min_to_alarm(int, struct alarm *);
struct alarm *decrement_alarm(struct alarm *a) {
  uint16_t mins = alarm_to_min(a);
  mins = (mins - 5) % (24 * 60);
  min_to_alarm(mins, a);
  return a;
}


x86 assembly (clang, -O0):
<decrement_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alarm_to_min@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
mov    $0x5a0,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <min_to_alarm@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrement_alarm>:
push   %rbx
mov    %rdi,%rbx
call   1030 <alarm_to_min@plt>
mov    %eax,%ecx
add    $0xfffffffb,%ecx
movslq %ecx,%rcx
imul   $0xffffffffb60b60b7,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0xfffffffb,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xa,%ecx
add    %edx,%ecx
imul   $0x5a0,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0xfffffffb,%edi
mov    %rbx,%rsi
call   1040 <min_to_alarm@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.alarm = type { i32 }
define %struct.alarm* @decrement_alarm(%struct.alarm* %0) {
%2 = alloca %struct.alarm*
%3 = alloca i32
store %struct.alarm* %0, %struct.alarm** %2
%4 = load %struct.alarm*, %struct.alarm** %2
%5 = call i32 @alarm_to_min(%struct.alarm* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 5
%8 = srem i32 %7, 1440
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load %struct.alarm*, %struct.alarm** %2
%11 = call i32 @min_to_alarm(i32 %9, %struct.alarm* %10)
%12 = load %struct.alarm*, %struct.alarm** %2
ret %struct.alarm* %12
}

LLVM IR (-O2):
%struct.alarm = type { i32 }
define %struct.alarm* @decrement_alarm(%struct.alarm* returned %0) {
%2 = tail call i32 @alarm_to_min(%struct.alarm* %0)
%3 = add nsw i32 %2, -5
%4 = srem i32 %3, 1440
%5 = tail call i32 @min_to_alarm(i32 %4, %struct.alarm* %0)
ret %struct.alarm* %0
}
/* Variables and functions */
int /*<<< orphan*/ KDMKTONE;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
__attribute__((visibility("default"))) void NSBeep() {
  int ms = 5000;
  int freq = 440;
  int fd = 0;
  ioctl(fd, KDMKTONE, (ms << 16 | 1193180 / freq));
}


x86 assembly (clang, -O0):
<NSBeep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1388,-0x4(%rbp)
movl   $0x1b8,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1234dc,%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%edx
or     %eax,%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NSBeep>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x13880a97,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KDMKTONE = global i32 0
define void @NSBeep() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 5000, i32* %1
store i32 440, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @KDMKTONE
%6 = load i32, i32* %1
%7 = shl i32 %6, 16
%8 = load i32, i32* %2
%9 = sdiv i32 1193180, %8
%10 = or i32 %7, %9
%11 = call i32 @ioctl(i32 %4, i32 %5, i32 %10)
ret void
}

LLVM IR (-O2):
@KDMKTONE = global i32 0
define void @NSBeep() {
%1 = load i32, i32* @KDMKTONE
%2 = tail call i32 @ioctl(i32 0, i32 %1, i32 327682711)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: socket_server [-f] [-p pid_file] -s slot_id1 [-s "
                  "slot_id2]...[-s slot_idN]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"usage: socket_server [-f] [-p pid_file] -s slot_id1 [-s slot_id2]...[-s slot_idN]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"usage: socket_server [-f] [-p pid_file] -s slot_id1 [-s slot_id2]...[-s slot_idN]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double atof(char *);
int numcmp(char *s1, char *s2) {
  double v1, v2;
  v1 = atof(s1);
  v2 = atof(s2);
  if (v1 > v2)
    return 1;
  else if (v1 == v2)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1158 <numcmp+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1181 <numcmp+0x71>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    117a <numcmp+0x6a>
jp     117a <numcmp+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <numcmp+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp oeq double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %22
21: ; preds = %16
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp ogt double %3, %4
%6 = fcmp une double %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
void foo029() {}


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

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

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

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

/* Variables and functions */
uint64_t xoroshiro_rotl(const uint64_t x, int k) {
  return (x << k) | (x >> (64 - k));
}


x86 assembly (clang, -O0):
<xoroshiro_rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xoroshiro_rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xoroshiro_rotl(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @xoroshiro_rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_bytes(unsigned char *b, size_t len) {
  while (len--) {
    printf("%02x", *(b++));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115e <print_bytes+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1120 <print_bytes+0x10>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <print_bytes+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_bytes+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = zext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %5
15: ; preds = %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_bytes(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void typeFB(void) { lua_error("unexpected type"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"unexpected type\00"
define void @typeFB() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"unexpected type\00"
define void @typeFB() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}