xunge/DecIR huggingface dataset:
stderr3(s1, s2, s3) char *s1, *s2, *s3;
{
  std_err("cp: ");
  std_err(s1);
  std_err(s2);
  std_err(s3);
}


x86 assembly (clang, -O0):
<stderr3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <std_err@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <std_err@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <std_err@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <std_err@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stderr3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <std_err@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <std_err@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <std_err@plt>
mov    %r14,%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <std_err@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cp: \00"
define i32 @stderr3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %7
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %13)
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"cp: \00"
define i32 @stderr3(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %1)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scand(int *);
int main(void) {
  int N;
  scand(&N);
  printf("%d", N);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scand(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t mul_hi32(uint32_t x, uint32_t y) {
  return (uint32_t)(((uint64_t)x * (uint64_t)y) >> 32);
}


x86 assembly (clang, -O0):
<mul_hi32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %ecx,%eax
mov    $0x20,%ecx
sar    %cl,%eax
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mul_hi32(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 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 32
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @mul_hi32(i64 %0, i64 %1) {
ret i64 poison
}
/* Variables and functions */
unsigned int __sw_hweight8(unsigned int);
unsigned int __arch_hweight8(unsigned int w) { return __sw_hweight8(w); }


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

x86 assembly (clang, -O2):
<__arch_hweight8>:
jmp    1030 <__sw_hweight8@plt>

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

LLVM IR (-O2):
define i32 @__arch_hweight8(i32 %0) {
%2 = tail call i32 @__sw_hweight8(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
void genBlockFilePathName(char *filename, char *pathname) {
  sprintf(pathname, "/usr/RServer/block_data/%s", filename);
}


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

x86 assembly (clang, -O2):
<genBlockFilePathName>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"/usr/RServer/block_data/%s\00"
define void @genBlockFilePathName(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 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"/usr/RServer/block_data/%s\00"
define void @genBlockFilePathName(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float glmDegf(float r) { return r * 57.295779513082320876798154814105f; }


x86 assembly (clang, -O0):
<glmDegf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDegf>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @glmDegf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x404CA5DC20000000
ret float %4
}

LLVM IR (-O2):
define float @glmDegf(float %0) {
%2 = fmul float %0, 0x404CA5DC20000000
ret float %2
}
int get_msb(int x) {
  int shift_val = (sizeof(int) - 1) << 3;
  int xright = x >> shift_val;
  return xright & 0xFF;
}


x86 assembly (clang, -O0):
<get_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msb>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @get_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 24, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = ashr i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_msb(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
void gtk_menu_shell_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_shell_get_type() {
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzBinaryFuncConstR_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
void BrzBinaryFuncConstRPush_ackup(struct comp *comp, int port) {
  struct BrzBinaryFuncConstR_ *c = (struct BrzBinaryFuncConstR_ *)comp;
  SEND_DATAOFF_DELAYED(0, 0);
  SEND_ACKUP(1);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstRPush_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SEND_DATAOFF_DELAYED@plt>
mov    $0x1,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstRPush_ackup>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <SEND_ACKUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzBinaryFuncConstR_ = type { i32 }
define void @BrzBinaryFuncConstRPush_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzBinaryFuncConstR_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzBinaryFuncConstR_*
store %struct.BrzBinaryFuncConstR_* %7, %struct.BrzBinaryFuncConstR_** %5
%8 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
%9 = call i32 @SEND_ACKUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzBinaryFuncConstRPush_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 0)
%4 = tail call i32 @SEND_ACKUP(i32 1)
ret void
}
void PDMR3ThreadIAmSuspending(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ getegid();
gid_t c_getegid_() { return getegid(); }


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

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

LLVM IR (-O0):
define i32 @c_getegid_() {
%1 = call i32 (...) @getegid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_getegid_() {
%1 = tail call i32 (...) @getegid()
ret i32 %1
}
void I210ToARGBRow_SSSE3() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, size_t, int /*<<< orphan*/ *);
ssize_t http_read_to_file(void *user_data, int code, unsigned char *buffer,
                          size_t len) {
  FILE *fp = user_data;
  return fwrite(buffer, 1, len, fp);
}


x86 assembly (clang, -O0):
<http_read_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_read_to_file>:
mov    %rdi,%rax
mov    %rdx,%rdi
mov    $0x1,%esi
mov    %rcx,%rdx
mov    %rax,%rcx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @http_read_to_file(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = call i32 @fwrite(i8* %12, i32 1, i64 %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @http_read_to_file(i8* nocapture %0, i32 %1, i8* nocapture %2, i64 %3) {
%5 = bitcast i8* %0 to i32*
%6 = tail call i32 @fwrite(i8* %2, i32 1, i64 %3, i32* %5)
ret i32 %6
}
void test_function(int a, int b, int c, int d) {
  int flag;
  char buffer[10];
  flag = 31337;
  buffer[0] = 'A';
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x7a69,-0x14(%rbp)
movb   $0x41,-0x1e(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_function(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [10 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 31337, i32* %9
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
store i8 65, i8* %11
ret void
}

LLVM IR (-O2):
define void @test_function(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test1() {
  int var = 0;
  if (var > 0)
    printf(">0\n");
  else
    printf("<=0\n");
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113a <test1+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <test1+0x36>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"<=0\00"
define void @test1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_append(struct genlist *, union fc_sockaddr *);
void fc_sockaddr_list_append(struct fc_sockaddr_list *tthis,
                             union fc_sockaddr *pfoo) {
  genlist_append((struct genlist *)tthis, pfoo);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_append>:
jmp    1030 <genlist_append@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_append(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca %union.fc_sockaddr*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store %union.fc_sockaddr* %1, %union.fc_sockaddr** %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load %union.fc_sockaddr*, %union.fc_sockaddr** %4
%8 = call i32 @genlist_append(%struct.genlist* %6, %union.fc_sockaddr* %7)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_append(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_append(%struct.genlist* %3, %union.fc_sockaddr* %1)
ret void
}
void main(void) {
  unsigned char *P8 = (unsigned char *)0x03f0;
  unsigned char *PD8 = (unsigned char *)0x03f2;
  unsigned char *PUR2 = (unsigned char *)0x03fe;
  unsigned char *P7 = (unsigned char *)0x03ed;
  unsigned char *PD7 = (unsigned char *)0x03ef;
  *PD8 = 0x00;
  *PUR2 = 0x01;
  *P7 = 0xff;
  *PD7 = 0xff;
  while (1) {
    *P7 = (0x03 & (*P8)) << 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f0,%eax
mov    %rax,-0x8(%rbp)
mov    $0x3f2,%eax
mov    %rax,-0x10(%rbp)
mov    $0x3fe,%eax
mov    %rax,-0x18(%rbp)
mov    $0x3ed,%eax
mov    %rax,-0x20(%rbp)
mov    $0x3ef,%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x28(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x3,%eax
mov    %eax,-0x30(%rbp)
shl    $0x4,%eax
mov    %eax,-0x2c(%rbp)
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    114d <main+0x4d>

x86 assembly (clang, -O2):
<main>:
movb   $0x0,0x3f2
movb   $0x1,0x3fe
01
movb   $0xff,0x3ed
ff
movb   $0xff,0x3ef
ff
movzbl 0x3f0,%eax
shl    $0x4,%al
and    $0x30,%al
mov    %al,0x3ed
jmp    1120 <main+0x20>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* inttoptr (i64 1008 to i8*), i8** %1
store i8* inttoptr (i64 1010 to i8*), i8** %2
store i8* inttoptr (i64 1022 to i8*), i8** %3
store i8* inttoptr (i64 1005 to i8*), i8** %4
store i8* inttoptr (i64 1007 to i8*), i8** %5
%6 = load i8*, i8** %2
store i8 0, i8* %6
%7 = load i8*, i8** %3
store i8 1, i8* %7
%8 = load i8*, i8** %4
store i8 -1, i8* %8
%9 = load i8*, i8** %5
store i8 -1, i8* %9
br label %10
10: ; preds = %0, %10
%11 = load i8*, i8** %1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 3, %13
%15 = shl i32 %14, 4
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
store i8 %16, i8* %17
br label %10
}

LLVM IR (-O2):
define void @main() {
store i8 0, i8* inttoptr (i64 1010 to i8*)
store i8 1, i8* inttoptr (i64 1022 to i8*)
store i8 -1, i8* inttoptr (i64 1005 to i8*)
store i8 -1, i8* inttoptr (i64 1007 to i8*)
br label %1
1: ; preds = %1, %0
%2 = load i8, i8* inttoptr (i64 1008 to i8*)
%3 = shl i8 %2, 4
%4 = and i8 %3, 48
store i8 %4, i8* inttoptr (i64 1005 to i8*)
br label %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x_root;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_x_root(void *_p, int _v) {
  ((XEvent *)_p)->xmotion.x_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmotion_x_root>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xmotion_x_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void f() {
  void g();
  g();
}


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

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

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

LLVM IR (-O2):
define void @f() {
tail call void (...) @g()
ret void
}
/* Variables and functions */
int bar1();
int main() { return bar1(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int x, y, z, sum;
  printf("Enter three integers: ");
  scanf("%o %o %o", &x, &y, &z);
  sum = x + y + z;
  printf("sum =  %d\n", sum);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Enter three integers: \00"
@.str.1 = [9 x i8] c"%o %o %o\00"
@.str.2 = [11 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter three integers: \00"
@.str.1 = [9 x i8] c"%o %o %o\00"
@.str.2 = [11 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ClearSaveSlot(int);
int /*<<< orphan*/ CopySaveSlot(int, int);
void SV_UpdateRebornSlot(void) {
  ClearSaveSlot(7);
  CopySaveSlot(6, 7);
}


x86 assembly (clang, -O0):
<SV_UpdateRebornSlot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1040 <ClearSaveSlot@plt>
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <CopySaveSlot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_UpdateRebornSlot>:
push   %rax
mov    $0x7,%edi
call   1040 <ClearSaveSlot@plt>
mov    $0x6,%edi
mov    $0x7,%esi
pop    %rax
jmp    1030 <CopySaveSlot@plt>

LLVM IR (-O0):
define void @SV_UpdateRebornSlot() {
%1 = call i32 @ClearSaveSlot(i32 7)
%2 = call i32 @CopySaveSlot(i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @SV_UpdateRebornSlot() {
%1 = tail call i32 @ClearSaveSlot(i32 7)
%2 = tail call i32 @CopySaveSlot(i32 6, i32 7)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef scalar_t__ B;

/* Variables and functions */
uint64_t integerify(void *B, size_t r) {
  uint32_t *X = (uint32_t *)((uintptr_t)(B) + (2 * r - 1) * 64);
  return (((uint64_t)(X[1]) << 32) + X[0]);
}


x86 assembly (clang, -O0):
<integerify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
sub    $0x1,%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @integerify(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i64, i64* %4
%9 = mul i64 2, %8
%10 = sub i64 %9, 1
%11 = mul i64 %10, 64
%12 = add i64 %7, %11
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = shl i32 %16, 32
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = add nsw i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @integerify(i8* nocapture readnone %0, i64 %1) {
ret i32 poison
}
void test_idt() {
  asm volatile("mov $4, %eax; int $0x80");
  asm volatile("int $0x90");
}


x86 assembly (clang, -O0):
<test_idt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%eax
int    $0x80
int    $0x90
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_idt>:
mov    $0x4,%eax
int    $0x80
int    $0x90
ret

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

LLVM IR (-O2):
define void @test_idt() {
tail call void asm sideeffect "mov $$4, %eax; int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x90", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
upper_case(str) char *str;
{
  int i;
  for (i = 0; str[i] != '\0'; i++)
    str[i] = toupper(str[i]);
}


x86 assembly (clang, -O0):
<upper_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <upper_case+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <upper_case+0x13>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper_case>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <upper_case+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <upper_case+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @upper_case(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %26, %1
%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 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %29
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 @toupper(i32 %19)
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
br label %26
26: ; preds = %13
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @upper_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %6 to i32
%9 = tail call i32 @toupper(i32 %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ updatesprite();
void basUpdateSprite() { pushNumber(updatesprite()); }


x86 assembly (clang, -O0):
<basUpdateSprite>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <updatesprite@plt>
mov    %eax,%edi
call   1030 <pushNumber@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @basUpdateSprite() {
%1 = call i32 (...) @updatesprite()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basUpdateSprite() {
%1 = tail call i32 (...) @updatesprite()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t s) {
  void *result = malloc(s);
  if (NULL == result) {
    fprintf(stderr, "Can't allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1178 <emalloc+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Can't allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Can't allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int get_nearest_le_multiple(int value, int factor) {
  return factor * (value / factor);
}


x86 assembly (clang, -O0):
<get_nearest_le_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nearest_le_multiple>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_nearest_le_multiple(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub i32 %0, %3
ret i32 %4
}
float obdConvert_0E(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A / 2.0f - 64.0f;
}


x86 assembly (clang, -O0):
<obdConvert_0E>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xee4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_0E>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mulss  0xef1(%rip),%xmm0
addss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_0E(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = fdiv float %10, 2.000000e+00
%12 = fsub float %11, 6.400000e+01
ret float %12
}

LLVM IR (-O2):
define float @obdConvert_0E(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = fmul float %5, 5.000000e-01
%7 = fadd float %6, -6.400000e+01
ret float %7
}
/* Type definitions */
typedef int uint16_t;
struct p4_digest_field {
  int dummy;
};

/* Variables and functions */
struct p4_digest_field *unpack_p4_digest_field(char *buffer, uint16_t offset) {
  return (struct p4_digest_field *)(buffer + offset);
}


x86 assembly (clang, -O0):
<unpack_p4_digest_field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_p4_digest_field>:
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.p4_digest_field = type { i32 }
define %struct.p4_digest_field* @unpack_p4_digest_field(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_digest_field*
ret %struct.p4_digest_field* %5
}
/* Variables and functions */
double randomRealUniform01();
int randomInt(int maximum) {
  int result;
  result = (int)(((double)maximum) * randomRealUniform01());
  return (result);
}


x86 assembly (clang, -O0):
<randomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <randomRealUniform01@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomInt>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <randomRealUniform01@plt>
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randomInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double (...) @randomRealUniform01()
%7 = fmul double %5, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @randomInt(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @randomRealUniform01()
%4 = fmul double %3, %2
%5 = fptosi double %4 to i32
ret i32 %5
}
int get_nondet_int() {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @get_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_nondet_int() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void hex8(int v) {
  char hextab[] = "0123456789abcdef";
  printf("%c%c ", hextab[v >> 4], hextab[v & 0xf]);
}


x86 assembly (clang, -O0):
<hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x4(%rbp),%eax
and    $0xf,%eax
cltq
lea    0xebc(%rip),%rdi
movsbl %cl,%esi
movsbl -0x20(%rbp,%rax,1),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex8>:
mov    %edi,%eax
sar    $0x4,%eax
cltq
lea    0xee2(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
and    $0xf,%edi
movsbl (%rdi,%rcx,1),%edx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.hex8.hextab = [17 x i8] c"0123456789abcdef\00"
@.str = [6 x i8] c"%c%c \00"
define void @hex8(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 %0, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = ashr i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i32, i32* %2
%11 = and i32 %10, 15
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %14)
ret void
}

LLVM IR (-O2):
@__const.hex8.hextab = [17 x i8] c"0123456789abcdef\00"
@.str = [6 x i8] c"%c%c \00"
define void @hex8(i32 %0) {
%2 = ashr i32 %0, 4
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.hex8.hextab, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = and i32 %0, 15
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.hex8.hextab, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ global_term();
void nanoev_term() { global_term(); }


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

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

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

LLVM IR (-O2):
define void @nanoev_term() {
%1 = tail call i32 (...) @global_term()
ret void
}
/* Variables and functions */
int INT_MAX;
int main(void) { INT_MAX << 2; }


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

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

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = shl i32 %1, 2
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
ret i32 0
}
void set_int_ref(int *i, int *j) { i = j; }


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

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

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

LLVM IR (-O2):
define void @set_int_ref(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int /*<<< orphan*/ system(char *);
int main() {
  unsigned int count;
  for (count = 0; count < 256; count++) {
    printf("%u\t%c\n", count, count);
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jae    1163 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <main+0x10>
lea    0xeb9(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%u\09%c\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 256
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%u\09%c\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_EDint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xed,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_EDint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 237
%7 = icmp ne i64 %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_EDint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15532032
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int nro;
  printf("Digite um numero: ");
  scanf("%d", &nro);
  printf("O fatorial do num %d e: %d", nro, fatorial(nro));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fatorial@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@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    0xee1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <fatorial@plt>
lea    0xead(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"O fatorial do num %d e: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 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* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @fatorial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite um numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"O fatorial do num %d e: %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 ([19 x i8], [19 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 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t H(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @H(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @H(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ shout(char *, char const *);
int /*<<< orphan*/ show_version();
void show_usage(const char *prog) {
  show_version();
  shout("Usage: %s -s server -u user -p pass [-q]\n", prog);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <show_version@plt>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <shout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <show_version@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <shout@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: %s -s server -u user -p pass [-q]\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @show_version()
%4 = load i8*, i8** %2
%5 = call i32 @shout(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Usage: %s -s server -u user -p pass [-q]\0A\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 (...) @show_version()
%3 = tail call i32 @shout(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}