xunge/DecIR huggingface dataset:
/* Variables and functions */
int msm_hsusb_phy_reset();
int msm_hsusb_rpc_phy_reset(void *addr) { return msm_hsusb_phy_reset(); }


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

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

LLVM IR (-O0):
define i32 @msm_hsusb_rpc_phy_reset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @msm_hsusb_phy_reset()
ret i32 %3
}

LLVM IR (-O2):
define i32 @msm_hsusb_rpc_phy_reset(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @msm_hsusb_phy_reset()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int are_equal_string(const void *a, const void *b) {
  return !strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<are_equal_string>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @are_equal_string(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @are_equal_string(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char const *, int, int /*<<< orphan*/ *, int);
int anetTcpNonBlockConnect(char *err, const char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, NULL, 1);
}


x86 assembly (clang, -O0):
<anetTcpNonBlockConnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%r8d
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetTcpNonBlockConnect>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @anetTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @anetTcpGenericConnect(i8* %7, i8* %8, i32 %9, i32* null, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @anetTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32* null, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlIntStatus(bool bMasked) {
  if (bMasked) {
    return ((*((volatile uint32_t *)(0x400FE058))));
  } else {
    return ((*((volatile uint32_t *)(0x400FE050))));
  }
}


x86 assembly (clang, -O0):
<SysCtlIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1120 <SysCtlIntStatus+0x20>
mov    $0x400fe058,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <SysCtlIntStatus+0x2a>
mov    $0x400fe050,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlIntStatus>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x400fe050(,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @SysCtlIntStatus(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 1074782296 to i32*)
store i32 %7, i32* %2
br label %10
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 1074782288 to i32*)
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @SysCtlIntStatus(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32* inttoptr (i64 1074782288 to i32*), i32* inttoptr (i64 1074782296 to i32*)
%4 = load volatile i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ b_main();
int /*<<< orphan*/ c_main();
int main(int argc, char *argv[]) {
  c_main();
  b_main();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <c_main@plt>
xor    %eax,%eax
call   1040 <b_main@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = call i32 (...) @c_main()
%7 = call i32 (...) @b_main()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @c_main()
%4 = tail call i32 (...) @b_main()
ret i32 0
}
int test_imm_E7uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xE7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E7uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 231
%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_E7uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15138816
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void default_isr(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<default_isr>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_isr+0x9>
jmp    1109 <default_isr+0x9>

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_path_get_dirname() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\n"
         "ReconOS v4 sort demo application\n"
         "--------------------------------\n"
         "\n"
         "Sorts a buffer full of data with a variable number of sw and hw "
         "threads.\n"
         "\n"
         "Usage:\n"
         "    sort_demo <num_hw_threads> <num_sw_threads> <num_of_blocks>\n"
         "\n"
         "    <num_hw_threads> - Number of hardware threads to create. The "
         "maximum number is\n"
         "                       limited by the hardware design.\n"
         "    <num_sw_threads> - Number of software threads to create.\n"
         "    <num_of_blocks>  - Number of blocks to create and sort. This "
         "must be a multiple of 2.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [505 x i8] c"\0AReconOS v4 sort demo application\0A--------------------------------\0A\0ASorts a buffer full of data with a variable number of sw and hw threads.\0A\0AUsage:\0A sort_demo <num_hw_threads> <num_sw_threads> <num_of_blocks>\0A\0A <num_hw_threads> - Number of hardware threads to create. The maximum number is\0A limited by the hardware design.\0A <num_sw_threads> - Number of software threads to create.\0A <num_of_blocks> - Number of blocks to create and sort. This must be a multiple of 2.\0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [504 x i8] c"\0AReconOS v4 sort demo application\0A--------------------------------\0A\0ASorts a buffer full of data with a variable number of sw and hw threads.\0A\0AUsage:\0A sort_demo <num_hw_threads> <num_sw_threads> <num_of_blocks>\0A\0A <num_hw_threads> - Number of hardware threads to create. The maximum number is\0A limited by the hardware design.\0A <num_sw_threads> - Number of software threads to create.\0A <num_of_blocks> - Number of blocks to create and sort. This must be a multiple of 2.\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([504 x i8], [504 x i8]* @str, i64 0, i64 0))
ret void
}
int ctf_is_error(int code) {
  if (code == 0 || code == 15 || code == 16)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<ctf_is_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1125 <ctf_is_error+0x25>
cmpl   $0xf,-0x8(%rbp)
je     1125 <ctf_is_error+0x25>
cmpl   $0x10,-0x8(%rbp)
jne    1131 <ctf_is_error+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1138 <ctf_is_error+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctf_is_error>:
cmp    $0x10,%edi
ja     1112 <ctf_is_error+0x12>
xor    %eax,%eax
mov    $0x18001,%ecx
bt     %edi,%ecx
jae    1112 <ctf_is_error+0x12>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ctf_is_error(i32 %0) {
switch i32 %0, label %2 [
i32 16, label %3
i32 15, label %3
i32 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
unsigned char APPL_GenerateMapping(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @APPL_GenerateMapping() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @APPL_GenerateMapping() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr,
                "usage: bog [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: bog [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: bog [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ leftShift(int, int);
int rightShift(int /*<<< orphan*/, int);
int getInstrIndex(int instruction) {
  return rightShift(leftShift(instruction, 6), 6);
}


x86 assembly (clang, -O0):
<getInstrIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1030 <rightShift@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInstrIndex>:
push   %rax
mov    $0x6,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x6,%esi
pop    %rax
jmp    1030 <rightShift@plt>

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

LLVM IR (-O2):
define i32 @getInstrIndex(i32 %0) {
%2 = tail call i32 @leftShift(i32 %0, i32 6)
%3 = tail call i32 @rightShift(i32 %2, i32 6)
ret i32 %3
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int, int, int);
extern struct SN_env *finnish_UTF_8_create_env(void) {
  return SN_create_env(1, 2, 1);
}


x86 assembly (clang, -O0):
<finnish_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<finnish_UTF_8_create_env>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @finnish_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 1, i32 2, i32 1)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @finnish_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 1, i32 2, i32 1)
ret %struct.SN_env* %1
}
int typeCount(int type) {
  return (type & 0x01) + (type >> 1 & 0x01) + (type >> 2 & 0x01) +
         (type >> 3 & 0x01);
}


x86 assembly (clang, -O0):
<typeCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<typeCount>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x3,%edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @typeCount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, 1
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = and i32 %10, 1
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 3
%15 = and i32 %14, 1
%16 = add nsw i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @typeCount(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %5, %7
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
ret i32 %11
}
/* Variables and functions */
double log(double);
double sv_c(double pv, double T) {
  return 10513.6 + 1859.0 * log(T / 298.15) - 461.5 * log(pv / 100000.0);
}


x86 assembly (clang, -O0):
<sv_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xef1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sv_c>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
divsd  0xede(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xed5(%rip),%xmm0
addsd  0xed5(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0xec9(%rip),%xmm0
call   1030 <log@plt>
mulsd  0xec4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sv_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 2.981500e+02
%7 = call double @log(double %6)
%8 = call double @llvm.fmuladd.f64(double 1.859000e+03, double %7, double 1.051360e+04)
%9 = load double, double* %3
%10 = fdiv double %9, 1.000000e+05
%11 = call double @log(double %10)
%12 = call double @llvm.fmuladd.f64(double -4.615000e+02, double %11, double %8)
ret double %12
}

LLVM IR (-O2):
define double @sv_c(double %0, double %1) {
%3 = fdiv double %1, 2.981500e+02
%4 = tail call double @log(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.859000e+03, double 1.051360e+04)
%6 = fdiv double %0, 1.000000e+05
%7 = tail call double @log(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double -4.615000e+02, double %5)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ save(char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void save_int(const char *key, int ival) {
  char val[64];
  snprintf(val, sizeof(val), "%i", ival);
  save(key, val);
}


x86 assembly (clang, -O0):
<save_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x40,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <save@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_int>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <save@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @save_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @save(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @save_int(i8* %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @save(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ nrerror(char *);
void **vvector0(long nl, long nh) {
  void **v;
  v = (void **)calloc((size_t)(nh - nl + 1 + 0), sizeof(void *));
  if (!v)
    nrerror("allocation failure in vvector0()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<vvector0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <vvector0+0x45>
lea    0xea0(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vvector0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x1(%rsi),%rdi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <vvector0+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in vvector0()\00"
define i8** @vvector0(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* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = call i64 @calloc(i64 %10, i32 8)
%12 = inttoptr i64 %11 to i8**
store i8** %12, i8*** %5
%13 = load i8**, i8*** %5
%14 = icmp ne i8** %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i8**, i8*** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = getelementptr inbounds i8*, i8** %21, i64 0
ret i8** %22
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in vvector0()\00"
define i8** @vvector0(i64 %0, i64 %1) {
%3 = sub i64 1, %0
%4 = add i64 %3, %1
%5 = tail call i64 @calloc(i64 %4, i32 8)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = sub i64 0, %0
%11 = inttoptr i64 %5 to i8**
%12 = getelementptr inbounds i8*, i8** %11, i64 %10
ret i8** %12
}
char *strcpy(char *dest, const char *src) {
  char *d = dest;
  while ((*d++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int VP8ClipUV(int const, int);
int VP8RGBToU(int r, int g, int b, int rounding) {
  const int u = -9719 * r - 19081 * g + 28800 * b;
  return VP8ClipUV(u, rounding);
}


x86 assembly (clang, -O0):
<VP8RGBToU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
imul   $0xffffda09,-0x4(%rbp),%eax
imul   $0x4a89,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x7080,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <VP8ClipUV@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VP8RGBToU>:
imul   $0xffffda09,%edi,%eax
imul   $0xffffb577,%esi,%esi
add    %eax,%esi
imul   $0x7080,%edx,%edi
add    %esi,%edi
mov    %ecx,%esi
jmp    1030 <VP8ClipUV@plt>

LLVM IR (-O0):
define i32 @VP8RGBToU(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = mul nsw i32 -9719, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 19081, %12
%14 = sub nsw i32 %11, %13
%15 = load i32, i32* %7
%16 = mul nsw i32 28800, %15
%17 = add nsw i32 %14, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = load i32, i32* %8
%20 = call i32 @VP8ClipUV(i32 %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @VP8RGBToU(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %0, -9719
%6 = mul i32 %1, -19081
%7 = add i32 %6, %5
%8 = mul nsw i32 %2, 28800
%9 = add nsw i32 %7, %8
%10 = tail call i32 @VP8ClipUV(i32 %9, i32 %3)
ret i32 %10
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (0 != r) {
    x = 42;
  } else {
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
je     1147 <main+0x37>
movl   $0x2a,-0x14(%rbp)
jmp    114e <main+0x3e>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x7,%ecx
mov    $0x2a,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp ne i32 0, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 42, i32* %6
br label %13
12: ; preds = %2
store i32 7, i32* %6
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 7, i32 42
ret i32 %5
}
int AddNumbers(int number_1, int number_2) {
  int sum = 0;
  sum = number_1 + number_2;
  return sum;
}


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

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

LLVM IR (-O0):
define i32 @AddNumbers(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
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @AddNumbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int smp_sio_seek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int smp_sio_seek_begin_offset(FILE *fp, long offset) {
  return smp_sio_seek(fp, offset, SEEK_SET);
}


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

x86 assembly (clang, -O2):
<smp_sio_seek_begin_offset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <smp_sio_seek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @smp_sio_seek_begin_offset(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @smp_sio_seek(i32* %5, i64 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @smp_sio_seek_begin_offset(i32* %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @smp_sio_seek(i32* %0, i64 %1, i32 %3)
ret i32 %4
}
char *langDbgMemRamMapped() { return "Mapped"; }


x86 assembly (clang, -O0):
<langDbgMemRamMapped>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgMemRamMapped>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Mapped\00"
define i8* @langDbgMemRamMapped() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"Mapped\00"
define i8* @langDbgMemRamMapped() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ appuyezEntree(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ separationTexte();
void sortirBoutique(void) {
  separationTexte();
  printf("Au revoir ! :)\n");
  appuyezEntree("Appuyez sur ENTREE pour sortir de la boutique");
}


x86 assembly (clang, -O0):
<sortirBoutique>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <separationTexte@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1050 <appuyezEntree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortirBoutique>:
push   %rax
xor    %eax,%eax
call   1040 <separationTexte@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1050 <appuyezEntree@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Au revoir ! :)\0A\00"
@.str.1 = [46 x i8] c"Appuyez sur ENTREE pour sortir de la boutique\00"
define void @sortirBoutique() {
%1 = call i32 (...) @separationTexte()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @appuyezEntree(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"Appuyez sur ENTREE pour sortir de la boutique\00"
@str = [15 x i8] c"Au revoir ! :)\00"
define void @sortirBoutique() {
%1 = tail call i32 (...) @separationTexte()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int strlen(char *);
char *make_ident(char *name, unsigned u) {
  size_t n = strlen(name) + 1;
  char *ident = malloc(n + sizeof(unsigned));
  *(unsigned *)ident = u & ~1U;
  memcpy(ident + sizeof(unsigned), name, n);
  return ident;
}


x86 assembly (clang, -O0):
<make_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xfffffffe,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ident>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rdi
lea    0x1(%rdi),%r15
add    $0x5,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
and    $0xfffffffe,%ebp
mov    %ebp,(%rax)
lea    0x4(%rax),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @make_ident(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = add i64 %11, 4
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %6
%14 = load i32, i32* %4
%15 = and i32 %14, -2
%16 = load i8*, i8** %6
%17 = bitcast i8* %16 to i32*
store i32 %15, i32* %17
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 4
%20 = load i8*, i8** %3
%21 = load i64, i64* %5
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
define i8* @make_ident(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, 4
%7 = tail call i8* @malloc(i64 %6)
%8 = and i32 %1, -2
%9 = bitcast i8* %7 to i32*
store i32 %8, i32* %9
%10 = getelementptr inbounds i8, i8* %7, i64 4
%11 = tail call i32 @memcpy(i8* %10, i8* %0, i64 %5)
ret i8* %7
}
int test_imm_6Auint32_mem(unsigned int *val) {
  return ((*val) & (0x6A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Auint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 106
%6 = icmp ne i32 %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_6Auint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 106
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ message(char *, int, int, float);
void henchman_collision_disadvantage(int k_self, int k_other, float v2) {
  message("colliding disadvantage henchman %d from %d at %f\n", k_self, k_other,
          v2);
}


x86 assembly (clang, -O0):
<henchman_collision_disadvantage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
lea    0xecb(%rip),%rdi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<henchman_collision_disadvantage>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"colliding disadvantage henchman %d from %d at %f\0A\00"
define void @henchman_collision_disadvantage(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @message(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, float %9)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"colliding disadvantage henchman %d from %d at %f\0A\00"
define void @henchman_collision_disadvantage(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @message(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, float %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chopSuffixAt(char *, char);
void chopSuffix(char *s) { chopSuffixAt(s, '.'); }


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

x86 assembly (clang, -O2):
<chopSuffix>:
mov    $0x2e,%esi
jmp    1030 <chopSuffixAt@plt>

LLVM IR (-O0):
define void @chopSuffix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @chopSuffixAt(i8* %3, i8 signext 46)
ret void
}

LLVM IR (-O2):
define void @chopSuffix(i8* %0) {
%2 = tail call i32 @chopSuffixAt(i8* %0, i8 signext 46)
ret void
}
void dump_cleanup(struct pci_access *a __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
%struct.pci_access = type opaque
define void @dump_cleanup(%struct.pci_access* nocapture %0) {
ret void
}
extern int h(int a) { return a; }


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

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @h(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("bini"
         " "
         "2.4"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"bini 2.4\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"bini 2.4\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterDataPut(uint32_t ui32Base, uint8_t ui8Data) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) = ui8Data;
}


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

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

LLVM IR (-O0):
define void @I2CMasterDataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 8
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterDataPut(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 8
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
int mouseb_none_axe_get(unsigned mouse, unsigned axe) {
  log_f("mouseb:none: mouseb_none_pos_get()\n");
  return 0;
}


x86 assembly (clang, -O0):
<mouseb_none_axe_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <log_f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"mouseb:none: mouseb_none_pos_get()\0A\00"
define i32 @mouseb_none_axe_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @log_f(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"mouseb:none: mouseb_none_pos_get()\0A\00"
define i32 @mouseb_none_axe_get(i32 %0, i32 %1) {
%3 = tail call i32 @log_f(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main() {
  char flags;
  __asm__("movb $0xFF, %%al; cmpb $0x02, %%al; lahf; movb %%ah, %%al"
          : "=a"(flags));
  printf("%02X\n", flags & (0x0001 | 0x0004 | 0x0040 | 0x0080 | 0x0010));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff,%al
cmp    $0x2,%al
lahf
mov    %ah,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
and    $0xd5,%esi
lea    0xecd(%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
mov    $0xff,%al
cmp    $0x2,%al
lahf
mov    %ah,%al
and    $0xd5,%al
movzbl %al,%esi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%02X\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i8 asm "movb $$0xFF, %al; cmpb $$0x02, %al; lahf; movb %ah, %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = and i32 %4, 213
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02X\0A\00"
define i32 @main() {
%1 = tail call i8 asm "movb $$0xFF, %al; cmpb $$0x02, %al; lahf; movb %ah, %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = and i8 %1, -43
%3 = zext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XColormapEvent;

/* Variables and functions */
int get_XColormapEvent_send_event(void *_p) {
  return (int)((XColormapEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XColormapEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XColormapEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int get_numeric_sysinfo_version(void) { return (0 * 10000) + (3 * 100) + 0; }


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

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

LLVM IR (-O0):
define i32 @get_numeric_sysinfo_version() {
ret i32 300
}

LLVM IR (-O2):
define i32 @get_numeric_sysinfo_version() {
ret i32 300
}
/* Variables and functions */
int /*<<< orphan*/ F_LOCK;
int /*<<< orphan*/ lockf(int, int /*<<< orphan*/, int /*<<< orphan*/);
void lock_file(int fd) { lockf(fd, F_LOCK, 0); }


x86 assembly (clang, -O0):
<lock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_file>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <lockf@plt>

LLVM IR (-O0):
@F_LOCK = global i32 0
define void @lock_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_LOCK
%5 = call i32 @lockf(i32 %3, i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
@F_LOCK = global i32 0
define void @lock_file(i32 %0) {
%2 = load i32, i32* @F_LOCK
%3 = tail call i32 @lockf(i32 %0, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int /*<<< orphan*/);
int starts_with(char *haystack, char *needle) {
  return !strncmp(haystack, needle, strlen(needle));
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @starts_with(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int bad2(int);
int bad5(void) { return bad2(1); }


x86 assembly (clang, -O0):
<bad5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <bad2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad5>:
mov    $0x1,%edi
jmp    1030 <bad2@plt>

LLVM IR (-O0):
define i32 @bad5() {
%1 = call i32 @bad2(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bad5() {
%1 = tail call i32 @bad2(i32 1)
ret i32 %1
}