xunge/DecIR huggingface dataset:
void g_object_newv() {}


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

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

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

LLVM IR (-O2):
define void @g_object_newv() {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ arc4random_addrandom(unsigned char *, int);
void evutil_secure_rng_add_bytes(const char *buf, size_t n) {
  arc4random_addrandom((unsigned char *)buf,
                       n > (size_t)INT_MAX ? INT_MAX : (int)n);
}


x86 assembly (clang, -O0):
<evutil_secure_rng_add_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
jbe    1150 <evutil_secure_rng_add_bytes+0x40>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <evutil_secure_rng_add_bytes+0x47>
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <arc4random_addrandom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evutil_secure_rng_add_bytes>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
cmp    %rsi,%rax
cmovb  %eax,%esi
jmp    1030 <arc4random_addrandom@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @evutil_secure_rng_add_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @INT_MAX
%8 = sext i32 %7 to i64
%9 = icmp ugt i64 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @INT_MAX
br label %15
12: ; preds = %2
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
br label %15
15: ; preds = %12, %10
%16 = phi i32 [ %11, %10 ], [ %14, %12 ]
%17 = call i32 @arc4random_addrandom(i8* %5, i32 %16)
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @evutil_secure_rng_add_bytes(i8* %0, i64 %1) {
%3 = load i32, i32* @INT_MAX
%4 = sext i32 %3 to i64
%5 = icmp ult i64 %4, %1
%6 = trunc i64 %1 to i32
%7 = select i1 %5, i32 %3, i32 %6
%8 = tail call i32 @arc4random_addrandom(i8* %0, i32 %7)
ret void
}
/* Variables and functions */
size_t objc_ext_sizeof_type(char const *);
size_t objc_sizeof_type(const char *type) { return objc_ext_sizeof_type(type); }


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

x86 assembly (clang, -O2):
<objc_sizeof_type>:
jmp    1030 <objc_ext_sizeof_type@plt>

LLVM IR (-O0):
define i64 @objc_sizeof_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @objc_ext_sizeof_type(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @objc_sizeof_type(i8* %0) {
%2 = tail call i64 @objc_ext_sizeof_type(i8* %0)
ret i64 %2
}
void reset_noop(struct BitstreamRecorderEntry *self) { return; }


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

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

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

LLVM IR (-O2):
%struct.BitstreamRecorderEntry = type opaque
define void @reset_noop(%struct.BitstreamRecorderEntry* nocapture %0) {
ret void
}
void outsw(short port, void *buf, int size) {
  __asm__("rep outsw" ::"S"(buf), "d"(port), "c"(size >> 1));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x2(%rbp),%dx
mov    -0x14(%rbp),%ecx
sar    $0x1,%ecx
rep outsw %ds:(%rsi),(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %edx,%ecx
sar    %ecx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i16 signext %0, i8* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i16, i16* %4
%9 = load i32, i32* %6
%10 = ashr i32 %9, 1
ret void
}

LLVM IR (-O2):
define void @outsw(i16 signext %0, i8* %1, i32 %2) {
%4 = ashr i32 %2, 1
tail call void asm sideeffect "rep outsw", "{si},{dx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %1, i16 %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
void glcResolution(GLfloat res) {}


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

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

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

LLVM IR (-O2):
define void @glcResolution(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, unsigned char);
void SensorSetMirrorFlip_HV7131GP(unsigned char val) {
  unsigned char x;
  val = ~val;
  VIM_SIF_I2cReadByte(0x01, &x);
  VIM_SIF_I2cWriteByte(0x01, (unsigned char)((x & 0xf3) | ((val & 0x03) << 2)));
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_HV7131GP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0xf3,%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    $0x1,%edi
movzbl %al,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_HV7131GP>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0xf(%rsp),%al
and    $0xf3,%al
shl    $0x2,%bl
and    $0xc,%bl
or     %al,%bl
xor    $0xc,%bl
movzbl %bl,%esi
mov    $0x1,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_HV7131GP(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %3)
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = and i32 %10, 243
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 3
%15 = shl i32 %14, 2
%16 = or i32 %11, %15
%17 = trunc i32 %16 to i8
%18 = call i32 @VIM_SIF_I2cWriteByte(i32 1, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
define void @SensorSetMirrorFlip_HV7131GP(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 1, i8* %2)
%4 = load i8, i8* %2
%5 = and i8 %4, -13
%6 = shl i8 %0, 2
%7 = and i8 %6, 12
%8 = or i8 %5, %7
%9 = xor i8 %8, 12
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 1, i8 zeroext %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve(int, int /*<<< orphan*/, int *);
int main(void) {
  int hist[8];
  solve(8, 0, hist);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdx
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdx
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%4 = call i32 @solve(i32 8, i32 0, i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @solve(i32 8, i32 0, i32* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *getMozLibPath() {
  unsigned long pathSize = 256;
  const char *path = "/usr/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64/:/"
                     "usr/lib/x86_64-linux/:     /usr/lib64/:/usr/lib32/";
  char *mozDir = (char *)malloc(strlen(path) + 1);
  if (mozDir) {
    strcpy(mozDir, path);
  }
  return mozDir;
}


x86 assembly (clang, -O0):
<getMozLibPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x100,-0x8(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <getMozLibPath+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMozLibPath>:
push   %rbx
mov    $0x6a,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <getMozLibPath+0x22>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"/usr/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64/:/usr/lib/x86_64-linux/: /usr/lib64/:/usr/lib32/\00"
define i8* @getMozLibPath() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i8*
store i64 256, i64* %1
store i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %0
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [106 x i8] c"/usr/lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/x86_64/:/usr/lib/x86_64-linux/: /usr/lib64/:/usr/lib32/\00"
define i8* @getMozLibPath() {
%1 = tail call i64 @malloc(i64 106)
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ml_sin(scalar_t__);
int16_t ml_cos(uint16_t x) { return ml_sin(x + 90); }


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

x86 assembly (clang, -O2):
<ml_cos>:
add    $0x5a,%rdi
jmp    1030 <ml_sin@plt>

LLVM IR (-O0):
define i32 @ml_cos(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 90
%5 = call i32 @ml_sin(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ml_cos(i64 %0) {
%2 = add nsw i64 %0, 90
%3 = tail call i32 @ml_sin(i64 %2)
ret i32 %3
}
int ezThreeFourths(int x) {
  int tmin = 0x80 << 24;
  int mask = tmin | 0x3;
  int mult3 = x + x + x;
  int init_z = mult3 >> 2;
  int add1 = !!((mult3 & mask) ^ tmin);
  int z = init_z + add1;
  return z;
}


x86 assembly (clang, -O0):
<ezThreeFourths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezThreeFourths>:
lea    (%rdi,%rdi,2),%ecx
mov    %ecx,%edx
sar    $0x2,%edx
and    $0x80000003,%ecx
xor    %eax,%eax
cmp    $0x80000000,%ecx
setne  %al
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ezThreeFourths(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
%9 = load i32, i32* %3
%10 = or i32 %9, 3
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = ashr i32 %16, 2
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = and i32 %18, %19
%21 = load i32, i32* %3
%22 = xor i32 %20, %21
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
store i32 %26, i32* %7
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = add nsw i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @ezThreeFourths(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = ashr i32 %2, 2
%4 = and i32 %2, -2147483645
%5 = icmp ne i32 %4, -2147483648
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
ret i32 %7
}
int produce_item() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @produce_item() {
ret i32 1
}
/* Type definitions */
struct s_idsp {
  int dummy;
};

/* Variables and functions */
scalar_t__ idspGetPos(struct s_idsp *, int const);
int idspIsValid(struct s_idsp *idsp, const int id) {
  return (!(idspGetPos(idsp, id) < 0));
}


x86 assembly (clang, -O0):
<idspIsValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <idspGetPos@plt>
cmp    $0x0,%rax
setl   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idspIsValid>:
push   %rax
call   1030 <idspGetPos@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s_idsp = type { i32 }
define i32 @idspIsValid(%struct.s_idsp* %0, i32 %1) {
%3 = alloca %struct.s_idsp*
%4 = alloca i32
store %struct.s_idsp* %0, %struct.s_idsp** %3
store i32 %1, i32* %4
%5 = load %struct.s_idsp*, %struct.s_idsp** %3
%6 = load i32, i32* %4
%7 = call i64 @idspGetPos(%struct.s_idsp* %5, i32 %6)
%8 = icmp slt i64 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.s_idsp = type { i32 }
define i32 @idspIsValid(%struct.s_idsp* %0, i32 %1) {
%3 = tail call i64 @idspGetPos(%struct.s_idsp* %0, i32 %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
int test_imm_F6uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xF6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 246
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t sky_timestamp_unshift(int64_t value) {
  int64_t usec = value & 0xFFFFF;
  int64_t sec = value >> 20;
  return (sec * 1000000) + usec;
}


x86 assembly (clang, -O0):
<sky_timestamp_unshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
mov    %eax,-0xc(%rbp)
imul   $0xf4240,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sky_timestamp_unshift>:
mov    %edi,%ecx
and    $0xfffff,%ecx
sar    $0x14,%edi
imul   $0xf4240,%edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sky_timestamp_unshift(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 1048575
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 20
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 1000000
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @sky_timestamp_unshift(i32 %0) {
%2 = and i32 %0, 1048575
%3 = ashr i32 %0, 20
%4 = mul nsw i32 %3, 1000000
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TOR_ISPRINT(char const);
int tor_strisprint(const char *s) {
  while (*s) {
    if (!TOR_ISPRINT(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<tor_strisprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <tor_strisprint+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <TOR_ISPRINT@plt>
cmp    $0x0,%eax
jne    114a <tor_strisprint+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <tor_strisprint+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <tor_strisprint+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_strisprint>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <tor_strisprint+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <TOR_ISPRINT@plt>
test   %eax,%eax
je     1149 <tor_strisprint+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <tor_strisprint+0x20>
jmp    114b <tor_strisprint+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @tor_strisprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @TOR_ISPRINT(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
typedef scalar_t__ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int /*<<< orphan*/, scalar_t__);
void writeb_idx_reg(u_int16_t port, u_int8_t index, u_int8_t val) {
  outb(index, port - 1);
  outb(val, port);
}


x86 assembly (clang, -O0):
<writeb_idx_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
sub    $0x1,%rsi
call   1030 <outb@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb_idx_reg>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%eax
mov    %rdi,%rbx
lea    -0x1(%rdi),%rsi
mov    %eax,%edi
call   1030 <outb@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @writeb_idx_reg(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i64, i64* %4
%9 = sub nsw i64 %8, 1
%10 = call i32 @outb(i32 %7, i64 %9)
%11 = load i32, i32* %6
%12 = load i64, i64* %4
%13 = call i32 @outb(i32 %11, i64 %12)
ret void
}

LLVM IR (-O2):
define void @writeb_idx_reg(i64 %0, i32 %1, i32 %2) {
%4 = add nsw i64 %0, -1
%5 = tail call i32 @outb(i32 %1, i64 %4)
%6 = tail call i32 @outb(i32 %2, i64 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *jt_Fopen(const char *filename, const char *mode) {
  return fopen(filename, mode);
}


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

x86 assembly (clang, -O2):
<jt_Fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @jt_Fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ array_go_at(size_t, size_t, void *, size_t const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, void *, size_t);
void array_write_at(size_t dim, size_t v_size, void *array, void *data,
                    const size_t index[dim]) {
  memcpy(array_go_at(dim, v_size, array, index), data, v_size);
}


x86 assembly (clang, -O0):
<array_write_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <array_go_at@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_write_at>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %r8,%rcx
call   1030 <array_go_at@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @array_write_at(i64 %0, i64 %1, i8* %2, i8* %3, i64* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64* %4, i64** %10
%11 = load i64, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i8*, i8** %8
%15 = load i64*, i64** %10
%16 = call i32 @array_go_at(i64 %12, i64 %13, i8* %14, i64* %15)
%17 = load i8*, i8** %9
%18 = load i64, i64* %7
%19 = call i32 @memcpy(i32 %16, i8* %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @array_write_at(i64 %0, i64 %1, i8* %2, i8* %3, i64* %4) {
%6 = tail call i32 @array_go_at(i64 %0, i64 %1, i8* %2, i64* %4)
%7 = tail call i32 @memcpy(i32 %6, i8* %3, i64 %1)
ret void
}
void __ipipe_report_exit(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_report_exit(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void vider_buffer() {
  int buf;
  do {
    buf = getchar();
  } while (buf != EOF && buf != '\n');
}


x86 assembly (clang, -O0):
<vider_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2eba(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1143 <vider_buffer+0x33>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <vider_buffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vider_buffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <vider_buffer+0x20>
cmp    (%rbx),%eax
jne    1120 <vider_buffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @vider_buffer() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 10
br label %11
11: ; preds = %8, %4
%12 = phi i1 [ false, %4 ], [ %10, %8 ]
br i1 %12, label %2, label %13
13: ; preds = %11
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @vider_buffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSSL(const char *the_title) { return any_decrqss(the_title, "p"); }


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

x86 assembly (clang, -O2):
<rpt_DECSSL>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"p\00"
define i32 @rpt_DECSSL(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int utf8ReadForward(char const *, int);
int utf8GetCharacter(const char *s) {
  int tmp = 0;
  return utf8ReadForward(s, tmp);
}


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

x86 assembly (clang, -O2):
<utf8GetCharacter>:
xor    %esi,%esi
jmp    1030 <utf8ReadForward@plt>

LLVM IR (-O0):
define i32 @utf8GetCharacter(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* %3
%6 = call i32 @utf8ReadForward(i8* %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @utf8GetCharacter(i8* %0) {
%2 = tail call i32 @utf8ReadForward(i8* %0, i32 0)
ret i32 %2
}
int main(void) {
  char *x = "bob";
  *(x + 3) = "\n";
  printf("%s", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed6(%rip),%rcx
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"bob\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int openfile(const char *filename) {
  int fd;
  fd = open(filename, O_RDWR);
  return fd;
}


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

x86 assembly (clang, -O2):
<openfile>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @openfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @openfile(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int stdio_seek(int64_t offset, int whence, void *file) {
  FILE *fp = file;
  return fseek(fp, offset, whence);
}


x86 assembly (clang, -O0):
<stdio_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdio_seek>:
mov    %rdx,%rax
mov    %esi,%edx
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <fseek@plt>

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

LLVM IR (-O2):
define i32 @stdio_seek(i32 %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fseek(i32* %4, i32 %0, i32 %1)
ret i32 %5
}
long long proc2() { return 0x12345678LL; }


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

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

LLVM IR (-O0):
define i64 @proc2() {
ret i64 305419896
}

LLVM IR (-O2):
define i64 @proc2() {
ret i64 305419896
}
void X509_NAME_cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_cmp() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World !");
  return EXIT_SUCCESS;
}


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>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World !\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_task(double *, double *);
void parm_decl_no_warn(double *parm1, double *parm2) { my_task(parm1, parm2); }


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

x86 assembly (clang, -O2):
<parm_decl_no_warn>:
jmp    1030 <my_task@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void join_threads(pthread_t *threads, int length) {
  for (int i = 0; i < length; i++) {
    pthread_join(*(threads + i), NULL);
  }
}


x86 assembly (clang, -O0):
<join_threads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <join_threads+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_join@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <join_threads+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_threads>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <join_threads+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <join_threads+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @join_threads(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @pthread_join(i32 %10, i32* null)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int lan2_send_break(void *rsp) { return (-8); }


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

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

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

LLVM IR (-O2):
define i32 @lan2_send_break(i8* nocapture readnone %0) {
ret i32 -8
}
int main(void) { return 1 / 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
long main() { printf("%d\n", add(5, 39)); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x27,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i64 @main() {
%1 = tail call i32 @add(i32 5, i32 39)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i64 undef
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int tm_yday;
  int tm_year;
};

/* Variables and functions */
scalar_t__ mktime(struct tm *);
scalar_t__ time(int /*<<< orphan*/ *);
time_t sb_get_timestamp(void) {
  struct tm time_2000 = {
      .tm_yday = 1,
      .tm_year = 100,
  };
  time_t seconds_to_2000 = mktime(&time_2000);
  time_t seconds_to_now = time(NULL);
  return seconds_to_now - seconds_to_2000;
}


x86 assembly (clang, -O0):
<sb_get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <mktime@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_get_timestamp>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6400000001,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <mktime@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1030 <time@plt>
sub    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@__const.sb_get_timestamp.time_2000 = %struct.tm { i32 1, i32 100 }
define i64 @sb_get_timestamp() {
%1 = alloca %struct.tm
%2 = alloca i64
%3 = alloca i64
%4 = bitcast %struct.tm* %1 to i8*
%5 = call i64 @mktime(%struct.tm* %1)
store i64 %5, i64* %2
%6 = call i64 @time(i32* null)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = sub nsw i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define i64 @sb_get_timestamp() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.tm*
%3 = bitcast i64* %1 to i8*
store i64 429496729601, i64* %1
%4 = call i64 @mktime(%struct.tm* %2)
%5 = tail call i64 @time(i32* null)
%6 = sub nsw i64 %5, %4
ret i64 %6
}
main() {
  char x[(1, 2)];
  return sizeof(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @llvm.stacksave()
store i8* %3, i8** %2
%4 = alloca i8, i64 2
store i32 2, i32* %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ c_escape_tests();
int /*<<< orphan*/ case_convert_tests();
int /*<<< orphan*/ char_class_tests();
int /*<<< orphan*/ elide_tests();
int /*<<< orphan*/ quote_tests();
int /*<<< orphan*/ transform_tests();
int /*<<< orphan*/ uint8_convert_tests();
int /*<<< orphan*/ url_encode_tests();
int main(int argc, char *argv[]) {
  c_escape_tests();
  case_convert_tests();
  char_class_tests();
  elide_tests();
  quote_tests();
  transform_tests();
  uint8_convert_tests();
  url_encode_tests();
  return EXIT_SUCCESS;
}


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 <c_escape_tests@plt>
mov    $0x0,%al
call   1070 <case_convert_tests@plt>
mov    $0x0,%al
call   1060 <char_class_tests@plt>
mov    $0x0,%al
call   1080 <elide_tests@plt>
mov    $0x0,%al
call   10a0 <quote_tests@plt>
mov    $0x0,%al
call   1050 <transform_tests@plt>
mov    $0x0,%al
call   1090 <uint8_convert_tests@plt>
mov    $0x0,%al
call   1030 <url_encode_tests@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <c_escape_tests@plt>
xor    %eax,%eax
call   1070 <case_convert_tests@plt>
xor    %eax,%eax
call   1060 <char_class_tests@plt>
xor    %eax,%eax
call   1080 <elide_tests@plt>
xor    %eax,%eax
call   10a0 <quote_tests@plt>
xor    %eax,%eax
call   1050 <transform_tests@plt>
xor    %eax,%eax
call   1090 <uint8_convert_tests@plt>
xor    %eax,%eax
call   1030 <url_encode_tests@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @c_escape_tests()
%7 = call i32 (...) @case_convert_tests()
%8 = call i32 (...) @char_class_tests()
%9 = call i32 (...) @elide_tests()
%10 = call i32 (...) @quote_tests()
%11 = call i32 (...) @transform_tests()
%12 = call i32 (...) @uint8_convert_tests()
%13 = call i32 (...) @url_encode_tests()
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @c_escape_tests()
%4 = tail call i32 (...) @case_convert_tests()
%5 = tail call i32 (...) @char_class_tests()
%6 = tail call i32 (...) @elide_tests()
%7 = tail call i32 (...) @quote_tests()
%8 = tail call i32 (...) @transform_tests()
%9 = tail call i32 (...) @uint8_convert_tests()
%10 = tail call i32 (...) @url_encode_tests()
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
int test_imm_F2uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xF2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F2uint64_highword_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, 32
%6 = and i64 %5, 242
%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_F2uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1039382085632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  1 + 2;
  printf("%d\n", 1 < 2 ? 5 : 8);
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @blankVFSMstart(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
int(__attribute__((const)) x)(a, b) int a;
int b;
{ return a + b; }


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

x86 assembly (clang, -O2):
<x>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @x(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @x(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
double test_fabs(double x) { return __builtin_fabs(x); }


x86 assembly (clang, -O0):
<test_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test_fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int abc(int);
int def(int x) { return abc(x * 2); }


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

x86 assembly (clang, -O2):
<def>:
add    %edi,%edi
jmp    1030 <abc@plt>

LLVM IR (-O0):
define i32 @def(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = call i32 @abc(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @def(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @abc(i32 %2)
ret i32 %3
}