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

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_CERT_SEQUENCE_it;
NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void) {
  return (NETSCAPE_CERT_SEQUENCE *)ASN1_item_new(&NETSCAPE_CERT_SEQUENCE_it);
}


x86 assembly (clang, -O0):
<NETSCAPE_CERT_SEQUENCE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NETSCAPE_CERT_SEQUENCE_new>:
mov    0x2ed9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@NETSCAPE_CERT_SEQUENCE_it = global i32 0
define i32* @NETSCAPE_CERT_SEQUENCE_new() {
%1 = call i64 @ASN1_item_new(i32* @NETSCAPE_CERT_SEQUENCE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@NETSCAPE_CERT_SEQUENCE_it = global i32 0
define i32* @NETSCAPE_CERT_SEQUENCE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @NETSCAPE_CERT_SEQUENCE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, ...);
void CL_WavFilename(int number, char *fileName) {
  if (number < 0 || number > 9999) {
    Com_sprintf(fileName, 256, "wav9999");
    return;
  }
  Com_sprintf(fileName, 256, "wav%04i", number);
}


x86 assembly (clang, -O0):
<CL_WavFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <CL_WavFilename+0x26>
cmpl   $0x270f,-0x4(%rbp)
jle    1152 <CL_WavFilename+0x42>
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
jmp    116c <CL_WavFilename+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xea3(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_WavFilename>:
cmp    $0x2710,%edi
jb     112e <CL_WavFilename+0x1e>
lea    0xee1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>
mov    %edi,%ecx
lea    0xed1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"wav9999\00"
@.str.1 = [8 x i8] c"wav%04i\00"
define void @CL_WavFilename(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 9999
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %11, i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %17
13: ; preds = %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %14, i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"wav9999\00"
@.str.1 = [8 x i8] c"wav%04i\00"
define void @CL_WavFilename(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 9999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
void io_schedule(void) { return; }


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

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

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

LLVM IR (-O2):
define void @io_schedule() {
ret void
}
int fun479() { return 479; }


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

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

LLVM IR (-O0):
define i32 @fun479() {
ret i32 479
}

LLVM IR (-O2):
define i32 @fun479() {
ret i32 479
}
void fail(char *linebuf, char *reason) {}


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

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

LLVM IR (-O0):
define void @fail(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @fail(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perrorv(char *, int);
int posix_fadvise(int, int /*<<< orphan*/, int /*<<< orphan*/, unsigned int);
void fadvise(int fd, unsigned int advice) {
  int err = posix_fadvise(fd, 0, 0, advice);
  if (err != 0) {
    perrorv("posix_fadvise", err);
  }
}


x86 assembly (clang, -O0):
<fadvise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <posix_fadvise@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1159 <fadvise+0x39>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <perrorv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadvise>:
push   %rax
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <posix_fadvise@plt>
test   %eax,%eax
je     113f <fadvise+0x1f>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <perrorv@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"posix_fadvise\00"
define void @fadvise(i32 %0, i32 %1) {
%3 = tail call i32 @posix_fadvise(i32 %0, i32 0, i32 0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perrorv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int getlen(char const *);
int read(int, char *, int);
int /*<<< orphan*/ reportError(char *, int);
int target(int fd, const char *s) {
  char buffer[10];
  int bs = read(fd, buffer, 5);
  if (bs < 0) {
    int l = getlen(s);
    reportError(buffer, l);
    return -30;
  }
  return bs + 6;
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1a(%rbp),%rsi
mov    $0x5,%edx
call   1030 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1181 <target+0x51>
mov    -0x10(%rbp),%rdi
call   1050 <getlen@plt>
mov    %eax,-0x24(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <reportError@plt>
movl   $0xffffffe2,-0x4(%rbp)
jmp    118a <target+0x5a>
mov    -0x20(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x6(%rsp),%rsi
mov    $0x5,%edx
call   1030 <read@plt>
test   %eax,%eax
js     1150 <target+0x20>
add    $0x6,%eax
jmp    1169 <target+0x39>
mov    %rbx,%rdi
call   1050 <getlen@plt>
lea    0x6(%rsp),%rdi
mov    %eax,%esi
call   1040 <reportError@plt>
mov    $0xffffffe2,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @target(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [10 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%9 = load i32, i32* %4
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%11 = call i32 @read(i32 %9, i8* %10, i32 5)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = call i32 @getlen(i8* %15)
store i32 %16, i32* %8
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%18 = load i32, i32* %8
%19 = call i32 @reportError(i8* %17, i32 %18)
store i32 -30, i32* %3
br label %23
20: ; preds = %2
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 6
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %14
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @target(i32 %0, i8* %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 5)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @getlen(i8* %1)
%9 = call i32 @reportError(i8* %4, i32 %8)
br label %12
10: ; preds = %2
%11 = add nuw nsw i32 %5, 6
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ -30, %7 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int snprintf(char *, int, char *, char *, char *, char *);
int /*<<< orphan*/ util_md5(char *, int, char *);
void ILibTURN_GenerateIntegrityKey(char *username, char *realm, char *password,
                                   char *integrityKey) {
  char key[128];
  int keyLen = snprintf(key, 128, "%s:%s:%s", username, realm, password);
  util_md5(key, keyLen, integrityKey);
}


x86 assembly (clang, -O0):
<ILibTURN_GenerateIntegrityKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x80,%esi
lea    0xea6(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0xa4(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <util_md5@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibTURN_GenerateIntegrityKey>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rcx,%rbx
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xec3(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <util_md5@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s:%s:%s\00"
define void @ILibTURN_GenerateIntegrityKey(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [128 x i8]
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i32 @snprintf(i8* %11, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i8* %14)
store i32 %15, i32* %10
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%17 = load i32, i32* %10
%18 = load i8*, i8** %8
%19 = call i32 @util_md5(i8* %16, i32 %17, i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s:%s:%s\00"
define void @ILibTURN_GenerateIntegrityKey(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%8 = call i32 @util_md5(i8* %6, i32 %7, i8* %3)
ret void
}
GET_PROMPT_BTS(s, t) int *s;
char *t;
{
  puts((char *)t);
  GET_BTS(s);
}


x86 assembly (clang, -O0):
<GET_PROMPT_BTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <GET_BTS@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_BTS>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <GET_BTS@plt>

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

LLVM IR (-O2):
define i32 @GET_PROMPT_BTS(i32* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @GET_BTS to i32 (i32*, ...)*)(i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SetAudioPos305(unsigned long, unsigned long);
void setaudiopos(unsigned long id, unsigned long pos) {
  SetAudioPos305(id, pos);
}


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

x86 assembly (clang, -O2):
<setaudiopos>:
jmp    1030 <SetAudioPos305@plt>

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

LLVM IR (-O2):
define void @setaudiopos(i64 %0, i64 %1) {
%3 = tail call i32 @SetAudioPos305(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LoadScript(void *);
int /*<<< orphan*/ OnLoadComplete();
int /*<<< orphan*/ data_access_1();
void *thread_routine1(void *aspt) {
  data_access_1();
  LoadScript(aspt);
  data_access_1();
  OnLoadComplete();
  data_access_1();
}


x86 assembly (clang, -O0):
<thread_routine1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <data_access_1@plt>
mov    -0x10(%rbp),%rdi
call   1030 <LoadScript@plt>
mov    $0x0,%al
call   1050 <data_access_1@plt>
mov    $0x0,%al
call   1040 <OnLoadComplete@plt>
mov    $0x0,%al
call   1050 <data_access_1@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_routine1>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <data_access_1@plt>
mov    %rbx,%rdi
call   1030 <LoadScript@plt>
xor    %eax,%eax
call   1050 <data_access_1@plt>
xor    %eax,%eax
call   1040 <OnLoadComplete@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <data_access_1@plt>

LLVM IR (-O0):
define i8* @thread_routine1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @data_access_1()
%5 = load i8*, i8** %3
%6 = call i32 @LoadScript(i8* %5)
%7 = call i32 (...) @data_access_1()
%8 = call i32 (...) @OnLoadComplete()
%9 = call i32 (...) @data_access_1()
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @thread_routine1(i8* %0) {
%2 = tail call i32 (...) @data_access_1()
%3 = tail call i32 @LoadScript(i8* %0)
%4 = tail call i32 (...) @data_access_1()
%5 = tail call i32 (...) @OnLoadComplete()
%6 = tail call i32 (...) @data_access_1()
ret i8* undef
}
/* Variables and functions */
int strlen(const char *src) {
  const char *eos = src;
  while (*eos++)
    ;
  return (eos - src - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = sub nsw i64 %16, 1
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ start_color();
void init_term() {
  initscr();
  noecho();
  curs_set(0);
  start_color();
  init_pair(1, COLOR_WHITE, COLOR_BLACK);
  init_pair(2, COLOR_GREEN, COLOR_BLACK);
}


x86 assembly (clang, -O0):
<init_term>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
mov    $0x0,%al
call   1050 <start_color@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%esi
mov    0x2e68(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
mov    0x2e4c(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_term>:
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %edi,%edi
call   1070 <curs_set@plt>
xor    %eax,%eax
call   1050 <start_color@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
mov    0x2e6b(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%esi
mov    (%rbx),%edx
mov    $0x2,%edi
pop    %rbx
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
define void @init_term() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 @curs_set(i32 0)
%4 = call i32 (...) @start_color()
%5 = load i32, i32* @COLOR_WHITE
%6 = load i32, i32* @COLOR_BLACK
%7 = call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_GREEN
%9 = load i32, i32* @COLOR_BLACK
%10 = call i32 @init_pair(i32 2, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@COLOR_BLACK = global i32 0
@COLOR_GREEN = global i32 0
define void @init_term() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 @curs_set(i32 0)
%4 = tail call i32 (...) @start_color()
%5 = load i32, i32* @COLOR_WHITE
%6 = load i32, i32* @COLOR_BLACK
%7 = tail call i32 @init_pair(i32 1, i32 %5, i32 %6)
%8 = load i32, i32* @COLOR_GREEN
%9 = load i32, i32* @COLOR_BLACK
%10 = tail call i32 @init_pair(i32 2, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int _InterlockedAnd(int volatile *, int);
int test_InterlockedAnd(int volatile *value, int mask) {
  return _InterlockedAnd(value, mask);
}


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

x86 assembly (clang, -O2):
<test_InterlockedAnd>:
jmp    1030 <_InterlockedAnd@plt>

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

LLVM IR (-O2):
define i32 @test_InterlockedAnd(i32* %0, i32 %1) {
%3 = tail call i32 @_InterlockedAnd(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int client(char *, int, char *, char *, char *, char *);
int client1(int argc, char *argv[]) {
  return client("Client1", 1961, "Hello1", "Hello3", "Bonjour1", "Bonjour3");
}


x86 assembly (clang, -O0):
<client1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x7a9,%esi
lea    0xed6(%rip),%rdx
lea    0xed6(%rip),%rcx
lea    0xed6(%rip),%r8
lea    0xed8(%rip),%r9
call   1030 <client@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client1>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rdx
lea    0xeea(%rip),%rcx
lea    0xeea(%rip),%r8
lea    0xeec(%rip),%r9
mov    $0x7a9,%esi
jmp    1030 <client@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Client1\00"
@.str.1 = [7 x i8] c"Hello1\00"
@.str.2 = [7 x i8] c"Hello3\00"
@.str.3 = [9 x i8] c"Bonjour1\00"
@.str.4 = [9 x i8] c"Bonjour3\00"
define i32 @client1(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @client(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1961, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@.str = [8 x i8] c"Client1\00"
@.str.1 = [7 x i8] c"Hello1\00"
@.str.2 = [7 x i8] c"Hello3\00"
@.str.3 = [9 x i8] c"Bonjour1\00"
@.str.4 = [9 x i8] c"Bonjour3\00"
define i32 @client1(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @client(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1961, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char popc();
int /*<<< orphan*/ pushc(char);
void trash(void) {
  static char c;
  while ((c = popc()) == ' ')
    ;
  pushc(c);
  return;
}


x86 assembly (clang, -O0):
<trash>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <trash+0x9>
mov    $0x0,%al
call   1040 <popc@plt>
mov    %al,0x2efb(%rip)
movsbl %al,%eax
cmp    $0x20,%eax
jne    1147 <trash+0x27>
jmp    1129 <trash+0x9>
movsbl 0x2ee3(%rip),%edi
call   1030 <pushc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trash>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <popc@plt>
cmp    $0x20,%al
je     1130 <trash+0x10>
movsbl %al,%edi
pop    %rax
jmp    1030 <pushc@plt>

LLVM IR (-O0):
@trash.c = internal global i8 0
define void @trash() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @popc()
store i8 %2, i8* @trash.c
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 32
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load i8, i8* @trash.c
%8 = call i32 @pushc(i8 signext %7)
ret void
}

LLVM IR (-O2):
define void @trash() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @popc()
%3 = icmp eq i8 %2, 32
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 @pushc(i8 signext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
int pthread_detach(int /*<<< orphan*/);
int throw_event(void *(func)(void *), void *arg) {
  pthread_t _tid;
  int _rc = pthread_create(&_tid, NULL, func, arg);
  return (0 != _rc) ? _rc : pthread_detach(_tid);
}


x86 assembly (clang, -O0):
<throw_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_create@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
je     115e <throw_event+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1169 <throw_event+0x49>
mov    -0x14(%rbp),%edi
call   1030 <pthread_detach@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<throw_event>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1040 <pthread_create@plt>
test   %eax,%eax
je     1139 <throw_event+0x19>
pop    %rcx
ret
mov    0x4(%rsp),%edi
call   1030 <pthread_detach@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @throw_event(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%7 = load i8* (i8*)*, i8* (i8*)** %3
%8 = load i8*, i8** %4
%9 = call i32 @pthread_create(i32* %5, i32* null, i8* (i8*)* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 0, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %6
br label %17
14: ; preds = %2
%15 = load i32, i32* %5
%16 = call i32 @pthread_detach(i32 %15)
br label %17
17: ; preds = %14, %12
%18 = phi i32 [ %13, %12 ], [ %16, %14 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @throw_event(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @pthread_create(i32* %3, i32* null, i8* (i8*)* %0, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @pthread_detach(i32 %8)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ %5, %2 ]
ret i32 %11
}
int deg(int i) { return ((i / 16) + ((i + 16) % 16 * 16)); }


x86 assembly (clang, -O0):
<deg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
shl    $0x4,%edx
add    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg>:
lea    0xf(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x4,%ecx
lea    0x10(%rdi),%eax
lea    0x1f(%rdi),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xffffff0,%edx
neg    %edx
lea    (%rdi,%rdx,1),%eax
add    $0x10,%eax
shl    $0x4,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @deg(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = add nsw i32 %0, 16
%4 = srem i32 %3, 16
%5 = shl nsw i32 %4, 4
%6 = add nsw i32 %5, %2
ret i32 %6
}
int xor (int x, int y) {
  int a = x & y;
  int b = ~x & ~y;
  int z = ~a & ~b;
  return z;
}


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_setr_pd(double, double);
__m128d test_mm_setr_pd(double A, double B) { return _mm_setr_pd(A, B); }


x86 assembly (clang, -O0):
<test_mm_setr_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <_mm_setr_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_setr_pd>:
jmp    1030 <_mm_setr_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_setr_pd(double %0, double %1) {
%3 = tail call i32 @_mm_setr_pd(double %0, double %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
scalar_t__ timer_delete(int /*<<< orphan*/);
void subtimer_cleanup(timer_t timer) {
  if (timer_delete(timer)) {
    error(EXIT_FAILURE, errno, "timer_delete");
  }
}


x86 assembly (clang, -O0):
<subtimer_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <timer_delete@plt>
cmp    $0x0,%rax
je     115b <subtimer_cleanup+0x3b>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtimer_cleanup>:
push   %rax
call   1030 <timer_delete@plt>
test   %rax,%rax
je     114a <subtimer_cleanup+0x2a>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdx
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [13 x i8] c"timer_delete\00"
define void @subtimer_cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @timer_delete(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @errno
%9 = call i32 @error(i32 %7, i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [13 x i8] c"timer_delete\00"
define void @subtimer_cleanup(i32 %0) {
%2 = tail call i64 @timer_delete(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("entre com um numero: ");
  scanf("%d", &x);
  printf("%d", x);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"entre com um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"entre com um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Fetch(int x, char *wt) {
  printf("tmp%s=*src;\n", wt);
  printf(" src++;\n");
}


x86 assembly (clang, -O0):
<Fetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fetch>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"tmp%s=*src;\0A\00"
@.str.1 = [9 x i8] c" src++;\0A\00"
define void @Fetch(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"tmp%s=*src;\0A\00"
@str = [8 x i8] c" src++;\00"
define void @Fetch(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned xrop3_78_0_0(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 ^ T;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_78_0_0>:
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    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_78_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%ecx
xor    %edi,%eax
or     $0xff,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_78_0_0(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 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_78_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = xor i32 %6, %4
%9 = or i32 %8, 255
%10 = xor i32 %9, %7
ret i32 %10
}
int lower(char c) { return (c >= 'A' && c <= 'Z') ? (c + 'a' - 'A') : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%cl
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @lower(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add nsw i32 %2, 32
%6 = select i1 %4, i32 %5, i32 %2
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ config_ensure_directory(char *);
int config_ensure_directory_wrapper(char **av) {
  char *dirname = av[2];
  config_ensure_directory(dirname);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<config_ensure_directory_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <config_ensure_directory@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_ensure_directory_wrapper>:
push   %rax
mov    0x10(%rdi),%rdi
call   1030 <config_ensure_directory@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @config_ensure_directory_wrapper(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @config_ensure_directory(i8* %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @config_ensure_directory_wrapper(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 2
%3 = load i8*, i8** %2
%4 = tail call i32 @config_ensure_directory(i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%.0f\n", (double)11 / 2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double 5.500000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double 5.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ lprintf(int, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void lerror(int log, char *error) {
  lprintf(log, "%s::error: %s", error, strerror(errno));
}


x86 assembly (clang, -O0):
<lerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea5(%rip),%rsi
call   1030 <lprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerror>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lprintf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%s::error: %s\00"
@errno = global i32 0
define void @lerror(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @lprintf(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4)
ret void
}
float sll2f(s)
long long int s;
{ return s; }


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

x86 assembly (clang, -O2):
<sll2f>:
cvtsi2ss %rdi,%xmm0
ret

LLVM IR (-O0):
define float @sll2f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @sll2f(i64 %0) {
%2 = sitofp i64 %0 to float
ret float %2
}
char xml_decode_iso_8859_1(unsigned short c) {
  return (char)(c > 0xff ? '?' : c);
}


x86 assembly (clang, -O0):
<xml_decode_iso_8859_1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0xff,%eax
jle    1127 <xml_decode_iso_8859_1+0x27>
mov    $0x3f,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <xml_decode_iso_8859_1+0x2e>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_decode_iso_8859_1>:
cmp    $0x100,%edi
mov    $0x3f,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @xml_decode_iso_8859_1(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 63, %6 ], [ %9, %7 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @xml_decode_iso_8859_1(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 255
%3 = trunc i16 %0 to i8
%4 = select i1 %2, i8 63, i8 %3
ret i8 %4
}
/* Variables and functions */
int my_getnbr_base(int *, char *, char *, int);
int my_getnbr(int *nb, char *str) {
  return (my_getnbr_base(nb, str, "0123456789", 10));
}


x86 assembly (clang, -O0):
<my_getnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
mov    $0xa,%ecx
call   1030 <my_getnbr_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getnbr>:
lea    0xee9(%rip),%rdx
mov    $0xa,%ecx
jmp    1030 <my_getnbr_base@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define i32 @my_getnbr(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @my_getnbr_base(i32* %5, i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @my_getnbr(i32* %0, i8* %1) {
%3 = tail call i32 @my_getnbr_base(i32* %0, i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t recv_diag_get_page_code_specific(uint8_t *data) { return data[1]; }


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

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

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

LLVM IR (-O2):
define i32 @recv_diag_get_page_code_specific(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int index(const int num) { return (num / 2) - 1; }


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @index(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = add nsw i32 %2, -1
ret i32 %3
}
int test_imm_8Buint8_mem(unsigned char *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Buint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x8b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Buint8_mem>:
testb  $0x8b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Buint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 139
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_8Buint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -117
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}