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

/* Variables and functions */
int atomic_compare_exchange_strong(int /*<<< orphan*/ *, uintptr_t *,
                                   uintptr_t);
bool stdatomic_compare_exchange_ptr(atomic_uintptr_t *p, const void *expected,
                                    const void *replacement) {
  uintptr_t expected_uint = (uintptr_t)expected;
  return atomic_compare_exchange_strong(p, &expected_uint,
                                        (uintptr_t)replacement);
}


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

x86 assembly (clang, -O2):
<stdatomic_compare_exchange_ptr>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <atomic_compare_exchange_strong@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stdatomic_compare_exchange_ptr(i32* %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = ptrtoint i8* %1 to i64
store i64 %6, i64* %4
%7 = ptrtoint i8* %2 to i64
%8 = call i32 @atomic_compare_exchange_strong(i32* %0, i64* %4, i64 %7)
ret i32 %8
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *list_head(struct list *);
int /*<<< orphan*/ list_remove(struct list *);
struct list *list_pop_head(struct list *list) {
  struct list *e = list_head(list);
  list_remove(e);
  return e;
}


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

x86 assembly (clang, -O2):
<list_pop_head>:
push   %rbx
call   1030 <list_head@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <list_remove@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @list_pop_head(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list* @list_head(%struct.list* %4)
store %struct.list* %5, %struct.list** %3
%6 = load %struct.list*, %struct.list** %3
%7 = call i32 @list_remove(%struct.list* %6)
%8 = load %struct.list*, %struct.list** %3
ret %struct.list* %8
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @list_pop_head(%struct.list* %0) {
%2 = tail call %struct.list* @list_head(%struct.list* %0)
%3 = tail call i32 @list_remove(%struct.list* %2)
ret %struct.list* %2
}
int I2C_ReadBytes(int I2cSlaveAddr, int RegAddress, unsigned char *RxBuffer,
                  int NumberOfBytes) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @I2C_ReadBytes(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @I2C_ReadBytes(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
char is_checkmate(struct chessboard *c) { return 0; }


x86 assembly (clang, -O0):
<is_checkmate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.chessboard = type opaque
define signext i8 @is_checkmate(%struct.chessboard* %0) {
%2 = alloca %struct.chessboard*
store %struct.chessboard* %0, %struct.chessboard** %2
ret i8 0
}

LLVM IR (-O2):
%struct.chessboard = type opaque
define signext i8 @is_checkmate(%struct.chessboard* nocapture readnone %0) {
ret i8 0
}
int test5u(unsigned char x) { return x / 100 > 3; }


x86 assembly (clang, -O0):
<test5u>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test5u(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sgt i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test5u(i8 zeroext %0) {
ret i32 0
}
/* Variables and functions */
int fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int putchar(int character) { return fwrite((char *)&character, 1, 1, stdout); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @stdout
%5 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @stdout
%5 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32 %4)
ret i32 %5
}
int test_imm_1Euint8_mem(unsigned char *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 30
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef long long time_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long long);
int /*<<< orphan*/ stdout;
long long time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  long long now;
  time_t sec;
  sec = time(NULL);
  now = (1000000LL) * sec;
  fprintf(stdout, "%lld", now);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x20(%rbp)
imul   $0xf4240,-0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
imul   $0xf4240,%rax,%rdx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @time(i32* null)
store i64 %8, i64* %7
%9 = load i64, i64* %7
%10 = mul nsw i64 1000000, %9
store i64 %10, i64* %6
%11 = load i32, i32* @stdout
%12 = load i64, i64* %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%lld\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @time(i32* null)
%4 = mul nsw i64 %3, 1000000
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int main() {
  execl("pp", "pp", "hehe", NULL);
  puts("error");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
lea    0xed1(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execl@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execl@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"pp\00"
@.str.1 = [5 x i8] c"hehe\00"
@.str.2 = [6 x i8] c"error\00"
define i32 @main() {
%1 = call i32 @execl(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"pp\00"
@.str.1 = [5 x i8] c"hehe\00"
@.str.2 = [6 x i8] c"error\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int test_imm_7Eint32_reg(int val) { return ((val) & (0x7E << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_7Eint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Eint32_reg>:
test   $0x7e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Eint32_reg(i32 %0) {
%2 = and i32 %0, 126
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int USPS4CB(char *, char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char IMBcode[65];
  char RoutingCode[11];
  char TrackingCode[20];
  int ReturnCode;
  float version = 1.2;
  gets(RoutingCode);
  gets(TrackingCode);
  ReturnCode = USPS4CB(TrackingCode, RoutingCode, IMBcode);
  printf(IMBcode);
  exit(ReturnCode);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xea6(%rip),%xmm0
movss  %xmm0,-0x78(%rbp)
lea    -0x5b(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
lea    -0x5b(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <USPS4CB@plt>
mov    %eax,-0x74(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x30(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <USPS4CB@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [65 x i8]
%3 = alloca [11 x i8]
%4 = alloca [20 x i8]
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
store float 0x3FF3333340000000, float* %6
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%14 = call i32 @USPS4CB(i8* %11, i8* %12, i8* %13)
store i32 %14, i32* %5
%15 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* %15)
%17 = load i32, i32* %5
%18 = call i32 @exit(i32 %17)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [65 x i8]
%2 = alloca [11 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 @gets(i8* %5)
%8 = call i32 @gets(i8* %6)
%9 = call i32 @USPS4CB(i8* %6, i8* %5, i8* %4)
%10 = call i32 @printf(i8* %4)
%11 = call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void naturalN(int N) {
  if (N == -1)
    return;
  printf("%d ", N);
  return naturalN(N - 1);
}


x86 assembly (clang, -O0):
<naturalN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    113a <naturalN+0x1a>
jmp    1154 <naturalN+0x34>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <naturalN@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalN>:
push   %r14
push   %rbx
push   %rax
cmp    $0xffffffff,%edi
je     113f <naturalN+0x2f>
mov    %edi,%ebx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1130 <naturalN+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @naturalN(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %4, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ enomem();
void *ecalloc(size_t nmemb, size_t size) {
  void *ptr;
  if ((ptr = calloc(nmemb, size)) == NULL)
    enomem();
  return (ptr);
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1152 <ecalloc+0x32>
mov    $0x0,%al
call   1040 <enomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <ecalloc+0x15>
xor    %eax,%eax
call   1040 <enomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @enomem()
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @enomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nr_free_dvector(double *v, long nl, long nh) {
  free((char *)(v + nl - 1));
}


x86 assembly (clang, -O0):
<nr_free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_free_dvector>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nr_free_dvector(double* %0, i64 %1, i64 %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load double*, double** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds double, double* %7, i64 %8
%10 = getelementptr inbounds double, double* %9, i64 -1
%11 = bitcast double* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @nr_free_dvector(double* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds double, double* %0, i64 %1
%5 = getelementptr inbounds double, double* %4, i64 -1
%6 = bitcast double* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Type definitions */
struct command_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int gdb_exec(struct command_s *self, char **argp) {
  char *exec;
  char command[64] = {0};
  exec = argp[0];
  strcpy(command, "gdb ");
  strcpy(command + 4, exec);
  system(command);
  return 0;
}


x86 assembly (clang, -O0):
<gdb_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_exec>:
push   %r14
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    (%rsi),%rbx
lea    0xeb9(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.command_s = type { i32 }
@.str = [5 x i8] c"gdb \00"
define i32 @gdb_exec(%struct.command_s* %0, i8** %1) {
%3 = alloca %struct.command_s*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca [64 x i8]
store %struct.command_s* %0, %struct.command_s** %3
store i8** %1, i8*** %4
%7 = bitcast [64 x i8]* %6 to i8*
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
store i8* %10, i8** %5
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = load i8*, i8** %5
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%18 = call i32 @system(i8* %17)
ret i32 0
}

LLVM IR (-O2):
%struct.command_s = type { i32 }
@.str = [5 x i8] c"gdb \00"
define i32 @gdb_exec(%struct.command_s* nocapture readnone %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %1
%6 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 4
%8 = call i32 @strcpy(i8* %7, i8* %5)
%9 = call i32 @system(i8* %4)
ret i32 0
}
void vectorAdd(float *vxptr, float *vyptr, float vx, float vy) {
  *vxptr += vx;
  *vyptr += vy;
}


x86 assembly (clang, -O0):
<vectorAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorAdd>:
addss  (%rdi),%xmm0
movss  %xmm0,(%rdi)
addss  (%rsi),%xmm1
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @vectorAdd(float* %0, float* %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fadd float %11, %9
store float %12, float* %10
%13 = load float, float* %8
%14 = load float*, float** %6
%15 = load float, float* %14
%16 = fadd float %15, %13
store float %16, float* %14
ret void
}

LLVM IR (-O2):
define void @vectorAdd(float* nocapture %0, float* nocapture %1, float %2, float %3) {
%5 = load float, float* %0
%6 = fadd float %5, %2
store float %6, float* %0
%7 = load float, float* %1
%8 = fadd float %7, %3
store float %8, float* %1
ret void
}
int DUMMY_check_event(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @DUMMY_check_event() {
ret i32 0
}

LLVM IR (-O2):
define i32 @DUMMY_check_event() {
ret i32 0
}
/* Variables and functions */
unsigned int bit_population_count(unsigned int);
unsigned int bit_propagate_ones_towards_right(unsigned int);
unsigned int bit_floor_log2_impl(unsigned int n) {
  n = bit_propagate_ones_towards_right(n);
  return (bit_population_count(n) - 1);
}


x86 assembly (clang, -O0):
<bit_floor_log2_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bit_propagate_ones_towards_right@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bit_population_count@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_floor_log2_impl>:
push   %rax
call   1040 <bit_propagate_ones_towards_right@plt>
mov    %eax,%edi
call   1030 <bit_population_count@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bit_floor_log2_impl(i32 %0) {
%2 = tail call i32 @bit_propagate_ones_towards_right(i32 %0)
%3 = tail call i32 @bit_population_count(i32 %2)
%4 = add i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ generateOredered(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  do {
    printf("Enter number of digits [1-9]: ");
    scanf("%d", &n);
  } while (n < 1 || n > 9);
  generateOredered(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1174 <main+0x44>
cmpl   $0x9,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113f <main+0xf>
mov    -0x8(%rbp),%edi
call   1050 <generateOredered@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xed8(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    -0xa(%rdi),%eax
cmp    $0xfffffff7,%eax
jb     1150 <main+0x20>
call   1050 <generateOredered@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Enter number of digits [1-9]: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -10
%8 = icmp ult i32 %7, -9
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = call i32 @generateOredered(i32 %6)
ret i32 0
}
int main(int argc, char **argv) { return 43 & 58; }


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

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

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
ret i32 42
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
int matches_this_character(char available, char required) {
  if (available == required) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<matches_this_character>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    112c <matches_this_character+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <matches_this_character+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches_this_character>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @matches_this_character(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @matches_this_character(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ character_to_null(char *, char);
char *read_line(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *read_line_io() {
  char *string = read_line(stdin);
  character_to_null(string, '\n');
  character_to_null(string, '\r');
  return string;
}


x86 assembly (clang, -O0):
<read_line_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <read_line@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <character_to_null@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1040 <character_to_null@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line_io>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <read_line@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <character_to_null@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <character_to_null@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @read_line_io() {
%1 = alloca i8*
%2 = load i32, i32* @stdin
%3 = call i8* @read_line(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @character_to_null(i8* %4, i8 signext 10)
%6 = load i8*, i8** %1
%7 = call i32 @character_to_null(i8* %6, i8 signext 13)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @read_line_io() {
%1 = load i32, i32* @stdin
%2 = tail call i8* @read_line(i32 %1)
%3 = tail call i32 @character_to_null(i8* %2, i8 signext 10)
%4 = tail call i32 @character_to_null(i8* %2, i8 signext 13)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_priority(char *prior) {
  write("json-task.json", "\"priority\":\"%s\", ", prior);
}


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

x86 assembly (clang, -O2):
<function_priority>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [18 x i8] c"\22priority\22:\22%s\22, \00"
define void @function_priority(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [18 x i8] c"\22priority\22:\22%s\22, \00"
define void @function_priority(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Out_Ln();
void outtest_wl(void) { Out_Ln(); }


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

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

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

LLVM IR (-O2):
define void @outtest_wl() {
%1 = tail call i32 (...) @Out_Ln()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int mezz_wait_event() {
  pause();
  return 0;
}


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

x86 assembly (clang, -O2):
<mezz_wait_event>:
push   %rax
xor    %eax,%eax
call   1030 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mezz_wait_event() {
%1 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
define i32 @mezz_wait_event() {
%1 = tail call i32 (...) @pause()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void a() { puts("this is a()"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"this is a()\00"
define void @a() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is a()\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int bsr(int val) {
  int mask, result;
  if (val != 0) {
    result = 32;
    mask = 0x80000000;
    while ((val & mask) == 0) {
      mask >>= 1;
      --result;
    }
  } else {
    result = 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<bsr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <bsr+0x4a>
movl   $0x20,-0xc(%rbp)
movl   $0x80000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1145 <bsr+0x45>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <bsr+0x1f>
jmp    1151 <bsr+0x51>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bsr>:
test   %edi,%edi
je     111a <bsr+0x1a>
js     111d <bsr+0x1d>
mov    $0x80000000,%ecx
mov    $0x20,%eax
sar    %ecx
add    $0xffffffff,%eax
test   %edi,%ecx
je     1110 <bsr+0x10>
ret
xor    %eax,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @bsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %1
store i32 32, i32* %4
store i32 -2147483648, i32* %3
br label %8
8: ; preds = %13, %7
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = and i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* %3
%15 = ashr i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
br label %8
18: ; preds = %8
br label %20
19: ; preds = %1
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @bsr(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 32, %3 ]
%7 = phi i32 [ %8, %5 ], [ -2147483648, %3 ]
%8 = ashr i32 %7, 1
%9 = add nsw i32 %6, -1
%10 = and i32 %8, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 32, %3 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void restart_apache(void) { system("/usr/sbin/apachectl restart"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"/usr/sbin/apachectl restart\00"
define void @restart_apache() {
%1 = call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"/usr/sbin/apachectl restart\00"
define void @restart_apache() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ doclose(char const *, int);
int doopen(char const *, int, int);
void docreate(const char *path) {
  int fd;
  fd = doopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0664);
  doclose(path, fd);
}


x86 assembly (clang, -O0):
<docreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
mov    $0x1b4,%edx
call   1030 <doopen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <doclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<docreate>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
or     (%rax),%esi
mov    $0x1b4,%edx
call   1030 <doopen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <doclose@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define void @docreate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = load i32, i32* @O_TRUNC
%9 = or i32 %7, %8
%10 = call i32 @doopen(i8* %4, i32 %9, i32 436)
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @doclose(i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define void @docreate(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = tail call i32 @doopen(i8* %0, i32 %6, i32 436)
%8 = tail call i32 @doclose(i8* %0, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double time(int /*<<< orphan*/ *);
int main() {
  printf("%.f\n", time(NULL));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.f\0A\00"
define i32 @main() {
%1 = tail call double @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int cairo_code_draw_envSaturationLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envSaturationLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envSaturationLabel_get_width() {
ret i32 7
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ tty_putchar(char const);
void tty_writestring(const char *data) {
  size_t datalen = strlen(data);
  for (size_t i = 0; i < datalen; i++)
    tty_putchar(data[i]);
}


x86 assembly (clang, -O0):
<tty_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <tty_writestring+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tty_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <tty_writestring+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_writestring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %rax,%rax
je     1153 <tty_writestring+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <tty_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <tty_writestring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @tty_writestring(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @tty_putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ SIOCSIFBRDADDR;
int /*<<< orphan*/ do_ip_set(char *, int /*<<< orphan*/, char *);
void do_ip_broad_set(char *p) { do_ip_set(p, SIOCSIFBRDADDR, "broadcast"); }


x86 assembly (clang, -O0):
<do_ip_broad_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
call   1030 <do_ip_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ip_broad_set>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdx
jmp    1030 <do_ip_set@plt>

LLVM IR (-O0):
@SIOCSIFBRDADDR = global i32 0
@.str = [10 x i8] c"broadcast\00"
define void @do_ip_broad_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @SIOCSIFBRDADDR
%5 = call i32 @do_ip_set(i8* %3, i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIOCSIFBRDADDR = global i32 0
@.str = [10 x i8] c"broadcast\00"
define void @do_ip_broad_set(i8* %0) {
%2 = load i32, i32* @SIOCSIFBRDADDR
%3 = tail call i32 @do_ip_set(i8* %0, i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/ const);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void serial_int32(uint8_t **const ptr, const int32_t v) {
  int32_t vo = htonl(v);
  memcpy(*ptr, &vo, sizeof vo);
  *ptr += sizeof vo;
}


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

x86 assembly (clang, -O2):
<serial_int32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
addq   $0x10,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_int32(i32** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = load i32*, i32** %0
%7 = call i32 @memcpy(i32* %6, i32* %3, i32 4)
%8 = load i32*, i32** %0
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %0
ret void
}
/* Variables and functions */
void stub1(long long, float);
void testClosureLLFrV(void (*closure)(long long, float), long long a1,
                      float a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112f <testClosureLLFrV+0x2f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLFrV>:
test   %rdi,%rdi
je     110d <testClosureLLFrV+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureLLFrV(void (i64, float)* %0, i64 %1, float %2) {
%4 = alloca void (i64, float)*
%5 = alloca i64
%6 = alloca float
store void (i64, float)* %0, void (i64, float)** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load void (i64, float)*, void (i64, float)** %4
%8 = icmp ne void (i64, float)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (i64, float)*, void (i64, float)** %4
%11 = load i64, i64* %5
%12 = load float, float* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureLLFrV(void (i64, float)* %0, i64 %1, float %2) {
%4 = icmp eq void (i64, float)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, float %2)
br label %6
6: ; preds = %5, %3
ret void
}
void glutSolidCube(GLfloat) {}


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

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

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

LLVM IR (-O2):
define void @glutSolidCube(i32 %0) {
ret void
}