xunge/DecIR huggingface dataset:
unsigned xrop3_162_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_162_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_162_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
mov    %edi,%ecx
xor    $0xff,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_162_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_162_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, 255
%8 = or i32 %7, %5
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
unsigned short le_short(unsigned short s) {
  unsigned short ret = s;
  return ret;
}


x86 assembly (clang, -O0):
<le_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_short>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @le_short(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
store i16 %4, i16* %3
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @le_short(i16 returned zeroext %0) {
ret i16 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ DSA;
typedef int /*<<< orphan*/ BN_MONT_CTX;
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_mod_exp_mont(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
                   const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) {
  return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
}


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

x86 assembly (clang, -O2):
<dsa_bn_mod_exp>:
mov    %r9,%rax
mov    %rsi,%rdi
mov    0x8(%rsp),%r9
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
jmp    1030 <BN_mod_exp_mont@plt>

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

LLVM IR (-O2):
define i32 @dsa_bn_mod_exp(i32* nocapture readnone %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = tail call i32 @BN_mod_exp_mont(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
ret i32 %8
}
void oid_1000umts(void) { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @oid_1000umts() {
ret void
}
int be_atoi(char *s) {
  unsigned char *us = (unsigned char *)s;
  return (us[0] << 24 | us[1] << 16 | us[2] << 8 | us[3]);
}


x86 assembly (clang, -O0):
<be_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @be_atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %21, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @be_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ call_c2ada(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  call_c2ada(n, m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <call_c2ada@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <call_c2ada@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 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* %1
%6 = load i32, i32* %2
%7 = call i32 @call_c2ada(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @call_c2ada(i32 %7, i32 %8)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xkey_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xkey.window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xkey_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ WriteEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ResetStaticVar(void) { WriteEvent(NULL, NULL); }


x86 assembly (clang, -O0):
<ResetStaticVar>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <WriteEvent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetStaticVar>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <WriteEvent@plt>

LLVM IR (-O0):
define void @ResetStaticVar() {
%1 = call i32 @WriteEvent(i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @ResetStaticVar() {
%1 = tail call i32 @WriteEvent(i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abc(int);
main() { abc(((200, 100), (300, 400))); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x190,%edi
call   1030 <abc@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @abc(i32 400)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @abc(i32 400)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _datasize(uint8_t *ptr, int max) {
  (void)ptr;
  (void)max;
  return max;
}


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

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

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

LLVM IR (-O2):
define i32 @_datasize(i32* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int f334(int *);
int f335(int *p) { return f334(p); }


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

x86 assembly (clang, -O2):
<f335>:
jmp    1030 <f334@plt>

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

LLVM IR (-O2):
define i32 @f335(i32* %0) {
%2 = tail call i32 @f334(i32* %0)
ret i32 %2
}
char *xlBanner(void) {
  return "XLISP 3.3, September 6, 2002 Copyright (c) 1984-2002, by David Betz";
}


x86 assembly (clang, -O0):
<xlBanner>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlBanner>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [68 x i8] c"XLISP 3.3, September 6, 2002 Copyright (c) 1984-2002, by David Betz\00"
define i8* @xlBanner() {
ret i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [68 x i8] c"XLISP 3.3, September 6, 2002 Copyright (c) 1984-2002, by David Betz\00"
define i8* @xlBanner() {
ret i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ perror(char *);
void cria_arquivo(char *fname) {
  FILE *f = fopen(fname, "w");
  if (!f) {
    perror("fopen");
    return;
  }
  fprintf(f, "Arquivo criado pela lib");
  fclose(f);
}


x86 assembly (clang, -O0):
<cria_arquivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <cria_arquivo+0x3c>
lea    0xe90(%rip),%rdi
call   1060 <perror@plt>
jmp    1195 <cria_arquivo+0x55>
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cria_arquivo>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1177 <cria_arquivo+0x37>
mov    %rax,%rbx
lea    0xeac(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
lea    0xe84(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [6 x i8] c"fopen\00"
@.str.2 = [24 x i8] c"Arquivo criado pela lib\00"
define void @cria_arquivo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32*, i32** %3
%14 = call i32 @fclose(i32* %13)
br label %15
15: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [6 x i8] c"fopen\00"
@.str.2 = [24 x i8] c"Arquivo criado pela lib\00"
define void @cria_arquivo(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 23, i64 1, i32* %2)
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %6, %4
ret void
}
unsigned int hash(const char *str, int str_len) {
  unsigned int hash;
  const char *end;
  end = str + str_len;
  hash = 0;
  for (; str < end; str++) {
    hash = (hash * 263) + *str;
  }
  hash = hash & (2048 - 1);
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1153 <hash+0x53>
imul   $0x107,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1121 <hash+0x21>
mov    -0x10(%rbp),%eax
and    $0x7ff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
test   %esi,%esi
jle    112a <hash+0x2a>
movslq %esi,%rcx
add    %rdi,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x107,%eax,%edx
movsbl (%rdi),%eax
add    %edx,%eax
add    $0x1,%rdi
cmp    %rcx,%rdi
jb     1110 <hash+0x10>
and    $0x7ff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %17
6: ; preds = %2, %6
%7 = phi i8* [ %13, %6 ], [ %0, %2 ]
%8 = phi i32 [ %12, %6 ], [ 0, %2 ]
%9 = mul i32 %8, 263
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = add i32 %9, %11
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp ult i8* %13, %4
br i1 %14, label %6, label %15
15: ; preds = %6
%16 = and i32 %12, 2047
br label %17
17: ; preds = %15, %2
%18 = phi i32 [ 0, %2 ], [ %16, %15 ]
ret i32 %18
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t max_1(int32_t x_2, int32_t y_1) {
  if (x_2 < y_1) {
    return y_1;
  } else {
    return x_2;
  }
}


x86 assembly (clang, -O0):
<max_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <max_1+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max_1+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_1>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @max_1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %5
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %4
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @max_1(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void overlap_write_end(FILE *file) { fprintf(file, "]\n"); }


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

x86 assembly (clang, -O2):
<overlap_write_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"]\0A\00"
define void @overlap_write_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
void pad_bits(size_t target, size_t mask, size_t *dst) {
  *dst = (target + mask) & ~mask;
}


x86 assembly (clang, -O0):
<pad_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_bits>:
add    %rsi,%rdi
not    %rsi
and    %rdi,%rsi
mov    %rsi,(%rdx)
ret

LLVM IR (-O0):
define void @pad_bits(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add i64 %7, %8
%10 = load i64, i64* %5
%11 = xor i64 %10, -1
%12 = and i64 %9, %11
%13 = load i64*, i64** %6
store i64 %12, i64* %13
ret void
}

LLVM IR (-O2):
define void @pad_bits(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = add i64 %1, %0
%5 = xor i64 %1, -1
%6 = and i64 %4, %5
store i64 %6, i64* %2
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct slName {
  int dummy;
};

/* Variables and functions */
struct slName *extNamesForId(struct sqlConnection *, int, char *);
struct slName *visiGeneGenbank(struct sqlConnection *conn, int id) {
  return extNamesForId(conn, id, "genbank");
}


x86 assembly (clang, -O0):
<visiGeneGenbank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <extNamesForId@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneGenbank>:
lea    0xee9(%rip),%rdx
jmp    1030 <extNamesForId@plt>

LLVM IR (-O0):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"genbank\00"
define %struct.slName* @visiGeneGenbank(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call %struct.slName* @extNamesForId(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %7
}

LLVM IR (-O2):
%struct.slName = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"genbank\00"
define %struct.slName* @visiGeneGenbank(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call %struct.slName* @extNamesForId(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slName* %3
}
/* Type definitions */
struct stat {
  unsigned long st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
unsigned long get_file_size(const char *path) {
  unsigned long filesize = -1;
  struct stat statbuff;
  if (stat(path, &statbuff) < 0) {
    return -1;
  } else {
    filesize = statbuff.st_size;
  }
  return filesize;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1148 <get_file_size+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1158 <get_file_size+0x48>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     112c <get_file_size+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, -1
%8 = select i1 %7, i64 %6, i64 -1
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_destroy(pthread_attr_t *attr) {
  (void)attr;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_destroy(i32* nocapture readnone %0) {
ret i32 0
}
void gdt_init() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @opcode_statistics() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun1();
void fun2(void) { fun1(); }


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

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

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

LLVM IR (-O2):
define void @fun2() {
%1 = tail call i32 (...) @fun1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_maze(char **maze, int h) {
  while (h >= 1) {
    h--;
    free(maze[h]);
  }
}


x86 assembly (clang, -O0):
<free_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1148 <free_maze+0x38>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <free_maze+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_maze>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <free_maze+0x36>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_maze+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @free_maze(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = load i8**, i8*** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @free(i8* %15)
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @free_maze(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int paged_mem_pool_free(void *, void *);
int virtual_machine_resource_pool_page_free(void *pool_ptr, void *ptr) {
  return paged_mem_pool_free(pool_ptr, ptr);
}


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

x86 assembly (clang, -O2):
<virtual_machine_resource_pool_page_free>:
jmp    1030 <paged_mem_pool_free@plt>

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

LLVM IR (-O2):
define i32 @virtual_machine_resource_pool_page_free(i8* %0, i8* %1) {
%3 = tail call i32 @paged_mem_pool_free(i8* %0, i8* %1)
ret i32 %3
}
int read_voltage() { return 4321; }


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

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

LLVM IR (-O0):
define i32 @read_voltage() {
ret i32 4321
}

LLVM IR (-O2):
define i32 @read_voltage() {
ret i32 4321
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long event;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_event(void *_p, unsigned long _v) {
  ((XGravityEvent *)_p)->event = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XGravityEvent_event>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGravityEvent_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct Bind {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Bind *);
void bind_free(struct Bind *b) { free(b); }


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

x86 assembly (clang, -O2):
<bind_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Bind = type { i32 }
define void @bind_free(%struct.Bind* %0) {
%2 = alloca %struct.Bind*
store %struct.Bind* %0, %struct.Bind** %2
%3 = load %struct.Bind*, %struct.Bind** %2
%4 = call i32 @free(%struct.Bind* %3)
ret void
}

LLVM IR (-O2):
%struct.Bind = type { i32 }
define void @bind_free(%struct.Bind* nocapture %0) {
%2 = tail call i32 @free(%struct.Bind* %0)
ret void
}
/* Type definitions */
struct tdb_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ F_WRLCK;
int _tdb_unlockall(struct tdb_context *, int /*<<< orphan*/);
int ext2fs_tdb_unlockall(struct tdb_context *tdb) {
  return _tdb_unlockall(tdb, F_WRLCK);
}


x86 assembly (clang, -O0):
<ext2fs_tdb_unlockall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <_tdb_unlockall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_tdb_unlockall>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <_tdb_unlockall@plt>

LLVM IR (-O0):
%struct.tdb_context = type { i32 }
@F_WRLCK = global i32 0
define i32 @ext2fs_tdb_unlockall(%struct.tdb_context* %0) {
%2 = alloca %struct.tdb_context*
store %struct.tdb_context* %0, %struct.tdb_context** %2
%3 = load %struct.tdb_context*, %struct.tdb_context** %2
%4 = load i32, i32* @F_WRLCK
%5 = call i32 @_tdb_unlockall(%struct.tdb_context* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.tdb_context = type { i32 }
@F_WRLCK = global i32 0
define i32 @ext2fs_tdb_unlockall(%struct.tdb_context* %0) {
%2 = load i32, i32* @F_WRLCK
%3 = tail call i32 @_tdb_unlockall(%struct.tdb_context* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRC2_get(void) { return U_WMRCORENONE_get("U_WMRC2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC2\00"
define i32 @U_WMRC2_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC2\00"
define i32 @U_WMRC2_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int mypow2(int n) {
  if (n < 0)
    n *= (-1);
  int powValue = 1;
  powValue <<= n;
  return powValue;
}


x86 assembly (clang, -O0):
<mypow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <mypow2+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mypow2>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @mypow2(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = shl nuw i32 1, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_SetIP() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_SetIP() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_unpackhi_pd(__m128d A, __m128d B) {
  return _mm_unpackhi_pd(A, B);
}


x86 assembly (clang, -O0):
<test_mm_unpackhi_pd>:
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_unpackhi_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_unpackhi_pd>:
jmp    1030 <_mm_unpackhi_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_unpackhi_pd(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_unpackhi_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_unpackhi_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpackhi_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *, long *);
int main(void) {
  long a, b;
  scanf("%ld %ld", &a, &b);
  printf("%ld", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%rsi
add    0x10(%rsp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = add nsw i64 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_destroy(int /*<<< orphan*/ *);
void destroy_or_die(pthread_mutex_t *mtx) {
  if (pthread_mutex_destroy(mtx)) {
    perror("Couldn't destroy initialized mutex.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<destroy_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
cmp    $0x0,%rax
je     1169 <destroy_or_die+0x39>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_or_die>:
push   %rax
call   1030 <pthread_mutex_destroy@plt>
test   %rax,%rax
jne    113d <destroy_or_die+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Couldn't destroy initialized mutex.\0A\00"
@EXIT_FAILURE = global i32 0
define void @destroy_or_die(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_destroy(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Couldn't destroy initialized mutex.\0A\00"
@EXIT_FAILURE = global i32 0
define void @destroy_or_die(i32* %0) {
%2 = tail call i64 @pthread_mutex_destroy(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int randomize() { srandom(time(0)); }


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srandom@plt>

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

LLVM IR (-O2):
define i32 @randomize() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srandom(i32 %1)
ret i32 undef
}
main(argc, argv, envp) int argc;
char **argv;
char **envp;
{
  extern void dummy();
  dummy();
  return 0;
}


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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <dummy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
tail call void (...) @dummy()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *);
void xsyslog(BIO *bp, int priority, const char *string) {
  syslog(priority, "%s", string);
}


x86 assembly (clang, -O0):
<xsyslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xecf(%rip),%rsi
call   1030 <syslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsyslog>:
mov    %esi,%edi
lea    0xee7(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @xsyslog(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @xsyslog(i32* nocapture readnone %0, i32 %1, i8* %2) {
%4 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long gettime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (t.tv_sec * 1000000) + t.tv_usec;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}