xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memo(char *);
int /*<<< orphan*/ update_vis();
void plyr_ev_birth(void) {
  memo("Welcome to the world of iiag, you pathetic Guaren.");
  update_vis();
}


x86 assembly (clang, -O0):
<plyr_ev_birth>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <memo@plt>
mov    $0x0,%al
call   1040 <update_vis@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plyr_ev_birth>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <memo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_vis@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Welcome to the world of iiag, you pathetic Guaren.\00"
define void @plyr_ev_birth() {
%1 = call i32 @memo(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @update_vis()
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Welcome to the world of iiag, you pathetic Guaren.\00"
define void @plyr_ev_birth() {
%1 = tail call i32 @memo(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @update_vis()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmCallback(int);
void IERmCallback(int callbackid) { rmCallback(callbackid); }


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

x86 assembly (clang, -O2):
<IERmCallback>:
jmp    1030 <rmCallback@plt>

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

LLVM IR (-O2):
define void @IERmCallback(i32 %0) {
%2 = tail call i32 @rmCallback(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test13();
int main(int argc, char **argv) {
  if (!test13())
    abort();
  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    $0x0,%al
call   1040 <test13@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test13@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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 (...) @test13()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test13()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
void SetStateAlternateUnattached(void) {}


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

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

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

LLVM IR (-O2):
define void @SetStateAlternateUnattached() {
ret void
}
unsigned long undump32(const unsigned char *c) {
  return (unsigned long)c[3] + (((unsigned long)c[2]) << 8) +
         (((unsigned long)c[1]) << 16) + (((unsigned long)c[0]) << 24);
}


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

x86 assembly (clang, -O2):
<undump32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @undump32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 8
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 16
%14 = or i64 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int sck_sendf(int, char *, char const *, char const *, char const *);
int irc_reg(int s, const char *nick, const char *username,
            const char *fullname) {
  return sck_sendf(s, "NICK %s\r\nUSER %s localhost 0 :%s\r\n", nick, username,
                   fullname);
}


x86 assembly (clang, -O0):
<irc_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec3(%rip),%rsi
call   1030 <sck_sendf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_reg>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee0(%rip),%rsi
jmp    1030 <sck_sendf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"NICK %s\0D\0AUSER %s localhost 0 :%s\0D\0A\00"
define i32 @irc_reg(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @sck_sendf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [35 x i8] c"NICK %s\0D\0AUSER %s localhost 0 :%s\0D\0A\00"
define i32 @irc_reg(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sck_sendf(i32 %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int japi_mouselistener(int, int);
int j_mouselistener(int arg0, int arg1) {
  return (japi_mouselistener(arg0, arg1));
}


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

x86 assembly (clang, -O2):
<j_mouselistener>:
jmp    1030 <japi_mouselistener@plt>

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

LLVM IR (-O2):
define i32 @j_mouselistener(i32 %0, i32 %1) {
%3 = tail call i32 @japi_mouselistener(i32 %0, i32 %1)
ret i32 %3
}
int okn_tsm_rot_z2(struct okn_tsm *t, float z) { return 1; }


x86 assembly (clang, -O0):
<okn_tsm_rot_z2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_z2(%struct.okn_tsm* %0, float %1) {
%3 = alloca %struct.okn_tsm*
%4 = alloca float
store %struct.okn_tsm* %0, %struct.okn_tsm** %3
store float %1, float* %4
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_z2(%struct.okn_tsm* nocapture readnone %0, float %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Primeiro programa.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Primeiro programa.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void bs_lock(void) {}


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

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

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

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

/* Variables and functions */
int myabs(int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
main() {
  int x;
  uint32_t n;
  n = myabs(x = 0x80000002);
  printf("d=%d (%x), %d (%x)\n", x, x, n, n);
  n = myabs(x = 0x10000002);
  printf("d=%d (%x), %d (%x)\n", x, x, n, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x80000002,-0x4(%rbp)
mov    $0x80000002,%edi
call   1040 <myabs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x10000002,-0x4(%rbp)
mov    $0x10000002,%edi
call   1040 <myabs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80000002,%edi
call   1040 <myabs@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80000002,%esi
mov    $0x80000002,%edx
mov    %eax,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0x10000002,%edi
call   1040 <myabs@plt>
mov    %rbx,%rdi
mov    $0x10000002,%esi
mov    $0x10000002,%edx
mov    %eax,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"d=%d (%x), %d (%x)\0A\00"
define i32 @main() {
%1 = tail call i32 @myabs(i32 -2147483646)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 -2147483646, i32 -2147483646, i32 %1, i32 %1)
%3 = tail call i32 @myabs(i32 268435458)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 268435458, i32 268435458, i32 %3, i32 %3)
ret i32 0
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_29(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x0B, 0x15, 0x1C, 0x0C, 0x06, 0x0A, 0x1D, 0x16, 0x12, 0x0E, 0x04,
      0x11, 0x1F, 0x0F, 0x07, 0x02, 0x17, 0x13, 0x19, 0x18, 0x0D, 0x10,
      0x1A, 0x05, 0x03, 0x00, 0x01, 0x08, 0x09, 0x14, 0x1B, 0x1E,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_29>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_29>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_29.LUT = internal global [32 x i8] c"\0B\15\1C\0C\06\0A\1D\16\12\0E\04\11\1F\0F\07\02\17\13\19\18\0D\10\1A\05\03\00\01\08\09\14\1B\1E"
define i32 @yahoo_f01_29(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_29.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_29.LUT = internal global [32 x i8] c"\0B\15\1C\0C\06\0A\1D\16\12\0E\04\11\1F\0F\07\02\17\13\19\18\0D\10\1A\05\03\00\01\08\09\14\1B\1E"
define i32 @yahoo_f01_29(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_29.LUT, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
unsigned long ULONG_MAX;
unsigned long nextpow2(unsigned long X) {
  unsigned long C = 1;
  while ((C < ULONG_MAX) && (C < X))
    C <<= 1;
  return C;
}


x86 assembly (clang, -O0):
<nextpow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    0x2ebb(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
jae    1137 <nextpow2+0x37>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <nextpow2+0x47>
jmp    1158 <nextpow2+0x58>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <nextpow2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextpow2>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rcx
mov    $0x1,%edx
nop
mov    %rdx,%rax
cmp    %rdi,%rdx
jae    1121 <nextpow2+0x21>
lea    (%rax,%rax,1),%rdx
cmp    %rcx,%rax
jb     1110 <nextpow2+0x10>
ret

LLVM IR (-O0):
@ULONG_MAX = global i64 0
define i64 @nextpow2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %14, %1
%5 = load i64, i64* %3
%6 = load i64, i64* @ULONG_MAX
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* %3
%10 = load i64, i64* %2
%11 = icmp ult i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load i64, i64* %3
%16 = shl i64 %15, 1
store i64 %16, i64* %3
br label %4
17: ; preds = %12
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
@ULONG_MAX = global i64 0
define i64 @nextpow2(i64 %0) {
%2 = load i64, i64* @ULONG_MAX
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ 1, %1 ], [ %8, %3 ]
%5 = icmp ult i64 %4, %2
%6 = icmp ult i64 %4, %0
%7 = and i1 %6, %5
%8 = shl i64 %4, 1
br i1 %7, label %3, label %9
9: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int trio_vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf(char *buffer, size_t bufferSize, const char *format,
              va_list args) {
  return trio_vsnprintf(buffer, bufferSize, format, args);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <trio_vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
jmp    1030 <trio_vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @trio_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a[] = {1, 2};
  printf("%d\n", maxProfit(a, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1040 <maxProfit@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x200000001,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1040 <maxProfit@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 8589934593, i64* %3
%5 = bitcast i64* %3 to i32*
%6 = call i32 @maxProfit(i32* %5, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int test_imm_74uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x74 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_74uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 116
%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_74uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7602176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MagSensorHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void MagSensorLogging() { UAVObjLogging(MagSensorHandle()); }


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

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

LLVM IR (-O0):
define void @MagSensorLogging() {
%1 = call i32 (...) @MagSensorHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MagSensorLogging() {
%1 = tail call i32 (...) @MagSensorHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void caller_1_2_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_2_1_1_2() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xkeymap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkeymap_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xkeymap.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xkeymap_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_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 i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkeymap_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_Stack_basics();
void test_Stack(void) { test_Stack_basics(); }


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

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

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

LLVM IR (-O2):
define void @test_Stack() {
%1 = tail call i32 (...) @test_Stack_basics()
ret void
}
int x(void) {
  int a, b;
  b = 1;
  a = b;
  b = 2;
  return a;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @x() {
ret i32 1
}
__attribute__((always_)) unsigned short inw(int port) {
  unsigned short value;
  asm volatile("in"
               "w"
               " %w1, %"
               "w"
               "0"
               : "=a"(value)
               : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void h(uint8_t *x) {
  uint8_t y[8];
  x[0] = y[0];
}


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

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

LLVM IR (-O0):
define void @h(i32* %0) {
%2 = alloca i32*
%3 = alloca [8 x i32]
store i32* %0, i32** %2
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @h(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: msgs [fhlopq] [[-]number]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: msgs [fhlopq] [[-]number]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: msgs [fhlopq] [[-]number]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void simple_local() {
  int gx[100];
  int *hx = gx;
  int ix;
  __builtin_prefetch(gx, 0, 0);
  __builtin_prefetch(hx, 0, 0);
  __builtin_prefetch(&ix, 0, 0);
}


x86 assembly (clang, -O0):
<simple_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x190(%rbp),%rax
mov    %rax,-0x198(%rbp)
lea    -0x190(%rbp),%rax
prefetchnta (%rax)
mov    -0x198(%rbp),%rax
prefetchnta (%rax)
lea    -0x19c(%rbp),%rax
prefetchnta (%rax)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_local>:
sub    $0x128,%rsp
prefetchnta -0x70(%rsp)
prefetchnta -0x70(%rsp)
prefetchnta -0x74(%rsp)
add    $0x128,%rsp
ret

LLVM IR (-O0):
define void @simple_local() {
%1 = alloca [100 x i32]
%2 = alloca i32*
%3 = alloca i32
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%6 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %2
%8 = bitcast i32* %7 to i8*
%9 = bitcast i32* %3 to i8*
ret void
}

LLVM IR (-O2):
define void @simple_local() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = bitcast [100 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ panic(char *, int /*<<< orphan*/ *);
int putchar(int);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
int fputc(int ch, FILE *stream) {
  if (stream != stderr && stream != stdout) {
    panic("putc stream = %p", stream);
  } else {
    return putchar(ch);
  }
  return -1;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     116c <fputc+0x4c>
mov    -0x10(%rbp),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
je     116c <fputc+0x4c>
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <panic@plt>
jmp    117c <fputc+0x5c>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1183 <fputc+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    0x2eb8(%rip),%rax
cmp    %rsi,(%rax)
je     114c <fputc+0x2c>
mov    0x2ea4(%rip),%rax
cmp    %rsi,(%rax)
je     114c <fputc+0x2c>
lea    0xec0(%rip),%rdi
call   1040 <panic@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@stderr = global i32* null
@stdout = global i32* null
@.str = [17 x i8] c"putc stream = %p\00"
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i32*, i32** @stderr
%8 = icmp ne i32* %6, %7
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = load i32*, i32** @stdout
%12 = icmp ne i32* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = call i32 @panic(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %19
16: ; preds = %9, %2
%17 = load i32, i32* %4
%18 = call i32 @putchar(i32 %17)
store i32 %18, i32* %3
br label %20
19: ; preds = %13
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32* null
@stdout = global i32* null
@.str = [17 x i8] c"putc stream = %p\00"
define i32 @fputc(i32 %0, i32* %1) {
%3 = load i32*, i32** @stderr
%4 = icmp eq i32* %3, %1
%5 = load i32*, i32** @stdout
%6 = icmp eq i32* %5, %1
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @panic(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %12
10: ; preds = %2
%11 = tail call i32 @putchar(i32 %0)
br label %12
12: ; preds = %8, %10
%13 = phi i32 [ -1, %8 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
double pow(double, int);
double(libclut_model_linear_to_standard1)(double c) {
  return (((double)(c) <= 0.0031308)
              ? (12.92 * (double)(c))
              : ((1.055) * pow((double)(c), 1 / 2.4) - 0.055));
}


x86 assembly (clang, -O0):
<libclut_model_linear_to_standard1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1147 <libclut_model_linear_to_standard1+0x37>
movsd  0xee0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1170 <libclut_model_linear_to_standard1+0x60>
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libclut_model_linear_to_standard1>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1138 <libclut_model_linear_to_standard1+0x28>
xor    %edi,%edi
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
pop    %rax
ret
mulsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @libclut_model_linear_to_standard1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 3.130800e-03
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double 1.292000e+01, %6
br label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @pow(double %9, i32 0)
%11 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %10, double -5.500000e-02)
br label %12
12: ; preds = %8, %5
%13 = phi double [ %7, %5 ], [ %11, %8 ]
ret double %13
}

LLVM IR (-O2):
define double @libclut_model_linear_to_standard1(double %0) {
%2 = fcmp ugt double %0, 3.130800e-03
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul double %0, 1.292000e+01
br label %8
5: ; preds = %1
%6 = tail call double @pow(double %0, i32 0)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
void gart_iommu_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @gart_iommu_shutdown() {
ret void
}
void main(void) {
  int x = 25;
  do {
  } while (1);
  *((volatile int *)5) = x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x19,-0x4(%rbp)
jmp    1110 <main+0x10>
mov    $0x1,%al
test   $0x1,%al
jne    110b <main+0xb>
jmp    111f <main+0x1f>
mov    -0x4(%rbp),%ecx
mov    $0x5,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 25, i32* %1
br label %2
2: ; preds = %3, %0
br label %3
3: ; preds = %2
br i1 true, label %2, label %4
4: ; preds = %3
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 5 to i32*)
ret void
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void GP_break00(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @GP_break00() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echochar(int);
int getch();
int toascii(int);
int readChars(void) {
  int ch;
  int forever = 1;
  while (forever) {
    ch = getch();
    if (ch == 'q')
      break;
    int ich = toascii(ch);
    echochar(ich);
  }
}


x86 assembly (clang, -O0):
<readChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117a <readChars+0x4a>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x71,-0x8(%rbp)
jne    1162 <readChars+0x32>
jmp    117a <readChars+0x4a>
mov    -0x8(%rbp),%edi
call   1040 <toascii@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <echochar@plt>
jmp    113f <readChars+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChars>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0x71,%eax
je     1148 <readChars+0x28>
and    $0x7f,%eax
mov    %eax,%edi
call   1040 <echochar@plt>
jmp    1130 <readChars+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readChars() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %3
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = call i32 (...) @getch()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 113
br i1 %11, label %12, label %13
12: ; preds = %8
br label %18
13: ; preds = %8
%14 = load i32, i32* %2
%15 = call i32 @toascii(i32 %14)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = call i32 @echochar(i32 %16)
br label %5
18: ; preds = %12, %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @readChars() {
%1 = tail call i32 (...) @getch()
%2 = icmp eq i32 %1, 113
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ %1, %0 ]
%5 = and i32 %4, 127
%6 = tail call i32 @echochar(i32 %5)
%7 = tail call i32 (...) @getch()
%8 = icmp eq i32 %7, 113
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret i32 undef
}
int nextNumberMultipleOf5(int num) {
  int rem = num % 5;
  return num + (5 - rem);
}


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

x86 assembly (clang, -O2):
<nextNumberMultipleOf5>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
add    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @nextNumberMultipleOf5(i32 %0) {
%2 = srem i32 %0, 5
%3 = add i32 %0, 5
%4 = sub i32 %3, %2
ret i32 %4
}
void CgDrv_Delete(struct CgDrv *cgdrv) {}


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

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

LLVM IR (-O0):
%struct.CgDrv = type opaque
define void @CgDrv_Delete(%struct.CgDrv* %0) {
%2 = alloca %struct.CgDrv*
store %struct.CgDrv* %0, %struct.CgDrv** %2
ret void
}

LLVM IR (-O2):
%struct.CgDrv = type opaque
define void @CgDrv_Delete(%struct.CgDrv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fu_Fnread(int /*<<< orphan*/ *, size_t);
size_t fu_Fsize(int /*<<< orphan*/ *);
char *fu_Fread(FILE *stream) {
  size_t fsize = fu_Fsize(stream);
  return fu_Fnread(stream, fsize);
}


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

x86 assembly (clang, -O2):
<fu_Fread>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fu_Fsize@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <fu_Fnread@plt>

LLVM IR (-O0):
define i8* @fu_Fread(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @fu_Fsize(i32* %4)
store i64 %5, i64* %3
%6 = load i32*, i32** %2
%7 = load i64, i64* %3
%8 = call i8* @fu_Fnread(i32* %6, i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @fu_Fread(i32* %0) {
%2 = tail call i64 @fu_Fsize(i32* %0)
%3 = tail call i8* @fu_Fnread(i32* %0, i64 %2)
ret i8* %3
}
/* Variables and functions */
int tor_memcmp(char const *, char const *, int);
int compare_digests_(const void **_a, const void **_b) {
  return tor_memcmp((const char *)*_a, (const char *)*_b, 20);
}


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

x86 assembly (clang, -O2):
<compare_digests_>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x14,%edx
jmp    1030 <tor_memcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_digests_(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @tor_memcmp(i8* %3, i8* %4, i32 20)
ret i32 %5
}
/* Variables and functions */
int ctest_main(int, char const **);
int main(int argc, const char *argv[]) { return ctest_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ctest_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ctest_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ctest_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ctest_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
void *malloc(int);
int malloc_usable_size(void *);
int /*<<< orphan*/ printf(char *, int);
main() {
  void *p;
  p = malloc(1);
  printf("\n number of usable allocated bytes associated with allocated chunk "
         ": %d \n",
         malloc_usable_size(p));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc_usable_size@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [74 x i8] c"\0A number of usable allocated bytes associated with allocated chunk : %d \0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @malloc_usable_size(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"\0A number of usable allocated bytes associated with allocated chunk : %d \0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @malloc_usable_size(i8* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_dont_status(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 3, "%c%c%c", 255, 254, 5);
  telopt_debug(ses, "SENT IAC DONT STATUS");
  return 3;
}


x86 assembly (clang, -O0):
<send_dont_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfe,%r8d
mov    $0x5,%r9d
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_dont_status>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0xff,%ecx
mov    $0xfe,%r8d
mov    $0x5,%r9d
call   1040 <socket_printf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [21 x i8] c"SENT IAC DONT STATUS\00"
define i32 @send_dont_status(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 254, i32 5)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [21 x i8] c"SENT IAC DONT STATUS\00"
define i32 @send_dont_status(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 254, i32 5)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ set_status(char *);
void clear_status() { set_status(""); }


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

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @clear_status() {
%1 = tail call i32 @set_status(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int();
int test_fun(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  return test_fun(__VERIFIER_nondet_int(), __VERIFIER_nondet_int());
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <test_fun@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @test_fun(i32 %1, i32 %2)
ret i32 %3
}
/* Variables and functions */
double drand48();
void randv(double *v, size_t n, double s) {
  size_t i;
  for (i = 0; i < n; i++)
    v[i] = drand48() * s;
}


x86 assembly (clang, -O0):
<randv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1165 <randv+0x55>
mov    $0x0,%al
call   1030 <drand48@plt>
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112d <randv+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randv>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %rsi,%rsi
je     1150 <randv+0x40>
movapd %xmm0,%xmm1
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <drand48@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randv+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @randv(double* %0, i64 %1, double %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca double
%7 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
store double %2, double* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = call double (...) @drand48()
%14 = load double, double* %6
%15 = fmul double %13, %14
%16 = load double*, double** %4
%17 = load i64, i64* %7
%18 = getelementptr inbounds double, double* %16, i64 %17
store double %15, double* %18
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @randv(double* nocapture writeonly %0, i64 %1, double %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = tail call double (...) @drand48()
%8 = fmul double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 %6
store double %8, double* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}