xunge/DecIR huggingface dataset:
/* Variables and functions */
int fls(unsigned long);
unsigned fls_long(unsigned long l) { return fls(l); }


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

x86 assembly (clang, -O2):
<fls_long>:
jmp    1030 <fls@plt>

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

LLVM IR (-O2):
define i32 @fls_long(i64 %0) {
%2 = tail call i32 @fls(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned char f4(unsigned char x) {
  unsigned char r = 2U - x;
  if (r <= 2U)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x2,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x2,%eax
ja     1140 <f4+0x30>
xor    %edi,%edi
call   1030 <foo@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    $0x2,%bl
sub    %dil,%bl
cmp    $0x2,%bl
ja     1122 <f4+0x12>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @f4(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = sub i32 2, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp ule i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @foo(i32 0)
br label %13
13: ; preds = %11, %1
%14 = load i8, i8* %3
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @f4(i8 zeroext %0) {
%2 = sub i8 2, %0
%3 = icmp ult i8 %2, 3
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @foo(i32 0)
br label %6
6: ; preds = %4, %1
ret i8 %2
}
int CG_im14(i)
int i;
{ return ((i & 0x2000) >> 13) | ((i & 0x1fff) << 1); }


x86 assembly (clang, -O0):
<CG_im14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2000,%eax
sar    $0xd,%eax
mov    -0x4(%rbp),%ecx
and    $0x1fff,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_im14>:
mov    %edi,%eax
shr    $0xd,%eax
and    $0x1,%eax
and    $0x1fff,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @CG_im14(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8192
%5 = ashr i32 %4, 13
%6 = load i32, i32* %2
%7 = and i32 %6, 8191
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @CG_im14(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %2, 1
%4 = shl i32 %0, 1
%5 = and i32 %4, 16382
%6 = or i32 %3, %5
ret i32 %6
}
void estimator_propagate_state(void) {}


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

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

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

LLVM IR (-O2):
define void @estimator_propagate_state() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(unsigned long);
int main() { f(1UL | (unsigned long)3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i64 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i64 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shout(char *, char *);
void show_version() {
  shout("BNAC linux hack version %s, by sTeeL<steel.mental@gmail.com>\n",
        "1.0.0.4");
}


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

x86 assembly (clang, -O2):
<show_version>:
lea    0xee9(%rip),%rdi
lea    0xf20(%rip),%rsi
jmp    1030 <shout@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"BNAC linux hack version %s, by sTeeL<steel.mental@gmail.com>\0A\00"
@.str.1 = [8 x i8] c"1.0.0.4\00"
define void @show_version() {
%1 = call i32 @shout(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"BNAC linux hack version %s, by sTeeL<steel.mental@gmail.com>\0A\00"
@.str.1 = [8 x i8] c"1.0.0.4\00"
define void @show_version() {
%1 = tail call i32 @shout(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void print_license(void) {
  printf("Ident2 version %s, Copyright (C) 1999-2004 Michael Bacarella\n",
         "1.05-FINAL");
  puts("ident2 is free software, and you are welcome to redistribute it\n"
       "under certain conditions; ident2 comes with ABSOLUTELY NO WARRANTY;\n"
       "for details, go to http://www.gnu.org/\n");
}


x86 assembly (clang, -O0):
<print_license>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf0c(%rip),%rsi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_license>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0f(%rip),%rsi
call   1040 <printf@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Ident2 version %s, Copyright (C) 1999-2004 Michael Bacarella\0A\00"
@.str.1 = [11 x i8] c"1.05-FINAL\00"
@.str.2 = [172 x i8] c"ident2 is free software, and you are welcome to redistribute it\0Aunder certain conditions; ident2 comes with ABSOLUTELY NO WARRANTY;\0Afor details, go to http://www.gnu.org/\0A\00"
define void @print_license() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Ident2 version %s, Copyright (C) 1999-2004 Michael Bacarella\0A\00"
@.str.1 = [11 x i8] c"1.05-FINAL\00"
@.str.2 = [172 x i8] c"ident2 is free software, and you are welcome to redistribute it\0Aunder certain conditions; ident2 comes with ABSOLUTELY NO WARRANTY;\0Afor details, go to http://www.gnu.org/\0A\00"
define void @print_license() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([172 x i8], [172 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ POLLOUT;
int poll(struct pollfd *, int, int /*<<< orphan*/);
int socket_can_write(int fd) {
  struct pollfd set;
  set.fd = fd;
  set.events = POLLOUT;
  return poll(&set, 1, 0);
}


x86 assembly (clang, -O0):
<socket_can_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_can_write>:
push   %rax
mov    %edi,(%rsp)
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLOUT = global i32 0
define i32 @socket_can_write(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.pollfd
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @POLLOUT
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @poll(%struct.pollfd* %3, i32 1, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLOUT = global i32 0
define i32 @socket_can_write(i32 %0) {
%2 = alloca %struct.pollfd
%3 = bitcast %struct.pollfd* %2 to i8*
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @POLLOUT
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 1
store i32 %5, i32* %6
%7 = call i32 @poll(%struct.pollfd* %2, i32 1, i32 0)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t spi_tx_is_full(uint32_t *spi) { return !(spi[0x00C / 4] & 0x02); }


x86 assembly (clang, -O0):
<spi_tx_is_full>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_tx_is_full>:
xor    %eax,%eax
testb  $0x2,0xc(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @spi_tx_is_full(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @spi_tx_is_full(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
%6 = xor i32 %5, 1
ret i32 %6
}
int main() {
  int s = 1;
  int *p = &s;
  *p = 3;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test28() {
  int len;
  return sizeof(int[len]);
}


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

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

LLVM IR (-O0):
define i32 @test28() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = zext i32 %2 to i64
%4 = mul nuw i64 4, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test28() {
ret i32 0
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void AVRCP_ResponseSink_AVTransport_SetPlayMode(struct UPnPService *Service,
                                                int ErrorCode, void *User) {
  printf("AVRCP_ Invoke Response: AVTransport/SetPlayMode[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_AVTransport_SetPlayMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [66 x i8] c"AVRCP_ Invoke Response: AVTransport/SetPlayMode[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_SetPlayMode(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [66 x i8] c"AVRCP_ Invoke Response: AVTransport/SetPlayMode[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_SetPlayMode(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int fn(int a, int b) {
  int out = a;
  if (a > b)
    out = a / b;
  return out;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1126 <fn+0x26>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
mov    %edi,%eax
cmp    %esi,%edi
jle    1109 <fn+0x9>
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @fn(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_command_status_get_status(const uint8_t *event) {
  return event[2];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_command_status_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_command_status_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
unsigned rightrot(unsigned x, int n) { return x >> n; }


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

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ FetchOpcode(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void StartSwitch(FILE *fh, int FetchOffset) {
  FetchOpcode(fh, FetchOffset);
  fprintf(fh, "Opcode = Opcode & 0x0ff;\r\n");
  fprintf(fh, "switch (Opcode)\r\n");
  fprintf(fh, "{\r\n");
}


x86 assembly (clang, -O0):
<StartSwitch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <FetchOpcode@plt>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StartSwitch>:
push   %rbx
mov    %rdi,%rbx
call   1030 <FetchOpcode@plt>
lea    0xed0(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xed2(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xecb(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Opcode = Opcode & 0x0ff;\0D\0A\00"
@.str.1 = [18 x i8] c"switch (Opcode)\0D\0A\00"
@.str.2 = [4 x i8] c"{\0D\0A\00"
define void @StartSwitch(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 @FetchOpcode(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Opcode = Opcode & 0x0ff;\0D\0A\00"
@.str.1 = [18 x i8] c"switch (Opcode)\0D\0A\00"
@.str.2 = [4 x i8] c"{\0D\0A\00"
define void @StartSwitch(i32* %0, i32 %1) {
%3 = tail call i32 @FetchOpcode(i32* %0, i32 %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 26, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 17, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
int get_current_time(void *self, double *time) {
  *time = -1.;
  return (0);
}


x86 assembly (clang, -O0):
<get_current_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time>:
movabs $0xbff0000000000000,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_current_time(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load double*, double** %4
store double -1.000000e+00, double* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @get_current_time(i8* nocapture readnone %0, double* nocapture writeonly %1) {
store double -1.000000e+00, double* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char const *strrchr(char const *, char);
int main() {
  const char *x = "foo bar baz";
  assert(strrchr(x, 'z') == x + 10);
  assert(strrchr(x, ' ') == x + 7);
  assert(strrchr(x, 'x') == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7a,%esi
call   1030 <strrchr@plt>
mov    -0x10(%rbp),%rcx
add    $0xa,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strrchr@plt>
mov    -0x10(%rbp),%rcx
add    $0x7,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x78,%esi
call   1030 <strrchr@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"foo bar baz\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 122)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 10
%7 = icmp eq i8* %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %2
%11 = call i8* @strrchr(i8* %10, i8 signext 32)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 7
%14 = icmp eq i8* %11, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8*, i8** %2
%18 = call i8* @strrchr(i8* %17, i8 signext 120)
%19 = icmp eq i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xmotion_display(void *_p) {
  return (void *)((XEvent *)_p)->xmotion.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xmotion_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void NUL_Close(void) {}


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

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

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

LLVM IR (-O2):
define void @NUL_Close() {
ret void
}
int DRV_GET_HEAPINFO(unsigned int *allocSize, unsigned int *totalSize) {
  return 0;
}


x86 assembly (clang, -O0):
<DRV_GET_HEAPINFO>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @DRV_GET_HEAPINFO(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ unsetenv(char *);
int do_unsetenv(int argc, char **argv) {
  char *varname;
  if (argc != 2) {
    puts("Usage: unsetenv varname");
    return -1;
  }
  varname = argv[1];
  unsetenv(varname);
  return 0;
}


x86 assembly (clang, -O0):
<do_unsetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1151 <do_unsetenv+0x31>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <do_unsetenv+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <unsetenv@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_unsetenv>:
push   %rax
cmp    $0x2,%edi
jne    1133 <do_unsetenv+0x13>
mov    0x8(%rsi),%rdi
call   1040 <unsetenv@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: unsetenv varname\00"
define i32 @do_unsetenv(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @unsetenv(i8* %15)
store i32 0, i32* %3
br label %17
17: ; preds = %11, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: unsetenv varname\00"
define i32 @do_unsetenv(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @unsetenv(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ sleep(int);
void *Thread1(void *x) {
  sleep(1);
  bar1();
  return NULL;
}


x86 assembly (clang, -O0):
<Thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1030 <bar1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread1>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <bar1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @Thread1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 1)
%4 = call i32 (...) @bar1()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Thread1(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 (...) @bar1()
ret i8* null
}
int test_imm_B0int16_reg(short val) {
  return ((val) & (-0xB0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B0int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -176
%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_B0int16_reg(i16 signext %0) {
%2 = and i16 %0, -176
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Spin();
int main(int argc, char *argv[]) {
  while (1) {
    Spin();
  }
}


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 <Spin@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Spin@plt>
jmp    1120 <main+0x10>

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
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @Spin()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @Spin()
br label %3
}
void ft_strclr(char *s) {
  int i;
  if (s) {
    i = 0;
    while (s[i]) {
      s[i] = '\0';
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <ft_strclr+0x4b>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <ft_strclr+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <ft_strclr+0x1a>
jmp    114b <ft_strclr+0x4b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
store i8 0, i8* %8
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_pic_eoi(int /*<<< orphan*/);
void timer_int_ack() { send_pic_eoi(0); }


x86 assembly (clang, -O0):
<timer_int_ack>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <send_pic_eoi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_int_ack>:
xor    %edi,%edi
jmp    1030 <send_pic_eoi@plt>

LLVM IR (-O0):
define void @timer_int_ack() {
%1 = call i32 @send_pic_eoi(i32 0)
ret void
}

LLVM IR (-O2):
define void @timer_int_ack() {
%1 = tail call i32 @send_pic_eoi(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int exp(double);
double sigmoid(double x) { return 1. / (1 + exp(-x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb3(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = add nsw i32 1, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
void get_name_by_number(long this_files_number, char *str) {
  sprintf(str, "%lu", this_files_number);
}


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

x86 assembly (clang, -O2):
<get_name_by_number>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
define void @get_name_by_number(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i64, i64* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define void @get_name_by_number(i64 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beolv(char *, int *);
int /*<<< orphan*/ getKc();
int /*<<< orphan*/ kiir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setKc(int);
int kincsek() {
  int l;
  kiir("Adj meg egy szamot 1-1000-ig(Jelenleg %d): ", getKc());
  beolv("%d", &l);
  if (l > 0 && l <= 1000) {
    setKc(l);
  }
  return 1;
}


x86 assembly (clang, -O0):
<kincsek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getKc@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <kiir@plt>
lea    0xec8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <beolv@plt>
cmpl   $0x0,-0x4(%rbp)
jle    118c <kincsek+0x4c>
cmpl   $0x3e8,-0x4(%rbp)
jg     118c <kincsek+0x4c>
mov    -0x4(%rbp),%edi
call   1050 <setKc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kincsek>:
push   %rax
xor    %eax,%eax
call   1040 <getKc@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <kiir@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <beolv@plt>
mov    0x4(%rsp),%edi
lea    -0x1(%rdi),%eax
cmp    $0x3e7,%eax
ja     117a <kincsek+0x3a>
call   1050 <setKc@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Adj meg egy szamot 1-1000-ig(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @kincsek() {
%1 = alloca i32
%2 = call i32 (...) @getKc()
%3 = call i32 @kiir(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 1000
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = call i32 @setKc(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 1
}

LLVM IR (-O2):
@.str = [44 x i8] c"Adj meg egy szamot 1-1000-ig(Jelenleg %d): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @kincsek() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getKc()
%4 = tail call i32 @kiir(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @beolv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 1000
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @setKc(i32 %6)
br label %11
11: ; preds = %9, %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void SADError(const char *message) { fprintf(stderr, "%s\n", message); }


x86 assembly (clang, -O0):
<SADError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SADError>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @SADError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double interpolation2d(double x, double y, double z11, double z12, double z21,
                       double z22) {
  return (z22 * y * x + z12 * (1 - y) * x + z21 * y * (1 - x) +
          z11 * (1 - y) * (1 - x));
}


x86 assembly (clang, -O0):
<interpolation2d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movsd  0xec2(%rip),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe9a(%rip),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe6f(%rip),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolation2d>:
mulsd  %xmm1,%xmm5
movsd  0xef4(%rip),%xmm7
movapd %xmm7,%xmm6
subsd  %xmm1,%xmm6
mulsd  %xmm6,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm1,%xmm4
subsd  %xmm0,%xmm7
mulsd  %xmm7,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm2,%xmm6
mulsd  %xmm7,%xmm6
addsd  %xmm4,%xmm6
movapd %xmm6,%xmm0
ret

LLVM IR (-O0):
define double @interpolation2d(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %12
%14 = load double, double* %8
%15 = fmul double %13, %14
%16 = load double, double* %7
%17 = load double, double* %10
%18 = load double, double* %8
%19 = fsub double 1.000000e+00, %18
%20 = fmul double %17, %19
%21 = load double, double* %7
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %15, double %16, double %22)
%24 = load double, double* %11
%25 = load double, double* %8
%26 = fmul double %24, %25
%27 = load double, double* %7
%28 = fsub double 1.000000e+00, %27
%29 = call double @llvm.fmuladd.f64(double %26, double %28, double %23)
%30 = load double, double* %9
%31 = load double, double* %8
%32 = fsub double 1.000000e+00, %31
%33 = fmul double %30, %32
%34 = load double, double* %7
%35 = fsub double 1.000000e+00, %34
%36 = call double @llvm.fmuladd.f64(double %33, double %35, double %29)
ret double %36
}

LLVM IR (-O2):
define double @interpolation2d(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %1, %5
%8 = fsub double 1.000000e+00, %1
%9 = fmul double %8, %3
%10 = fmul double %9, %0
%11 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %10)
%12 = fmul double %1, %4
%13 = fsub double 1.000000e+00, %0
%14 = tail call double @llvm.fmuladd.f64(double %12, double %13, double %11)
%15 = fmul double %8, %2
%16 = tail call double @llvm.fmuladd.f64(double %15, double %13, double %14)
ret double %16
}
void g_hash_table_new_full() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_new_full() {
ret void
}
int sprintf(char *str __attribute__((unused)),
            const char *format __attribute__((unused)), ...) {
  return 0;
}


x86 assembly (clang, -O0):
<sprintf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sprintf(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
int do_146() { return 146; }


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

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

LLVM IR (-O0):
define i32 @do_146() {
ret i32 146
}

LLVM IR (-O2):
define i32 @do_146() {
ret i32 146
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
unsigned long get_XButtonEvent_serial(void *_p) {
  return (unsigned long)((XButtonEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XButtonEvent_serial(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
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XButtonEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str[16];
  int i;
  printf("str: ");
  scanf("%s", str);
  i = atoi(str);
  printf("i = %d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"str: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"i = %d\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @atoi(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}