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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
void initAnalogPort() {
  char command[100] = "echo cape-bone-iio > /sys/devices/bone_capemgr.8/slots";
  FILE *TestConsole = popen(command, "w");
  fclose(TestConsole);
}


x86 assembly (clang, -O0):
<initAnalogPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xf09(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initAnalogPort>:
sub    $0x68,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xeea(%rip),%rsi
mov    %rsp,%rdi
call   1040 <popen@plt>
mov    %rax,%rdi
add    $0x68,%rsp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@__const.initAnalogPort.command = [100 x i8] c"echo cape-bone-iio > /sys/devices/bone_capemgr.8/slots\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"w\00"
define void @initAnalogPort() {
%1 = alloca [100 x i8]
%2 = alloca i32*
%3 = bitcast [100 x i8]* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32* @popen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
@__const.initAnalogPort.command = [100 x i8] c"echo cape-bone-iio > /sys/devices/bone_capemgr.8/slots\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"w\00"
define void @initAnalogPort() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32* @popen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
size_t AES_BLOCK_SIZE;
size_t FwdLockGlue_GetEncryptedKeyLength(size_t plaintextKeyLength) {
  return ((plaintextKeyLength / AES_BLOCK_SIZE) + 2) * AES_BLOCK_SIZE;
}


x86 assembly (clang, -O0):
<FwdLockGlue_GetEncryptedKeyLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed5(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
add    $0x2,%rax
mov    0x2ec5(%rip),%rcx
imul   (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FwdLockGlue_GetEncryptedKeyLength>:
mov    %rdi,%rax
mov    0x2ede(%rip),%rcx
mov    (%rcx),%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1120 <FwdLockGlue_GetEncryptedKeyLength+0x20>
xor    %edx,%edx
div    %rcx
jmp    1124 <FwdLockGlue_GetEncryptedKeyLength+0x24>
xor    %edx,%edx
div    %ecx
add    $0x2,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
@AES_BLOCK_SIZE = global i64 0
define i64 @FwdLockGlue_GetEncryptedKeyLength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @AES_BLOCK_SIZE
%5 = udiv i64 %3, %4
%6 = add i64 %5, 2
%7 = load i64, i64* @AES_BLOCK_SIZE
%8 = mul i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
@AES_BLOCK_SIZE = global i64 0
define i64 @FwdLockGlue_GetEncryptedKeyLength(i64 %0) {
%2 = load i64, i64* @AES_BLOCK_SIZE
%3 = udiv i64 %0, %2
%4 = add i64 %3, 2
%5 = mul i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ Moto_A(char);
int /*<<< orphan*/ Moto_B(char);
void Moto_AB(char SA, char SB) {
  Moto_A(SA);
  Moto_B(SB);
}


x86 assembly (clang, -O0):
<Moto_AB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <Moto_A@plt>
movsbl -0x2(%rbp),%edi
call   1040 <Moto_B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Moto_AB>:
push   %rbx
mov    %esi,%ebx
call   1030 <Moto_A@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <Moto_B@plt>

LLVM IR (-O0):
define void @Moto_AB(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @Moto_A(i8 signext %5)
%7 = load i8, i8* %4
%8 = call i32 @Moto_B(i8 signext %7)
ret void
}

LLVM IR (-O2):
define void @Moto_AB(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @Moto_A(i8 signext %0)
%4 = tail call i32 @Moto_B(i8 signext %1)
ret void
}
int xmin(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<xmin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <xmin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <xmin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xmin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @xmin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int emktemp(name)
char *name;
{
  static char x = 'a';
  char *p = name;
  while (*p != '?')
    ++p;
  *p = x++;
  return mkstemp(name);
}


x86 assembly (clang, -O0):
<emktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     1145 <emktemp+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <emktemp+0x14>
mov    0x2edd(%rip),%cl
mov    %cl,%al
add    $0x1,%al
mov    %al,0x2ed3(%rip)
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <mkstemp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emktemp>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x3f,(%rax)
lea    0x1(%rax),%rax
jne    1120 <emktemp+0x10>
mov    0x2ef9(%rip),%cl
lea    0x1(%rcx),%edx
mov    %dl,0x2ef0(%rip)
mov    %cl,-0x1(%rax)
xor    %eax,%eax
jmp    1030 <mkstemp@plt>

LLVM IR (-O0):
@emktemp.x = internal global i8 97
define i32 @emktemp(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 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 63
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8, i8* @emktemp.x
%15 = add i8 %14, 1
store i8 %15, i8* @emktemp.x
%16 = load i8*, i8** %3
store i8 %14, i8* %16
%17 = load i8*, i8** %2
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @mkstemp to i32 (i8*, ...)*)(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
@emktemp.x = internal unnamed_addr global i8 97
define i32 @emktemp(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 63
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = load i8, i8* @emktemp.x
%9 = add i8 %8, 1
store i8 %9, i8* @emktemp.x
store i8 %8, i8* %3
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mkstemp to i32 (i8*, ...)*)(i8* %0)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f, "Usage: %s [OPTIONS] PATH [ARGV...]\n", applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s [OPTIONS] PATH [ARGV...]\0A\00"
define void @usage(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 i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s [OPTIONS] PATH [ARGV...]\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int vg(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @vg() {
ret i32 1
}

LLVM IR (-O2):
define i32 @vg() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ lua_dblibopen();
int /*<<< orphan*/ lua_iolibopen();
int /*<<< orphan*/ lua_mathlibopen();
int /*<<< orphan*/ lua_strlibopen();
void lua_userinit(void) {
  lua_iolibopen();
  lua_strlibopen();
  lua_mathlibopen();
  lua_dblibopen();
}


x86 assembly (clang, -O0):
<lua_userinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lua_iolibopen@plt>
mov    $0x0,%al
call   1030 <lua_strlibopen@plt>
mov    $0x0,%al
call   1060 <lua_mathlibopen@plt>
mov    $0x0,%al
call   1040 <lua_dblibopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_userinit>:
push   %rax
xor    %eax,%eax
call   1050 <lua_iolibopen@plt>
xor    %eax,%eax
call   1030 <lua_strlibopen@plt>
xor    %eax,%eax
call   1060 <lua_mathlibopen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lua_dblibopen@plt>

LLVM IR (-O0):
define void @lua_userinit() {
%1 = call i32 (...) @lua_iolibopen()
%2 = call i32 (...) @lua_strlibopen()
%3 = call i32 (...) @lua_mathlibopen()
%4 = call i32 (...) @lua_dblibopen()
ret void
}

LLVM IR (-O2):
define void @lua_userinit() {
%1 = tail call i32 (...) @lua_iolibopen()
%2 = tail call i32 (...) @lua_strlibopen()
%3 = tail call i32 (...) @lua_mathlibopen()
%4 = tail call i32 (...) @lua_dblibopen()
ret void
}
void modbus_t35_expired(void) {}


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

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

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

LLVM IR (-O2):
define void @modbus_t35_expired() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_exit(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *obj = realloc(ptr, size);
  if (!obj)
    msg_exit("out of memory");
  return obj;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <msg_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <msg_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @msg_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ offset;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, char *, int);
long retrieveOffset(char *item, int itemSize) {
  unsigned offset;
  memcpy(&offset, item + itemSize - sizeof(offset), sizeof(offset));
  return offset;
}


x86 assembly (clang, -O0):
<retrieveOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrieveOffset>:
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @retrieveOffset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -4
%11 = call i32 @memcpy(i32* %5, i8* %10, i32 4)
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @retrieveOffset(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -4
%8 = call i32 @memcpy(i32* %3, i8* %7, i32 4)
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
ret i64 %10
}
int sched_get_priority_max(int policy) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sched_get_priority_max(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 1025;
  char c = x;
  printf("O valor (inteiro) de c é %d\n", (int)c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x401,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"O valor (inteiro) de c \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 1025, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"O valor (inteiro) de c \C3\A9 %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
float M_PI;
float deg2rad(float deg) { return deg * M_PI / 180.0; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @deg2rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+02
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @deg2rad(float %0) {
%2 = load float, float* @M_PI
%3 = fmul float %2, %0
%4 = fdiv float %3, 1.800000e+02
ret float %4
}
char *allones_allones_OK() {
  static char *const base = (char *)-1;
  static const unsigned long offset = -1;
  return base + offset;
}


x86 assembly (clang, -O0):
<allones_allones_OK>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allones_allones_OK>:
mov    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
@allones_allones_OK.base = internal constant i8* inttoptr (i64 -1 to i8*)
@allones_allones_OK.offset = internal constant i64 -1
define i8* @allones_allones_OK() {
ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 -1 to i8*), i64 -1)
}

LLVM IR (-O2):
define i8* @allones_allones_OK() {
ret i8* inttoptr (i64 -2 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse(int);
int main(int argc, char *argv[]) {
  printf("%d\n", reverse(-123));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffff85,%edi
call   1030 <reverse@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @reverse(i32 -123)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(int /*<<< orphan*/, void **);
int syscall_pthread_join(pthread_t thread, void **value_ptr) {
  return pthread_join(thread, value_ptr);
}


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

x86 assembly (clang, -O2):
<syscall_pthread_join>:
jmp    1030 <pthread_join@plt>

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

LLVM IR (-O2):
define i32 @syscall_pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
ret i32 %3
}
void mailsasl_unref(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int getc_ext(FILE *fh) { return feof(fh) ? 0 : getc(fh); }


x86 assembly (clang, -O0):
<getc_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     1149 <getc_ext+0x29>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <getc_ext+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_ext>:
push   %rbx
mov    %rdi,%rbx
call   1030 <feof@plt>
test   %rax,%rax
je     1132 <getc_ext+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <getc@plt>

LLVM IR (-O0):
define i32 @getc_ext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @feof(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i32 @getc(i32* %8)
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 0, %6 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @getc_ext(i32* nocapture %0) {
%2 = tail call i64 @feof(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @getc(i32* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
int tamAI(unsigned int nbloques) {
  int tam_in = (nbloques / 4) * 64;
  if ((tam_in % 1024) == 0) {
    tam_in = tam_in / 1024;
  } else {
    tam_in = tam_in / 1024;
    tam_in++;
  }
  return (tam_in);
}


x86 assembly (clang, -O0):
<tamAI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
shl    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113a <tamAI+0x3a>
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1151 <tamAI+0x51>
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tamAI>:
mov    %edi,%ecx
shl    $0x4,%ecx
and    $0xffffffc0,%ecx
and    $0x3c,%edi
lea    0x3ff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0xa,%eax
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tamAI(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 4
%6 = mul i32 %5, 64
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = srem i32 %7, 1024
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 1024
store i32 %12, i32* %3
br label %18
13: ; preds = %1
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 1024
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @tamAI(i32 %0) {
%2 = shl i32 %0, 4
%3 = and i32 %2, -64
%4 = and i32 %0, 60
%5 = icmp ne i32 %4, 0
%6 = sdiv i32 %3, 1024
%7 = zext i1 %5 to i32
%8 = add nsw i32 %6, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ copy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *fst = fopen("./fst.txt", "r");
  FILE *snd = fopen("./snd.txt", "w");
  copy(fst, snd);
  fclose(fst);
  fclose(snd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xeaf(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <copy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
lea    0xebb(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <copy@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"./fst.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"./snd.txt\00"
@.str.3 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = call i32 @copy(i32* %6, i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"./fst.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"./snd.txt\00"
@.str.3 = [2 x i8] c"w\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @copy(i32* %1, i32* %2)
%4 = tail call i32 @fclose(i32* %1)
%5 = tail call i32 @fclose(i32* %2)
ret i32 0
}
void time_remove(unsigned int id) {}


x86 assembly (clang, -O0):
<time_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @time_remove(i32 %0) {
ret void
}
int cmp_intR(const void *a, const void *b) { return (*(int *)b) - (*(int *)a); }


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

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

LLVM IR (-O0):
define i32 @cmp_intR(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_intR(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
char kputnumeral(int numeral, int base) {
  if (base == 16 && numeral > 9) {
    return 'A' + numeral - 10;
  }
  return '0' + numeral;
}


x86 assembly (clang, -O0):
<kputnumeral>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jne    112f <kputnumeral+0x2f>
cmpl   $0x9,-0x8(%rbp)
jle    112f <kputnumeral+0x2f>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1138 <kputnumeral+0x38>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputnumeral>:
cmp    $0x10,%esi
mov    $0x37,%eax
mov    $0x30,%ecx
cmovne %ecx,%eax
cmp    $0xa,%edi
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @kputnumeral(i32 %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 16
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 9
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 65, %12
%14 = sub nsw i32 %13, 10
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %20
16: ; preds = %8, %2
%17 = load i32, i32* %4
%18 = add nsw i32 48, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
br label %20
20: ; preds = %16, %11
%21 = load i8, i8* %3
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @kputnumeral(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 16
%4 = icmp sgt i32 %0, 9
%5 = and i1 %4, %3
%6 = trunc i32 %0 to i8
%7 = select i1 %5, i8 55, i8 48
%8 = add i8 %7, %6
ret i8 %8
}
int hashfunct(str, hash_size)
char str[];
int hash_size;
{
  int hashval;
  int locstr;
  hashval = 0;
  locstr = 0;
  while (str[locstr]) {
    hashval = (hashval << 1) + (unsigned char)str[locstr++];
    hashval %= hash_size;
  }
  return hashval;
}


x86 assembly (clang, -O0):
<hashfunct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <hashfunct+0x5d>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1119 <hashfunct+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfunct>:
mov    (%rdi),%al
test   %al,%al
je     1127 <hashfunct+0x27>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %al,%eax
lea    (%rax,%rdx,2),%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashfunct+0x10>
mov    %edx,%eax
ret
xor    %edx,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashfunct(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %15, %5 ], [ %3, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = shl i32 %8, 1
%10 = add nuw nsw i64 %6, 1
%11 = zext i8 %7 to i32
%12 = add nsw i32 %9, %11
%13 = srem i32 %12, %1
%14 = getelementptr inbounds i8, i8* %0, i64 %10
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %18
}
void ScaleAddRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleAddRow_Any_AVX2() {
ret void
}
/* Variables and functions */
double gsw_pt_from_ct(double, double);
double gsw_pt_from_t(double, double, double, double);
double gsw_t_from_ct(double sa, double ct, double p) {
  double pt0, p0;
  p0 = 0e0;
  pt0 = gsw_pt_from_ct(sa, ct);
  return (gsw_pt_from_t(sa, pt0, p0, p));
}


x86 assembly (clang, -O0):
<gsw_t_from_ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <gsw_pt_from_ct@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
call   1040 <gsw_pt_from_t@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_t_from_ct>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <gsw_pt_from_ct@plt>
movaps %xmm0,%xmm1
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm3
add    $0x18,%rsp
jmp    1040 <gsw_pt_from_t@plt>

LLVM IR (-O0):
define double @gsw_t_from_ct(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %8
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call double @gsw_pt_from_ct(double %9, double %10)
store double %11, double* %7
%12 = load double, double* %4
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %6
%16 = call double @gsw_pt_from_t(double %12, double %13, double %14, double %15)
ret double %16
}

LLVM IR (-O2):
define double @gsw_t_from_ct(double %0, double %1, double %2) {
%4 = tail call double @gsw_pt_from_ct(double %0, double %1)
%5 = tail call double @gsw_pt_from_t(double %0, double %4, double 0.000000e+00, double %2)
ret double %5
}
int substr(const char *s, const char *sub) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @substr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void test18_TestImporExport_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test18_TestImporExport_targetInit__I() {
ret void
}
unsigned int hash_pjw(char *name) {
  unsigned int val = 0, i;
  for (; *name; ++name) {
    val = (val << 2) + *name;
    if (i = val & ~0x3fff)
      val = (val ^ (i >> 12)) & 0x3fff;
  }
  return val;
}


x86 assembly (clang, -O0):
<hash_pjw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <hash_pjw+0x6b>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffc000,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1155 <hash_pjw+0x55>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
and    $0x3fff,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <hash_pjw+0x5a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash_pjw+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_pjw>:
mov    (%rdi),%cl
test   %cl,%cl
je     113b <hash_pjw+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,4),%ecx
mov    %ecx,%edx
and    $0xffffc000,%edx
mov    %edx,%eax
shr    $0xc,%eax
xor    %ecx,%eax
and    $0x3fff,%eax
test   %edx,%edx
cmove  %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_pjw+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_pjw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i8* [ %17, %4 ], [ %0, %1 ]
%7 = phi i32 [ %16, %4 ], [ 0, %1 ]
%8 = shl i32 %7, 2
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = and i32 %10, -16384
%12 = icmp eq i32 %11, 0
%13 = lshr exact i32 %11, 12
%14 = xor i32 %13, %10
%15 = and i32 %14, 16383
%16 = select i1 %12, i32 %10, i32 %15
%17 = getelementptr inbounds i8, i8* %6, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4, %1
%21 = phi i32 [ 0, %1 ], [ %16, %4 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int local0;
  local0 = argc;
  if (argc < -2) {
    local0 = -2;
  }
  if (local0 > 3) {
    local0 = 3;
  }
  printf("MinMax adjusted number of arguments is %d\n", local0);
  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    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jge    1141 <main+0x31>
movl   $0xfffffffe,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jle    1152 <main+0x42>
movl   $0x3,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0xffffffff,%edi
mov    $0xfffffffe,%eax
cmovge %edi,%eax
cmp    $0x3,%eax
mov    $0x3,%esi
cmovl  %eax,%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"MinMax adjusted number of arguments is %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i32, i32* %5
store i32 %9, i32* %8
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, -2
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -2, i32* %8
br label %13
13: ; preds = %12, %3
%14 = load i32, i32* %8
%15 = icmp sgt i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %8
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"MinMax adjusted number of arguments is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, -2
%5 = select i1 %4, i32 %0, i32 -2
%6 = icmp slt i32 %5, 3
%7 = select i1 %6, i32 %5, i32 3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void SIO1writeCtrl32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1writeCtrl32(i64 %0) {
ret void
}
void gdk_rectangle_intersect() {}


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

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

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

LLVM IR (-O2):
define void @gdk_rectangle_intersect() {
ret void
}
__attribute__((always_)) int fih_delay(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @fih_delay() {
ret i32 1
}

LLVM IR (-O2):
define i32 @fih_delay() {
ret i32 1
}
/* Variables and functions */
double pow(double, double);
double convert_it_1(double x) { return pow(x, 10.0 / 3.0); }


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

x86 assembly (clang, -O2):
<convert_it_1>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x400AAAAAAAAAAAAB)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_1(double %0) {
%2 = tail call double @pow(double %0, double 0x400AAAAAAAAAAAAB)
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned short green;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
void set_XColor_green(void *_p, unsigned short _v) {
  ((XColor *)_p)->green = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XColor_green>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XColor_green>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XColor_green(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = 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 i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XColor_green(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmapcall(int);
int main(void) {
  mmapcall(300000);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mmapcall(i32 300000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mmapcall(i32 300000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", sizeof 'A');
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void wait() {
  int c = 0xf0000;
  while (c-- > 0)
    ;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0xf0000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1124 <wait+0x24>
jmp    110b <wait+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @wait() {
%1 = alloca i32
store i32 983040, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @wait() {
ret void
}
int NAME(char *A, char *B) {
  char a = *A;
  char b = *B;
  if (a > 96)
    a -= 32;
  if (b > 96)
    b -= 32;
  return (a == b);
}


x86 assembly (clang, -O0):
<NAME>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x60,%eax
jle    1135 <NAME+0x35>
movsbl -0x11(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x11(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x60,%eax
jle    114c <NAME+0x4c>
movsbl -0x12(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NAME>:
movzbl (%rdi),%eax
movzbl (%rsi),%ecx
lea    -0x20(%rax),%edx
cmp    $0x61,%al
movzbl %dl,%edx
cmovl  %eax,%edx
lea    -0x20(%rcx),%eax
cmp    $0x61,%cl
movzbl %al,%esi
cmovl  %ecx,%esi
xor    %eax,%eax
cmp    %sil,%dl
sete   %al
ret

LLVM IR (-O0):
define i32 @NAME(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 96
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 32
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
br label %19
19: ; preds = %14, %2
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = icmp sgt i32 %21, 96
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %6
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 32
%27 = trunc i32 %26 to i8
store i8 %27, i8* %6
br label %28
28: ; preds = %23, %19
%29 = load i8, i8* %5
%30 = sext i8 %29 to i32
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %30, %32
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @NAME(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, 96
%6 = add i8 %3, -32
%7 = select i1 %5, i8 %6, i8 %3
%8 = icmp sgt i8 %4, 96
%9 = add i8 %4, -32
%10 = select i1 %8, i8 %9, i8 %4
%11 = icmp eq i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}