xunge/DecIR huggingface dataset:
int test_imm_99uint16_reg(unsigned short val) {
  return ((val) & (-0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff67,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_99uint16_reg>:
test   $0xff67,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_99uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -153
%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_99uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -153
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void put_uint32_be(unsigned char *ptr, uint32_t data) {
  ptr[3] = data & 0xff;
  ptr[2] = (data >> 8) & 0xff;
  ptr[1] = (data >> 16) & 0xff;
  ptr[0] = (data >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_uint32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @put_uint32_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put_uint32_be(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Type definitions */
typedef scalar_t__ mode_t;

/* Variables and functions */
int dir_mutex_lock(int);
int /*<<< orphan*/ dir_mutex_unlock();
int mkdir(char const *, scalar_t__);
int mkdirat(int dirfd, const char *pathname, mode_t mode) {
  int rc;
  if (mode) {
  }
  rc = dir_mutex_lock(dirfd);
  if (rc < 0)
    return rc;
  rc = mkdir(pathname, mode);
  dir_mutex_unlock();
  return rc;
}


x86 assembly (clang, -O0):
<mkdirat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <mkdirat+0x23>
jmp    1153 <mkdirat+0x23>
mov    -0x8(%rbp),%edi
call   1040 <dir_mutex_lock@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1173 <mkdirat+0x43>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <mkdirat+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mkdir@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dir_mutex_unlock@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdirat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <dir_mutex_lock@plt>
test   %eax,%eax
js     1159 <mkdirat+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mkdir@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dir_mutex_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @mkdirat(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i64, i64* %7
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %5
%14 = call i32 @dir_mutex_lock(i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %8
store i32 %18, i32* %4
br label %25
19: ; preds = %12
%20 = load i8*, i8** %6
%21 = load i64, i64* %7
%22 = call i32 @mkdir(i8* %20, i64 %21)
store i32 %22, i32* %8
%23 = call i32 (...) @dir_mutex_unlock()
%24 = load i32, i32* %8
store i32 %24, i32* %4
br label %25
25: ; preds = %19, %17
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @mkdirat(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @dir_mutex_lock(i32 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @mkdir(i8* %1, i64 %2)
%8 = tail call i32 (...) @dir_mutex_unlock()
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %10
}
int intel_pmu_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_pmu_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void EssentialFunc13(char *Input) {
  char Buffer2S[2000];
  strcpy(Buffer2S, Input);
}


x86 assembly (clang, -O0):
<EssentialFunc13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x7e0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EssentialFunc13>:
sub    $0x7d8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x7d8,%rsp
ret

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

LLVM IR (-O2):
define void @EssentialFunc13(i8* %0) {
%2 = alloca [2000 x i8]
%3 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
void uDMAIntRegister(uint32_t ui32IntChannel, void (*pfnHandler)(void)) {
  ;

  ;
  IntRegister(ui32IntChannel, pfnHandler);
  IntEnable(ui32IntChannel);
}


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

x86 assembly (clang, -O2):
<uDMAIntRegister>:
push   %rbx
mov    %edi,%ebx
call   1040 <IntRegister@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @uDMAIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load i32, i32* %3
%6 = load void ()*, void ()** %4
%7 = bitcast void ()* %6 to void (...)*
%8 = call i32 @IntRegister(i32 %5, void (...)* %7)
%9 = load i32, i32* %3
%10 = call i32 @IntEnable(i32 %9)
ret void
}

LLVM IR (-O2):
define void @uDMAIntRegister(i32 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 %0, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_hashmap_add();
int /*<<< orphan*/ test_hashmap_del();
int /*<<< orphan*/ test_hashmap_free();
int /*<<< orphan*/ test_hashmap_get();
int /*<<< orphan*/ test_hashmap_len();
int /*<<< orphan*/ test_hashmap_new();
void test_all(void) {
  test_hashmap_new();
  test_hashmap_free();
  test_hashmap_add();
  test_hashmap_get();
  test_hashmap_del();
  test_hashmap_len();
}


x86 assembly (clang, -O0):
<test_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_hashmap_new@plt>
mov    $0x0,%al
call   1070 <test_hashmap_free@plt>
mov    $0x0,%al
call   1040 <test_hashmap_add@plt>
mov    $0x0,%al
call   1080 <test_hashmap_get@plt>
mov    $0x0,%al
call   1060 <test_hashmap_del@plt>
mov    $0x0,%al
call   1050 <test_hashmap_len@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all>:
push   %rax
xor    %eax,%eax
call   1030 <test_hashmap_new@plt>
xor    %eax,%eax
call   1070 <test_hashmap_free@plt>
xor    %eax,%eax
call   1040 <test_hashmap_add@plt>
xor    %eax,%eax
call   1080 <test_hashmap_get@plt>
xor    %eax,%eax
call   1060 <test_hashmap_del@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_hashmap_len@plt>

LLVM IR (-O0):
define void @test_all() {
%1 = call i32 (...) @test_hashmap_new()
%2 = call i32 (...) @test_hashmap_free()
%3 = call i32 (...) @test_hashmap_add()
%4 = call i32 (...) @test_hashmap_get()
%5 = call i32 (...) @test_hashmap_del()
%6 = call i32 (...) @test_hashmap_len()
ret void
}

LLVM IR (-O2):
define void @test_all() {
%1 = tail call i32 (...) @test_hashmap_new()
%2 = tail call i32 (...) @test_hashmap_free()
%3 = tail call i32 (...) @test_hashmap_add()
%4 = tail call i32 (...) @test_hashmap_get()
%5 = tail call i32 (...) @test_hashmap_del()
%6 = tail call i32 (...) @test_hashmap_len()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
char *strcat(char *, char *);
int main(void) {
  char mystring1[255];
  char mystring2[255];
  scanf("%s", mystring1);
  scanf("%s", mystring2);
  printf("%s\n", strcat(mystring1, mystring2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x210(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1050 <strcat@plt>
mov    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
lea    0xebd(%rip),%r15
lea    0x100(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
lea    0xe8d(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [255 x i8]
%3 = alloca [255 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i8* @strcat(i8* %8, i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i8* @strcat(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
int test_imm_A5uint8_reg(unsigned char val) {
  return ((val) & (-0xA5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A5uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff5b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A5uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -165
%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_A5uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 91
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 100, b = 999, temp;
  int *pa = &a, *pb = &b;
  printf("a=%d, b=%d\n", a, b);
  temp = *pa;
  *pa = *pb;
  *pb = temp;
  printf("a=%d, b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x3e7,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 100, i32 999)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 999, i32 100)
ret i32 0
}
int pop(int *a, int *x) {
  *x = *x - 1;
  return *(a + *x);
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
movslq (%rsi),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,(%rsi)
mov    -0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pop(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, 1
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @pop(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int flag_is_changeable_p(int);
int HaveCPUID(void) { return flag_is_changeable_p(0x200000); }


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

x86 assembly (clang, -O2):
<HaveCPUID>:
mov    $0x200000,%edi
jmp    1030 <flag_is_changeable_p@plt>

LLVM IR (-O0):
define i32 @HaveCPUID() {
%1 = call i32 @flag_is_changeable_p(i32 2097152)
ret i32 %1
}

LLVM IR (-O2):
define i32 @HaveCPUID() {
%1 = tail call i32 @flag_is_changeable_p(i32 2097152)
ret i32 %1
}
/* Type definitions */
struct network {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irc_send_raw(struct network *, char *, char const *,
                                char const *);
void irc_privmsg(struct network *net, const char *chan, const char *text) {
  irc_send_raw(net, "PRIVMSG %s :%s", chan, text);
}


x86 assembly (clang, -O0):
<irc_privmsg>:
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),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <irc_send_raw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_privmsg>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <irc_send_raw@plt>

LLVM IR (-O0):
%struct.network = type { i32 }
@.str = [15 x i8] c"PRIVMSG %s :%s\00"
define void @irc_privmsg(%struct.network* %0, i8* %1, i8* %2) {
%4 = alloca %struct.network*
%5 = alloca i8*
%6 = alloca i8*
store %struct.network* %0, %struct.network** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.network*, %struct.network** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @irc_send_raw(%struct.network* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.network = type { i32 }
@.str = [15 x i8] c"PRIVMSG %s :%s\00"
define void @irc_privmsg(%struct.network* %0, i8* %1, i8* %2) {
%4 = tail call i32 @irc_send_raw(%struct.network* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int const keyblock_decrypt(char const *);
int keyblock_lff(char const *);
const int keyblock_load(const char *filename, const char *deckey) {
  int err = keyblock_lff(filename);
  if (err != 0)
    return err;
  else
    return keyblock_decrypt(deckey);
}


x86 assembly (clang, -O0):
<keyblock_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <keyblock_lff@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1151 <keyblock_load+0x31>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <keyblock_load+0x3d>
mov    -0x18(%rbp),%rdi
call   1030 <keyblock_decrypt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyblock_load>:
push   %rbx
mov    %rsi,%rbx
call   1040 <keyblock_lff@plt>
test   %eax,%eax
je     112f <keyblock_load+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <keyblock_decrypt@plt>

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

LLVM IR (-O2):
define i32 @keyblock_load(i8* %0, i8* %1) {
%3 = tail call i32 @keyblock_lff(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @keyblock_decrypt(i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
int test_imm_A6uint16_reg(unsigned short val) {
  return ((val) & (0xA6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A6uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A6uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 166
%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_A6uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 166
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ *eeprom_fp();
int /*<<< orphan*/ fputc(unsigned char, int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, unsigned int, int /*<<< orphan*/);
void eeprom_put_char(unsigned int addr, unsigned char new_value) {
  FILE *fp = eeprom_fp();
  if (fseek(fp, addr, SEEK_SET)) {
    return;
  }
  fputc(new_value, fp);
}


x86 assembly (clang, -O0):
<eeprom_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <eeprom_fp@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
cmp    $0x0,%rax
je     1170 <eeprom_put_char+0x40>
jmp    117f <eeprom_put_char+0x4f>
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_put_char>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <eeprom_fp@plt>
mov    %rax,%rbx
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <fseek@plt>
test   %rax,%rax
je     1160 <eeprom_put_char+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret
movzbl %r14b,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @eeprom_put_char(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = call i32* (...) @eeprom_fp()
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %3
%9 = load i32, i32* @SEEK_SET
%10 = call i64 @fseek(i32* %7, i32 %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %17
13: ; preds = %2
%14 = load i8, i8* %4
%15 = load i32*, i32** %5
%16 = call i32 @fputc(i8 zeroext %14, i32* %15)
br label %17
17: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @eeprom_put_char(i32 %0, i8 zeroext %1) {
%3 = tail call i32* (...) @eeprom_fp()
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @fseek(i32* %3, i32 %0, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fputc(i8 zeroext %1, i32* %3)
br label %9
9: ; preds = %2, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int i;
  double oldrho;
  double beta = 0.0;
  double work = 1.0;
  for (i = 1; i <= 2; i++) {
    double rho = work * work;
    if (i != 1)
      beta = rho / oldrho;
    if (beta == 1.0)
      abort();
    work /= 2.0;
    oldrho = rho;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     11bf <main+0xaf>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     116d <main+0x5d>
movsd  -0x28(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1191 <main+0x81>
jp     1191 <main+0x81>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xe6a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %5
store i32 1, i32* %2
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %32
10: ; preds = %7
%11 = load double, double* %5
%12 = load double, double* %5
%13 = fmul double %11, %12
store double %13, double* %6
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load double, double* %6
%18 = load double, double* %3
%19 = fdiv double %17, %18
store double %19, double* %4
br label %20
20: ; preds = %16, %10
%21 = load double, double* %4
%22 = fcmp oeq double %21, 1.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %20
%26 = load double, double* %5
%27 = fdiv double %26, 2.000000e+00
store double %27, double* %5
%28 = load double, double* %6
store double %28, double* %3
br label %29
29: ; preds = %25
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %7
32: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ draw_map_sub(long, long, long, long, int);
void draw_map_force(long map_x, long map_y, long dx, long dy) {
  draw_map_sub(map_x, map_y, dx, dy, 1);
}


x86 assembly (clang, -O0):
<draw_map_force>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <draw_map_sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_map_force>:
mov    $0x1,%r8d
jmp    1030 <draw_map_sub@plt>

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

LLVM IR (-O2):
define void @draw_map_force(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @draw_map_sub(i64 %0, i64 %1, i64 %2, i64 %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usb_board_disconnect();
void usb_disconnect(void) { usb_board_disconnect(); }


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

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

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

LLVM IR (-O2):
define void @usb_disconnect() {
%1 = tail call i32 (...) @usb_board_disconnect()
ret void
}
/* Variables and functions */
int sv_set_autostop(int, int);
int vox_set_autostop(int slot, int stop) { return sv_set_autostop(slot, stop); }


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

x86 assembly (clang, -O2):
<vox_set_autostop>:
jmp    1030 <sv_set_autostop@plt>

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

LLVM IR (-O2):
define i32 @vox_set_autostop(i32 %0, i32 %1) {
%3 = tail call i32 @sv_set_autostop(i32 %0, i32 %1)
ret i32 %3
}
void gtk_tree_selection_count_selected_rows() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_count_selected_rows() {
ret void
}
void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) {}


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

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

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

LLVM IR (-O2):
%struct.channel_gk20a = type opaque
define void @gk20a_channel_update(%struct.channel_gk20a* nocapture %0, i32 %1) {
ret void
}
int get_num_digits(int num) {
  if (num == 0)
    return 1;
  int i = 0;
  if (num < 0)
    i++;
  while (num != 0) {
    i++;
    num = num / 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <get_num_digits+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1168 <get_num_digits+0x68>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1137 <get_num_digits+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <get_num_digits+0x3c>
cmpl   $0x0,-0x8(%rbp)
je     1162 <get_num_digits+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113c <get_num_digits+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_digits>:
test   %edi,%edi
je     1133 <get_num_digits+0x33>
mov    %edi,%eax
shr    $0x1f,%eax
nopl   0x0(%rax)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <get_num_digits+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_num_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 31
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %4, %3 ], [ %8, %5 ]
%7 = phi i32 [ %0, %3 ], [ %9, %5 ]
%8 = add nuw nsw i32 %6, 1
%9 = sdiv i32 %7, 10
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %13
}
/* Variables and functions */
char *country_map_lookup(char const *);
const char *hl_lookup_country(const char *country_code) {
  const char *longname = country_map_lookup(country_code);
  if (longname == NULL)
    return country_code;
  return longname;
}


x86 assembly (clang, -O0):
<hl_lookup_country>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <country_map_lookup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <hl_lookup_country+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <hl_lookup_country+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_lookup_country>:
push   %rbx
mov    %rdi,%rbx
call   1030 <country_map_lookup@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @hl_lookup_country(i8* %0) {
%2 = tail call i8* @country_map_lookup(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
ret i8* %4
}
/* Type definitions */
struct message {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fdopen(int, char *);
int message_serialize(int /*<<< orphan*/ *, struct message const *);
int /*<<< orphan*/ slog(char *);
int send_message(const struct message *message, int socket_fd) {
  FILE *socket_file = fdopen(socket_fd, "r+");
  if (socket_file == NULL)
    slog("fdopen()");
  return message_serialize(socket_file, message);
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xeb7(%rip),%rsi
call   1050 <fdopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <send_message+0x39>
lea    0xe9f(%rip),%rdi
call   1040 <slog@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <message_serialize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%r14
lea    0xec0(%rip),%rsi
mov    %eax,%edi
call   1050 <fdopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <send_message+0x2b>
lea    0xead(%rip),%rdi
call   1040 <slog@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <message_serialize@plt>

LLVM IR (-O0):
%struct.message = type { i32 }
@.str = [3 x i8] c"r+\00"
@.str.1 = [9 x i8] c"fdopen()\00"
define i32 @send_message(%struct.message* %0, i32 %1) {
%3 = alloca %struct.message*
%4 = alloca i32
%5 = alloca i32*
store %struct.message* %0, %struct.message** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32* @fdopen(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @slog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load %struct.message*, %struct.message** %3
%15 = call i32 @message_serialize(i32* %13, %struct.message* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.message = type { i32 }
@.str = [3 x i8] c"r+\00"
@.str.1 = [9 x i8] c"fdopen()\00"
define i32 @send_message(%struct.message* %0, i32 %1) {
%3 = tail call i32* @fdopen(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @slog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @message_serialize(i32* %3, %struct.message* %0)
ret i32 %8
}
int cairo_code_draw_pwrdecaycLabel_get_width() { return 116; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrdecaycLabel_get_width() {
ret i32 116
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrdecaycLabel_get_width() {
ret i32 116
}
long long int llabs(long long int j) { return j < 0 ? -j : j; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void poll_timings_nothing(void) { return; }


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

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

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

LLVM IR (-O2):
define void @poll_timings_nothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int tiny_hash_string_tester(const void *s1, const void *s2) {
  return !strcmp((const char *)s1, (const char *)s2);
}


x86 assembly (clang, -O0):
<tiny_hash_string_tester>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <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):
<tiny_hash_string_tester>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tiny_hash_string_tester(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @tiny_hash_string_tester(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct fdset {
  int dummy;
};

/* Variables and functions */
int *fdset_fd_ptr(struct fdset *, unsigned int);
int fdset_fd(struct fdset *fdset, unsigned int offset) {
  int *fd = fdset_fd_ptr(fdset, offset);
  return fd ? *fd : -1;
}


x86 assembly (clang, -O0):
<fdset_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <fdset_fd_ptr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1148 <fdset_fd+0x38>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <fdset_fd+0x45>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <fdset_fd+0x45>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdset_fd>:
push   %rax
call   1030 <fdset_fd_ptr@plt>
test   %rax,%rax
je     111f <fdset_fd+0xf>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fdset = type { i32 }
define i32 @fdset_fd(%struct.fdset* %0, i32 %1) {
%3 = alloca %struct.fdset*
%4 = alloca i32
%5 = alloca i32*
store %struct.fdset* %0, %struct.fdset** %3
store i32 %1, i32* %4
%6 = load %struct.fdset*, %struct.fdset** %3
%7 = load i32, i32* %4
%8 = call i32* @fdset_fd_ptr(%struct.fdset* %6, i32 %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %11
%16 = phi i32 [ %13, %11 ], [ -1, %14 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.fdset = type { i32 }
define i32 @fdset_fd(%struct.fdset* %0, i32 %1) {
%3 = tail call i32* @fdset_fd_ptr(%struct.fdset* %0, i32 %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = load i32, i32* %3
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
int isop(char c) {
  static char optab[] = "$;^()><`|&{}~";
  int i;
  i = 0;
  while (optab[i]) {
    if (c == optab[i])
      return (1);
    ++i;
  }
  return (0);
}


x86 assembly (clang, -O0):
<isop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2f04(%rip),%rax
cmpb   $0x0,(%rax,%rcx,1)
je     115b <isop+0x5b>
movsbl -0x5(%rbp),%eax
movslq -0xc(%rbp),%rdx
lea    0x2eeb(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114d <isop+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isop+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <isop+0x11>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isop>:
add    $0xdc,%dil
cmp    $0x5a,%dil
ja     1124 <isop+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
lea    0xee6(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@isop.optab = internal global [14 x i8] c"$;^()><`|&{}~\00"
define i32 @isop(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [14 x i8], [14 x i8]* @isop.optab, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %5
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [14 x i8], [14 x i8]* @isop.optab, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %13, %18
br i1 %19, label %20, label %21
20: ; preds = %11
store i32 1, i32* %2
br label %25
21: ; preds = %11
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %20
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isop(i8 signext %0) {
switch i8 %0, label %2 [
i8 36, label %3
i8 59, label %3
i8 94, label %3
i8 40, label %3
i8 41, label %3
i8 62, label %3
i8 60, label %3
i8 96, label %3
i8 124, label %3
i8 38, label %3
i8 123, label %3
i8 125, label %3
i8 126, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sort(int *);
int main() {
  int a[20] = {20, 19, 18, 17, 16, 15, 14, 13, 12, 11,
               10, 9,  8,  7,  6,  5,  4,  3,  2,  1};
  sort(a);
  return a[1] + 2 * a[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
call   1030 <sort@plt>
mov    -0x5c(%rbp),%eax
mov    -0x60(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sort@plt>
mov    (%rsp),%eax
add    %eax,%eax
add    0x4(%rsp),%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [20 x i32] [i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = bitcast [20 x i32]* %2 to i8*
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @sort(i32* %4)
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = mul nsw i32 2, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
@__const.main.a = [20 x i32] [i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @sort(i32* %3)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = shl nsw i32 %7, 1
%9 = add nsw i32 %8, %6
ret i32 %9
}